Hi,
I don't know of any task that would do it directly. I suppose you could build multiple queries using the query task:
[pre]
proc sql;
create table hold1 as
select name,
sundry_code_001 as sundry_code,
sundry_val_001 as sundry_val
from lib.file;
quit;
[/pre]
And then you'd end up with 10 "work" files that you'd have to concatenate back together.
Or, you could open up a code node in EG and use a DATA Step program to build your output file with one pass through the data. For example, to actually make the output that I showed as Possibility 1, I made a work file called work.testit with just 3 numbered sundry codes and then this program "unarrayed" the variables and created one row for each name:
[pre]
data Poss1(keep=name sundry_code sundry_val);
set work.testit;
array sc $ sundry_code_001 - sundry_code_003;
array sv sundry_val_001 - sundry_val_003;
do i = 1 to 3 by 1;
sundry_code = sc(i);
sundry_val = sv(i);
output;
end;
run;
[/pre]
The result of this program is a dataset, WORK.POSS1 that contains the data as shown for Possibility 1 choice above. The DATA step has the ability to use the ARRAY statement to treat your "numbered" variables as though they are array members. So there's an ARRAY statement for sundry_code_001 - sundry_code_003 (a character $ array) and another ARRAY statement for sundry_val_001 - sundry_val_003 (a numeric array). Then, the DO loop creates the new variables sundry_code and sundry_val from the array members (using the sc(i) and sv(i) reference method). Finally, the OUTPUT statement outputs one row for every iteration through the loop. The KEEP option guarantees that the final dataset contains only the columns I want to keep in the final dataset.
For a production program, I would recommend a few more changes to guarantee that you did not output any rows if both sundry_code or sundry_val were missing. And perhaps add any format or label statements that would make the data more meaningful when it was used.
For more help with figuring out how to do this in EG, your best bet is to contact Tech Support.
cynthia