Help using Base SAS procedures

dictionary.extfiles column exists

Accepted Solution Solved
Reply
Regular Contributor
Posts: 198
Accepted Solution

dictionary.extfiles column exists

I am sure I know enough sql to be dangerous.

Can anyone offer an explanation as to why I cannot reorder the variables in the the sql dictionary.extfiles?

PROC sql; describe table dictionary.extfiles;

          select * from dictionary.extfiles;

          select   fileref,directory,temporary,xpath

            from   dictionary.extfiles

           order   by fileref;

          ******   fails;

          select   fileref,directory,exists,temporary,xpath

            from dictionary.extfiles;

          quit;

A quick perusal of the OnLineDoc finds there is a function named exists in the GTL: Graph Template Language.q

OpSys: Win XP 32

SAS v9.3


Accepted Solutions
Solution
‎06-17-2015 05:35 PM
Super User
Posts: 10,500

Re: dictionary.extfiles column exists

Yep, the reason is it is expecting exists to be used as a function.

A work around is use of a table alias:

proc sql;

select   fileref,directory, a.exists, temporary, xpath

            from dictionary.extfiles as a;

          quit;

SQL function Exists tests if a subquery returns one or more rows. So without the table identifier it expects EXISTS to be used as a function.

Probably wasn't the best idea to name a column in the dictionary table with that name.

View solution in original post


All Replies
Solution
‎06-17-2015 05:35 PM
Super User
Posts: 10,500

Re: dictionary.extfiles column exists

Yep, the reason is it is expecting exists to be used as a function.

A work around is use of a table alias:

proc sql;

select   fileref,directory, a.exists, temporary, xpath

            from dictionary.extfiles as a;

          quit;

SQL function Exists tests if a subquery returns one or more rows. So without the table identifier it expects EXISTS to be used as a function.

Probably wasn't the best idea to name a column in the dictionary table with that name.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 158 views
  • 1 like
  • 2 in conversation