Hi there,
Here I have a situation that I am anticipating variables A to Z in dataset, if we have any variable missing in a resultant dataset then need to initialize that missing variable with a missing value
example: Expecting A B C D E F G variables in data set, but I got only A B C F variables in a resultant dataset in this case I need to initialize missed out variables D E G with missing value in the resultant dataset.
Any help would be very much appreciated and helps me very much
Thanks in advance
Manoj
Create a blueprint dataset without observations, and prepend that in a SET statement to the actual data:
data expect;
input a b c d e f g;
datalines;
;
data have;
input a b c f;
datalines;
1 1 1 1
2 2 2 2
;
data want;
set
expect
have
;
run;
Create a blueprint dataset without observations, and prepend that in a SET statement to the actual data:
data expect;
input a b c d e f g;
datalines;
;
data have;
input a b c f;
datalines;
1 1 1 1
2 2 2 2
;
data want;
set
expect
have
;
run;
Hi there,
Here I have a situation that I am anticipating variables A to Z in dataset, if we have any variable missing in a resultant dataset then need to initialize that missing variable with a missing value
example: Expecting A B C D E F G variables in data set, but I got only A B C F variables in a resultant dataset in this case I need to initialize missed out variables D E G with missing value in the resultant dataset.
Any help would be very much appreciated and helps me very much
Thanks in advance
Check this link
https://communities.sas.com/t5/SAS-Programming/Assign-variable-with-missing-valuesd/m-p/672750
Then check to see if you can guess who in your class the other poster may be.
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.