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-2024.png

 

Time is running out to save with the early bird rate. Register by Friday, March 1 for just $695 - $100 off the standard rate.

 

Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 

 

Register now!

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
  • 706 views
  • 4 likes
  • 3 in conversation