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


Please Help Members By Posting Answers For Below Questions

What do you know about symput and symget?

884


How to limit decimal places for variable using proc means?

731


What was the last computer book you purchased? Why?

2047


hi all, I need the SAS DI DUMP(A00 260) for attending the certification. if any one have, pls provide it.Please Email to vrpotluri@hotmail.com. Thanks - Ramana

5112


What are the limitations for memory allocation for SAS variables

1095






Mention what is SAS data set?

845


Do you need to know if there are any missing values?

747


I have a dataset concat having variable a b & c. How to rename a b to e & f?

744


What Proc glm does?

781


how many types of prompts are there? : Sas-bi

694


In proc transpose and data step with arrays which one you pick?

2729


What is connection profile? : sas-grid-administration

800


What are the difference between ceil and floor functions in sas?

954


What is the difference between the proc sql and data step?

815


it will become easy if uuu provide website linkssss and list of consultanciessssss

1696