BookmarkSubscribeRSS Feed
khandelwalanmol
Fluorite | Level 6

I have trying to transform a dataset which is in raw format.

I need the data to be transposed.

 

The sequence and linenum in both the datasets is same.

Attaching the screenshots of the raw and requires transposed dataset.raw_procmod.PNGtransformed_procmod.PNG

4 REPLIES 4
tarheel13
Rhodochrosite | Level 12

Can you please post your data as datelines and post your code that you tried? 

Reeza
Super User
It looks like you're using EG. Have you tried the Transpose GUI task or are you looking for code?

proc transpose data=have out=want prefix = _procmod;
by eobkey;
id sequence;
var procmod;
run;

If this doesn't work for some reason, please explain how and provide details.
ballardw
Super User

Your output implies that the Procmod value of ER is on a record with Sequence=10. But that is not the case in the data. Linenum is missing for that record. So, how are we supposed to know that Linenum=10 should be used in this case? Or any of the cases where Sequence is actually missing?

 

Hint: sequence numbers that are not actually numeric can be a bit difficult to work with at times.

khandelwalanmol
Fluorite | Level 6
yes, the procmod belongs to the next sequence number in the sequence row.
for eg, LT belongs to sequence 6, Sequence 10 has two iterations ER and 25.
The sequence comes in the next row for every procmod.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 922 views
  • 0 likes
  • 4 in conversation