Hi @k26_23 , this is your data set A. I have not figure out the solution for your request, also I do not quiet understand the intention of your request, i.e., what kind of dataset you would like to create, and what's for?
It looks to me like you are working on a dataset that has link ID to other datasets. But what's the sort-order column for? Looking from your dataset A, this column is character (if it is numeric the '01' to '06' would be displayed like '1' to '6', without the leading 0), so what's this column for (I converted this column to numeric, incase it is needed as an order variable)?
And it looks to me like, by the sort-order column you created a number for each Parameter column value, if so why not just order your data according to the Parameter column? Are you prompting some convoluted question and a false request that confused yourself? I tried some sql step but did not get the dataset you request. I'll post it here also.
data tumor1;
input Subject $1-7 Site 9-11 ID $13-17 Description $32.
Parameter $51-61 ParamDesc $43. sortorder $12.;
sortordernum=input(sortorder,8.);
datalines;
101-276 101 NTLDAT Date of Assessment 01
101-276 101 NTL01 CARCINOMATOSIS:CARCINOMATOSIS NTLSTAT Status 02
101-276 101 NTL02 LIVER:LIVER LESIONS NTLSTAT Statu 02
101-276 101 TLDAT Date of Assessment 03
101-276 101 TL01 ABDOMEN:RUQ OMENTAL MET TLMEAS_C Measurement 04
101-276 101 TL02 ABDOMEN:LEFT ABDOMEN OMENTAL MET TLMEAS_C Measurement 04
101-276 101 TL03 LIVER:LEFT LIVER DOME TLMEAS_C Measurement 04
101-276 101 TL04 LIVER:RIGHT LIVER DONE TLMEAS_C Measurement 04
101-276 101 TL01 ABDOMEN:RUQ OMENTAL MET TLYN1 Was lesion assessed at this visit 05
101-276 101 TL02 ABDOMEN:LEFT ABDOMEN OMENTAL MET TLYN1 Was lesion assessed at this visit 05
101-276 101 TL03 LIVER:LEFT LIVER DOME TLYN1 Was lesion assessed at this visit 05
101-276 101 TL04 LIVER:RIGHT LIVER DONE TLYN1 Was lesion assessed at this visit 05
101-276 101 TL01 ABDOMEN:RUQ OMENTAL MET TLYN2 Check if lesion is too small to measure 06
101-276 101 TL02 ABDOMEN:LEFT ABDOMEN OMENTAL MET TLYN2 Check if lesion is too small to measure 06
101-276 101 TL03 LIVER:LEFT LIVER DOME TLYN2 Check if lesion is too small to measure 06
101-276 101 TL04 LIVER:RIGHT LIVER DONE TLYN2 Check if lesion is too small to measure 06
101-276 101 TLSUM_C Sum of Diameters 07
101-276 101 NLDAT Date of Assessment 08
101-276 101 NL01 LIVER:RIGHT LOBE LIVER LESION NLSTAT Status 09
101-276 101 NL02 LIVER:LIVER LESIONS NLSTAT Status 09
101-276 101 NL01 LIVER:RIGHT LOBE LIVER LESION NLMEAS Measurement 10
101-276 101 NL02 LIVER:LIVER LESIONS NLMEAS Measurement 10
101-276 101 RSDAT Date of Assessment 11
101-276 101 RSORRES1 RECIST 1.1 Target Response 12
101-276 101 RSORRES2 RECIST 1.1 Non-Target Response 13
101-276 101 RSYN1 Were unequivocal new lesions identified 14
101-276 101 RSORRES4 Tumor Biomarker Response 15
101-276 101 TLPCNTCH % Change from Baseline 16
101-276 101 TLNADIR % Change from NADIR 17
101-276 101 RSORRES3 RECIST 1.1 Overall Response 18
;
run;
proc print data=tumor1;run;
The sql step I tried: (it does not create the request dataset though, just add a hint to solve the question):
proc sql;
select *
from tumor1
group by sortordernum
order by sortordernum,id;
quit;
... View more