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

Hello,

I am supposed to read the SAS script and then create mapping document. I understood the whole script except following code-

DATA EMPTSLIP;
MERGE EMPHIST (IN=A) TSLIP (IN=B);
BY ENUM NWTIME;
IF A ;
run;

In the above code "IF A" is not understood. I searched online and found codes like IF A then OUTPUT but didn't find any code like IF A. What is going on there. Any help would be appreciated.

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
TomKari
Onyx | Level 15

SAS has a shortcut in the language.

 

IF A;

 

means the same in your context as

 

IF A THEN OUTPUT;

 

Personally, I prefer to use the latter to save confusion, but it's a question of programming style.

 

Tom

View solution in original post

2 REPLIES 2
TomKari
Onyx | Level 15

SAS has a shortcut in the language.

 

IF A;

 

means the same in your context as

 

IF A THEN OUTPUT;

 

Personally, I prefer to use the latter to save confusion, but it's a question of programming style.

 

Tom

arv
Calcite | Level 5 arv
Calcite | Level 5
It make sense because after running the code it just write observation to the data set. Thanks for your help!!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 667 views
  • 1 like
  • 2 in conversation