BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Santha
Pyrite | Level 9

Rob

I want to have a column name called FEU in create data statement. I tried to do this  any many more variations like sum (ContainersfromPortstoLSPtoDC [p,t,c,d]).

But i get errors. Searched to see they syntax online but was not succesful either. 

 

create data test (where=(ContainersfromPortstoLSPtoDC > 1)) from
[Ports=p Transit=t LSP=c Destination=d]
FEU=ContainersfromPortstoLSPtoDC

1 ACCEPTED SOLUTION

Accepted Solutions
RobPratt
SAS Super FREQ

The error message should have been something like:

ERROR: Variable ContainersfromPortstoLSPtoDC is not on file WORK.TEST.

 

The WHERE= clause applies only to variables that are in the data set, so you should instead do:

create data test (where=(FEU > 1)) from
   [Ports=p Transit=t LSP=c Destination=d]
   FEU=ContainersfromPortstoLSPtoDC

View solution in original post

4 REPLIES 4
ballardw
Super User

It will really help you get better/quicker answers if when you get errors that you copy the text of the submitted code along with the messages or errors received from the log and paste all the text into a code box opened on the forum with the {I} or "running man" icon.

 

The code box is important because the log often places characters in the error messages that indicate where the error was determined but the main message windows will reformat white space resulting in those characters moving and becoming less useful.

The entire procedure or data step is important as sometimes the cause of the reported error is something from previous lines of code such as a missing semicolon.

 

We also sometimes have folks say they are getting errors when the actual message is a note or warning.

Santha
Pyrite | Level 9

Thank you. Yes. I will follow the practice going forward.

RobPratt
SAS Super FREQ

The error message should have been something like:

ERROR: Variable ContainersfromPortstoLSPtoDC is not on file WORK.TEST.

 

The WHERE= clause applies only to variables that are in the data set, so you should instead do:

create data test (where=(FEU > 1)) from
   [Ports=p Transit=t LSP=c Destination=d]
   FEU=ContainersfromPortstoLSPtoDC
Santha
Pyrite | Level 9

Rob

You are simply awesome. Can't thank you enough. 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1348 views
  • 4 likes
  • 3 in conversation