morinia
asked on
Counting the number of columns in a SAS dataset after a proc transpose.
Experts,
I have just run this step in SAS.
Proc transpose data=diags out=dx;
by claim_id;
var diag;
run:
My question is once the file is created I can look at it and see how many diag columns were generated. I was just wondering if there was code to give me the results or to combine the next these two steps without manual intervention. The number of columns will vary relative to the data.
My next step is: (assuming 10 columns were generated)
Data dx_rename;
Set dx rename=col1-col10=dx10-dx1 0 drop=_name_ _label_);
run;
I have just run this step in SAS.
Proc transpose data=diags out=dx;
by claim_id;
var diag;
run:
My question is once the file is created I can look at it and see how many diag columns were generated. I was just wondering if there was code to give me the results or to combine the next these two steps without manual intervention. The number of columns will vary relative to the data.
My next step is: (assuming 10 columns were generated)
Data dx_rename;
Set dx rename=col1-col10=dx10-dx1
run;
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Proc transpose data=diags
out=dx(drop=_name_ _label_)
prefix=DX;
by claim_id;
var diag;
run: