Hi community, I'm not sure how to answer this question. Your help is much appreciated!
What, if anything, is wrong with the following programs? An ellipsis (...) indicates proportions of a statement that are not germane to the exercise.
data one; infile...; length type 2; input lab grp m1-m50; run; data two; infile...; input lab grp type mx1-mx10; run; data merge; merge two one; by lab grp; run;
are 'one' and 'two' sorted by lab and grp? i.e.
proc sort data=one; by lab grp; run;
proc sort data=two; by lab grp; run;
*merge after here ...;
If this is not the issue, please include the log.
-unison
In the first step, variable type is defined but stays uninitialized. The length as such (2) is only valid on z/OS.
Thank you for your help! Should we put length statement in data two instead of data one because the type variable is not in data one?
length type $2;
Only code statements if there is a reason for them...
Merge cannot be used as the name of the dataset since it is restricted keyword.
datamerge;merge two one; by lab grp; run;
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 save with the early bird rate—just $795!
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.