BookmarkSubscribeRSS Feed
PauliF
Calcite | Level 5
Hi everyone

I am new to SAS and EG although I have a lot of statistics experience I have just seemed to accidentally avoid this software so far

anyway I have done the tutorial and have SAS for dummies and the little book of SAS ...

but I am stumped at my first hurdle

the data I have is in rows of transactions not per customer...

so the first column is customer reference number and each customer typically has 3-6 rows showing each transaction.

(some have just 1 and some have as many as 20)

I want to create just one row per customer

there are columns after customer number recording some information

lets call them a, b, c, d, e and f

they have numbers but some of the numbers are not amounts they are area codes or other forms of classification (so I don't want to sum them)

what I want in my new data set is a number of columns:

i.e

policy number, a, b, c, d, e, f, a1, b1, c1, d1, e1, f1, a2, b2, c2, d2, e2, f2,........ a20, b20, c20, d20, e20, f20

I know this is an ETL task but I cannot get my data in any other format.

Is there a relatively easy way to do this?

I would know how to do it in Excel but I have a couple of million lines of data.

any help would be hugely appreciated

many thanks in advance


each customer ends up having
1 REPLY 1
goladin
Calcite | Level 5
Hi,

Based on your comments, I would recommend you to use a transpose step for each variable. By doing a simple transpose for each ID and variable, you can receive a row for each customer and an array for each column of variable. After creating these files, you can then merge them together to form a single file.

However, the best possible approach is actually to use a simple data step with retain statement and by statements to generate this data.

Regards,
Murphy

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

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 1 reply
  • 1004 views
  • 0 likes
  • 2 in conversation