×
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

How to create a new column in a SAS Data Studio Code Transform step?

How to create a new column in a SAS Data Studio Code Transform step?

How to create a new column in a SAS Data Studio Code Transform step?

(OP)
Hello. Don't ask me how I landed on SAS, but it's now on my plate so I am learning...

In my data plan, I am trying need to add a column to an existing dataset. The way I found to do it is by adding a column in a code transform. However, I am struggling to create a variable then assign that variable to the new column. I have looked at a few articles and I feel I am pretty close. As a matter of fact one of the iterations worked but I did not save it before. The error I am getting with this code is

The action was not successful
ERROR: Expecting an arithmetic operator.
ERROR: Syntax error, statement will be ignored.
ERROR: Statement is not valid or it is used out of proper order.
ERROR: Expecting an arithmetic operator. (occurred 16 times)
ERROR: Syntax error, statement will be ignored. (occurred 16 times)
ERROR: Statement is not valid or it is used out of proper order. (occurred 16 times)


Here is my code:

CODE --> step

/* BEGIN data step with the output table data */
data {{_dp_outputTable}} (caslib={{_dp_outputCaslib}} );
/* Set the input set */
set {{_dp_inputTable}} (caslib={{_dp_inputCaslib}} );
length _renamed $50;
if LabName = 'THIS LAB' THEN _renamed = 'THAT LAB' ELSE _renamed = LabName;
"Laboratory_Renamed" = _renamed;
/* END data step run */
run; 

What am I doing wrong?

Thank you!

MCP SQL Server 2000, MCTS SQL Server 2005, MCTS SQL Server 2008 (DBD, DBA), Training HOTT cert SQL Server 2012 Business Intelligence (SSIS, SSAS).

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