Help using Base SAS procedures

interpreting the SAS code

Not applicable
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
sc.maytarget sc.juntarget;
TotTar = sum(FTarget,ETarget);
TotRev = sum(FRev,ERev);
keep FlightID Destination Date TotTar TotRev;

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

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
Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation