BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Ron_MacroMaven
Lapis Lazuli | Level 10

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

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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

1 REPLY 1
ballardw
Super User

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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1 reply
  • 689 views
  • 1 like
  • 2 in conversation