DATA Step, Macro, Functions and more

How can I reference the "exists" column in the dictionary.extfiles table?

Reply
Contributor
Posts: 25

How can I reference the "exists" column in the dictionary.extfiles table?

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

Respected Advisor
Posts: 3,156

Re: How can I reference the "exists" column in the dictionary.extfiles table?

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

Haikuo

New Contributor
Posts: 2

Re: How can I reference the "exists" column in the dictionary.extfiles table?

Hello,

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

Ask a Question
Discussion stats
  • 2 replies
  • 195 views
  • 0 likes
  • 3 in conversation