Hi All,
Your help is appreciated if You can!
I need to create dataset, all information about my data source and variables to be used for each single raw are stored in a sas dataset, lets say with the below structure
data source_info;
input raw_name $ var_param $ var_paramcd $ var_aval $;
datalines;
raw1 var1_1 var1_2 var1_3
raw2 var2_1 var2_2 var2_3
raw3 var3_1 var3_2 var3_3
.
.
run;
So I need to go through the file verticaly and for each record(raw data) output the data for parameter name, parameter code and AVAL, based on the VARx_y.
Thanks in advance.
Jho
I'm really confused by your description. Could you please show us a sample output that matches the input data you show?
Actual values and working through and example would be useful.
I can't tell what you expect for output.
How do you expect to provide the "Varx_y" value?
Did you mean to say " for each record(raw_name)" instead of " for each record(raw data)"?
Please be consistent about discussing values in terms of variable names. We have to guess what you mean when provide variable names that do not match terms discussed like " parameter name, parameter code and AVAL" when there are no variable actually with those names.
Maybe you want something like this:
Data want; set source_info; where raw_name ='raw1'; run;
Remember that computers are pretty literal and if your spelling of 'raw1' is different in the actual data set, such as "Raw1" or "raw 1" or "raw_1" then the where condition might not find what you want.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.