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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.