BookmarkSubscribeRSS Feed
Calcite | Level 5

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 $;
raw1 var1_1 var1_2 var1_3
raw2 var2_1 var2_2 var2_3
raw3 var3_1 var3_2 var3_3





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.


Diamond | Level 26

I'm really confused by your description. Could you please show us a sample output that matches the input data you show?

Paige Miller
Super User

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';

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.



Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.


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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 3 in conversation