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;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.