SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 20526: Swapping inputs to a join may result in invalid syntax

DetailsHotfixAboutRate It

In SAS® Data Integration Studio 3.4, if you swap inputs to an SQL join transformation in a job, the generated code results in bad syntax and the following errors are returned:

   ERROR 22-322: Syntax error, expecting one of the following: 
                 a name, (, AS, ON. 
   ERROR 76-322: Syntax error, statement will be ignored. 
 

The following code example demonstrates this problem.

This is a three table join in which the first input (lib2.BOOKED) is a left join and the second input (lib2.SITE) is a right join:

 
   ... 
   from 
      lib2.BOOKED left join 
      lib1.INVOICE 
         on 
         ( 
            BOOKED.INVNUMER = INVOICE.INVNUMER 
         ) right join 
      lib2.SITE 
         on 
         ( 
            INVOICE.REF4 = SITE.REF4 
            and INVOICE.CORPID = SITE.CORPID 
            and INVOICE.CLIENT = SITE.CLIENT 
         ) 
   ; 
   ... 
 

Swappping inputs on the second join generates bad syntax. There is no ON clause between the first two tables:

 
   ... 
   from 
      lib2.SITE right join 
      lib2.BOOKED left join 
      lib1.INVOICE 
         on 
         ( 
            BOOKED.INVNUMER = INVOICE.INVNUMER 
         ) 
         on 
         ( 
            INVOICE.REF4 = SITE.REF4 
            and INVOICE.CORPID = SITE.CORPID 
            and INVOICE.CLIENT = SITE.CLIENT 
         ) 
   ; 
   ... 
 

This is only likely to occur if the option Implicit is set to "No" on a join that is to the right of another join.

Select the Hot Fix tab in this note to access the hot fix for this issue.



Operating System and Release Information

Product FamilyProductSystemProduct ReleaseSAS Release
ReportedFixed*ReportedFixed*
SAS SystemSAS Data Integration StudioMicrosoft Windows Server 2003 Enterprise Edition3.44.29.1 TS1M3 SP49.2 TS1M0
Microsoft Windows 2000 Advanced Server3.44.29.1 TS1M3 SP49.2 TS1M0
Microsoft Windows 2000 Datacenter Server3.44.29.1 TS1M3 SP49.2 TS1M0
Microsoft Windows 2000 Server3.44.29.1 TS1M3 SP49.2 TS1M0
Microsoft Windows 2000 Professional3.44.29.1 TS1M3 SP49.2 TS1M0
Microsoft Windows Server 2003 Datacenter Edition3.44.29.1 TS1M3 SP49.2 TS1M0
Microsoft Windows XP Professional3.44.29.1 TS1M3 SP49.2 TS1M0
Microsoft Windows Server 2003 Standard Edition3.44.29.1 TS1M3 SP49.2 TS1M0
Microsoft® Windows® for x643.44.29.1 TS1M3 SP49.2 TS1M0
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.