Help using Base SAS procedures

interpreting the SAS code

Reply
N/A
Posts: 0

interpreting the SAS code

Hello ,

could you please guide as to what does the following code mean :

data q2vienna;
set sc.aprtarget (rename=(Flight=FlightID
FClassTar=FTarget
EClassTar=ETarget))
sc.maytarget sc.juntarget;
TotTar = sum(FTarget,ETarget);
TotRev = sum(FRev,ERev);
keep FlightID Destination Date TotTar TotRev;
run;

proc print data=q2vienna;
run;
Super Contributor
Super Contributor
Posts: 3,174

Re: interpreting the SAS code

Posted in reply to deleted_user
First, there is a SAS DATA step - one that is creating a new file (DATA statement) by inputting multiple SAS files (SET statement), one having variables RENAMEd). Two new SAS variables are computed in assignment statements using the SUM function. Lastly, the KEEP statements tells the SAS system specifically what variables / columns to output to the file specified on the DATA statement.

The DATA step is followed by a SAS PROC step, executing the PRINT procedure, printing all SAS variables in the file WORK.q2vienna.

Scott Barry
SBBWorks, Inc.

Google advanced search argument, this topic/post:

data step programming introduction site:sas.com
Ask a Question
Discussion stats
  • 2 replies
  • 107 views
  • 0 likes
  • 3 in conversation