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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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