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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.