×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

PROC SQL

PROC SQL

PROC SQL

(OP)
I'm not sure whether this is an implemntation problem or a blip with SAS.

You are meant to able in SQL as part of the SELECT ... WHERE statement to write temporary variables for display based on any one of a number of operators.

But, if you try to do this in the version embedded in SAS, it sure don't like it!

eg SELECT (LAST || ',' || FIRST) FULLNAME, AGE
      FROM <DATASET>
      WHERE <CONDITIONS>;


This should extract the first and last names (presented as <Lastname,Firstname>) and the age from whatever dataset you're looking at.

However, on attempting to do this, I get a few of these errors:

ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, *, **, +, ',', -, /, <,<=, <>, =, >, >=, ?, AND, AS, CONTAINS, EQ, FROM, GE, GT, LE, LIKE, LT, NE, OR,^=, |, ||, ~=.

Can anyone help explain why this is happening please?

Thanks.

Bryan.

RE: PROC SQL

Hi Bryan,

I think the problem is some where in the WHERE condition statement.

Any way, the statement that U have given after the select does not contain the "AS" keyword, I guess.

RE: PROC SQL

Hi!

In SQL the first part of the select should read:

Select (First||','||Last) As FullName

hth
Jeff Bridgham

RE: PROC SQL

(OP)
Thanks guys.

Awarding you each a star would be a bit over the top, whereas awarding a star to one of you only would smack of favouritism. So, I've awarded neither of you a star.

Hope this is OK

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close