BookmarkSubscribeRSS Feed
Maycrow
Fluorite | Level 6

Thanks for your help in advance, new to SAS. I'm gathering customers info and now in this section, I am bringing the sales agents and their offices.

 

The complete error is as follows in the log, with no other notes:

"ERROR: Describe error: IColumnsInfo: : GetColumnInfo Failed. : Deferred prepare could not be completed.: Statements(s) could not be prepared.: Incorrect syntax near '='. "

 

My libnames and everything else above this code works (this is the third section in a very long code).

I scrutinized this code for now more than 8 hours and paid particular attention to all sections containing the = sign, I cannot figure out why I get the error.

Thank you so much for another pair of eyes.

 

 

proc sql;
&EDR.;

 create table FS_WRKR as 
  select * from connection to edr_civ
    (Select distinct
      c.SERIAL_NUM_IDENTIF as SerialNum
     ,c.CASE_NAME
     ,c.COUNTY_CODE
     ,PGM.PGM_CODE
     ,PGM.CASE_ID
     ,pgm.pgm_ID
     ,o.OFFICE_NUM_IDENTIF as OfficeNum 
     ,o.OFFICE_NAME
     ,o.regn_code as Region_Code
     ,o.DISTR_CODE
     ,o.office_ID
     ,usw.WRKR_NUM_IDENTIF AS WRKRNUM
     ,usw.pos_ID
     ,s.FIRST_NAME AS WRKR_FNAME
     ,s.LAST_NAME AS WRKR_LNAME
     ,s.county_code
     ,pa.PGM_ID as paID
     ,pa.BEG_DATE as paBeg
     ,pa.END_DATE as paEnd
     ,pa.POS_ID
     ,spo.BEG_DATE  as spoBeg
     ,spo.END_DATE as spoEnd
     ,pos.ID as PosID
     ,pos.office_ID
     ,u.unit_num_identif AS unitnum
     ,u.unit_name

 

  From dbo. [case] as c,
    dbo.pgm,
    dbo.PGM_ASSIGN,
    dbo.OFFICE,
    dbo.UNIT,
    dbo.POS,
    dbo.STAFF,
    dbo.UVW_STAFF_WRKR,
    dbo.STAFF_POS_ASSIGN

 

   where ((c.id = pgm.case_id)
         and (PGM.ID = PGM_ASSIGN.PGM_ID)
         and (OFFICE.ID = POS.OFFICE_ID)
         and (UNIT.ID = POS.UNIT_ID)
         and (POS.ID = STAFF_POS_ASSIGN.POS_ID)
         and (STAFF.ID = STAFF_POS_ASSIGN.STAFF_ID)
         and (UVW_STAFF_WRKR.POS_ID = PGM_ASSIGN.POS_ID) )
         and (STAFF.COUNTY_CODE = '33')
         and (CASE.COUNTY_CODE = '33')
         and (PGM_ASSIGN.END_DATE >= '02/01/2020' 
                 PGM_ASSIGN.END_DATE >= STAFF_POS_ASSIGN.BEG_DATE)
         and (STAFF_POS_ASSIGN.END_DATE >= '02/01/2020'
                  STAFF_POS_ASSIGN.END_DATE >= PGM_ASSIGN.BEG_DATE)


    ORDER BY PGM_ASSIGN.PGM_ID,
                        PGM_ASSIGN.BEG_DATE desc);


 disconnect from edr_civ;

 

Quit;

 

 

 

 

 

 

 

2 REPLIES 2
SASKiwi
PROC Star

Not sure if this helps but it looks like there is a space here between 'dbo.' and '[case]'

From dbo. [case] as c,

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1099 views
  • 2 likes
  • 3 in conversation