BookmarkSubscribeRSS Feed
Hari2
Quartz | Level 8

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 1Var 2Var 3Var 4Var 5Var 6Var 7Var 8Var 9Var 10
1000aaXXCCXYZ7-Jan-21    
1001bbXXCCXYZ2-Sep-20    
1002ccXXCCXYZ18-Sep-20    
1003ddXXCCXYZ30-Nov-20    
1004eeXXCCXYZ27-Mar-20    
1005ffXXCCXYZ29-Apr-20More than 10NAP29-Apr-20Skeletal Survey
1005XXXXCCXYZ29-Apr-20Less Than 5xxx7-Jan-21abc survey
 

 

 

 

 

  

3 REPLIES 3
Hari2
Quartz | Level 8

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;

 

Kurt_Bremser
Super User
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

Bildschirmfoto 2020-04-07 um 08.32.59.jpg

for copy/pasting the log, and the "little running man" right next to it for SAS code.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1627 views
  • 0 likes
  • 3 in conversation