BookmarkSubscribeRSS Feed
jteres
Obsidian | Level 7

Hi-

I am finding that I can't reference the "exists" column in the table dictionary.extfiles. Here's the log from my session:

                     

25         proc sql ;

26              describe table dictionary.extfiles ;

NOTE: SQL table DICTIONARY.EXTFILES was created like:

create table DICTIONARY.EXTFILES

  (

   fileref char(8) label='Fileref',

   xpath char(1024) label='Pathname',

   xengine char(8) label='Engine Name',

   modate num format=DATETIME informat=DATETIME label='Date Modified',

   filesize num label='Size of File',

   level num label='File Concatenation Level',

   directory char(3) label='Directory?',

   exists char(3) label='Exists?',

   temporary char(3) label='Temporary?'

  );

27        

28              select    fileref,

29                        directory,

30                        exists,

                                _

                                22

                                76

ERROR 22-322: Syntax error, expecting one of the following: (, SELECT. 

ERROR 76-322: Syntax error, statement will be ignored.

31                        temporary

32              from      dictionary.extfiles ;

2                                                          The SAS System                          16:34 Wednesday, October 17, 2012

NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.

33        

34         quit ;

NOTE: The SAS System stopped processing this step because of errors.

NOTE: PROCEDURE SQL used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

     

35        

                 

As you can see, the column is named "exists" as per the describe table output, but it's interpreted as the EXISTS option in the SELECT statement....

Any ideas?

Thanks,

Jed

2 REPLIES 2
Haikuo
Onyx | Level 15

Yup, exists is reserved, you can't use it directly. use nliteral instead:  'exists'n

Haikuo

shahyash18_yahoo_com
Calcite | Level 5

Hello,

Exists is reserved words.you have to use literal.'exists'n

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 703 views
  • 0 likes
  • 3 in conversation