BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi All!!

I'm presently taking a listing of ID(account) numbers , then appending emails to this listing via db links etc.

The return I get back lists out each email individually, hence many lines with the same account #

ie: my list was originally say 2,600 records.

Now its 34,000

Is there a way I can then code to collapse the accounts to a single line and just list out the numerous emails on the same line.

Output will be a csv.


Many Thanks!
2 REPLIES 2
Cynthia_sas
Diamond | Level 26
Hi:
Basically, if you have data like this:
[pre]
ID Email
110 [email protected]
110 [email protected]
120 [email protected]
120 [email protected]
120 [email protected]
120 [email protected]
120 [email protected]
130 [email protected]
130 [email protected]
130 [email protected]
140 [email protected]
140 [email protected]
140 [email protected]
140 [email protected]
150 [email protected]
150 [email protected]
150 [email protected]
150 [email protected]
160 [email protected]
[/pre]

and you want to turn it into something like this:
[pre]
ID em1 em2 em3 em4 em5
110 [email protected] [email protected]
120 [email protected] [email protected] [email protected] [email protected] [email protected]
130 [email protected] [email protected] [email protected]
140 [email protected] [email protected] [email protected] [email protected]
150 [email protected] [email protected] [email protected] [email protected]
160 [email protected]

[/pre]

You will want to restructure or transpose your data. Under the Tasks by Category, I believe the name of the task in EG is just TRANSPOSE. Using the above data as an example, ID would be the Group By variable and email would be the variable to transpose. On the Options pane, EM would be the value for the prefix (in order to get EM1-EM5 as the column names).

cynthia
deleted_user
Not applicable
Hi Cynthia!!

Thank you sooooo much, worked like a charm!!

Regards!

CFC_SAS_Communities_400x225.jpg

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

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
  • 2 replies
  • 1745 views
  • 0 likes
  • 2 in conversation