Hi All,
- I have written Proc transpose with ID statement in which there are 10 variables and 4 of them(Var7 - 10 in table below) have more null values for most of the records.
- This is causing number of warnings, though there is no issue in Output. Please check table below o understand better.
Please suggest me, how to avoid warnings in this case. thanks in advance.
Var 1 | Var 2 | Var 3 | Var 4 | Var 5 | Var 6 | Var 7 | Var 8 | Var 9 | Var 10 |
1000 | aa | XX | CC | XYZ | 7-Jan-21 | ||||
1001 | bb | XX | CC | XYZ | 2-Sep-20 | ||||
1002 | cc | XX | CC | XYZ | 18-Sep-20 | ||||
1003 | dd | XX | CC | XYZ | 30-Nov-20 | ||||
1004 | ee | XX | CC | XYZ | 27-Mar-20 | ||||
1005 | ff | XX | CC | XYZ | 29-Apr-20 | More than 10 | NAP | 29-Apr-20 | Skeletal Survey |
1005 | XX | XX | CC | XYZ | 29-Apr-20 | Less Than 5 | xxx | 7-Jan-21 | abc survey |
Show us your code please.
Thanks for your response. I am just adding required part of code only here, Please find it below.
Value = 'ABC' ;
proc transpose data=XXX out=ZZZ (drop=_name_) let;
by &sort_subj_vars insname insrepetnum;
var value;
id var;
run;
Value = 'ABC' ;
/* this statement will throw an ERROR if it is not part of a data step */
proc transpose data=XXX out=ZZZ (drop=_name_) let;
by &sort_subj_vars insname insrepetnum;
/* how is macro variable sort_subj_vars set? */
var value;
id var; /* contrary to what you posted initially, you use only one variable named "var" */
run;
Please post some example data (in a data step with datalines, so we can create an exact duplicate of your dataset), and the complete log from the TRANSPOSE procedure. Run it with
options symbolgen;
so we can see what is contained in the macro variable(s) used.
Use this button
for copy/pasting the log, and the "little running man" right next to it for SAS code.
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.