Have you ever linked SAS code, If so, describe the link and
any required statements used to either process the code or
the step itself?
Answer Posted / prakhar
SAS code could be linked using the GOTO or the Link statement.
The difference between the LINK statement and the GO TO statement is in the action of a subsequent RETURN statement. A RETURN statement after a LINK statement returns execution to the statement that follows LINK. A RETURN statement after a GO TO statement returns execution to the beginning of the DATA step, unless a LINK statement precedes GO TO, in which case execution continues with the first statement after LINK. In addition, a LINK statement is usually used with an explicit RETURN statement, whereas a GO TO statement is often used without a RETURN statement.
When your program executes a group of statements at several points in the program, using the LINK statement simplifies coding and makes program logic easier to follow. If your program executes a group of statements at only one point in the program, using DO-group logic rather than LINK-RETURN logic is simpler.
Goto eg.
data info;
input x;
if 1<=x<=5 then go to add;
put x=;
add: sumx+x;
datalines;
7
6
323
;
Link Eg.
data hydro;
input type $ depth station $;
/* link to label calcu: */
if type =’aluv’ then link calcu;
date=today();
/* return to top of step */
return;
calcu: if station=’site_1′
then elevatn=6650-depth;
else if station=’site_2′
then elevatn=5500-depth;
/* return to date=today(); */
return;
datalines;
aluv 523 site_1
uppa 234 site_2
aluv 666 site_2
…more data lines…
;
GOTO – http://support.sas.com/onlinedoc/913/getDoc/en/lrdict.hlp/a000201949.htm
LINK – http://support.sas.com/onlinedoc/913/getDoc/en/lrdict.hlp/a000201972.htm
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How would you define the end of a macro?
Mention common programming errors committed in sas ?
how will you location sas platform applications available from web browser? : Sas-bi
What is the general format of function in sas? : sas-grid-administration
What are the five ways to do a table lookup in sas? : sas-grid-administration
explain the concepts and capabilities of business object? : Sas-bi
Hi Jeevan/Akshara I have tried to contact SASI Vats for latest Advanced SAS Programming Certification Dumps (A00-212) but have not got any response. I would highly and gratefully appreciate your assistance in this regard. If you guys have access to this, would you be kind enough to forward it to me ? I would abide by all the terms you have for this. Please, note my email id: upretigopi@yahoo.com Preti Sharma
Explain translate function?
what is sas olap server? : Sas-di
why is a stop statement needed for the point=option on a set statement? : Sas programming
In sas admin differentiate between roles and capabilities? : sas-grid-administration
where to use sas business intelligence? : Sas-bi
Give some examples where proc report’s defaults are different than proc print’s defaults?
what is null hypothesis? why do you consider that?
Differentiate between format and informat? : sas-grid-administration