The values are not set to misisng, but the values ARE set to the values read from the input data set when the SET statement executes.
.
Run this little program and see.
data sample;
do i=1 to 3; output; end;
run;
data new ;
put 'Before SET :' i=;
set sample;
put 'After SET: ' i=;
run;
@balu_g wrote:
Variables that are created by the DATA step are set to missing at the beginning of each iteration of the DATA step. Variables that are read from a data set are not.thenmy question is if the variables that are read from data set are not to set missing, how sas will reading second obeservation values?
It's a straight input - the second observations are imported from the data set.
The values are not set to misisng, but the values ARE set to the values read from the input data set when the SET statement executes.
.
Run this little program and see.
data sample;
do i=1 to 3; output; end;
run;
data new ;
put 'Before SET :' i=;
set sample;
put 'After SET: ' i=;
run;
I think we're all saying the same thing, using different words.
When the SET statement reads the second (and the third, and the fourth ...) observation from a SAS data set, the values that it reads in replace the values that were in place previously. There is no need for the processing to re-set those variables to missing.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.