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
SAS Super FREQ
Hi:
Basically, if you have data like this:
[pre]
ID Email
110 Joyce@school.edu
110 Thomas@school.edu
120 James@school.edu
120 Jane@school.edu
120 John@school.edu
120 Louise@school.edu
120 Robert@school.edu
130 Alice@school.edu
130 Barbara@school.edu
130 Jeffrey@school.edu
140 Alfred@school.edu
140 Carol@school.edu
140 Henry@school.edu
140 Judy@school.edu
150 Janet@school.edu
150 Mary@school.edu
150 Ronald@school.edu
150 William@school.edu
160 Philip@school.edu
[/pre]

and you want to turn it into something like this:
[pre]
ID em1 em2 em3 em4 em5
110 Joyce@school.edu Thomas@school.edu
120 James@school.edu Jane@school.edu John@school.edu Louise@school.edu Robert@school.edu
130 Alice@school.edu Barbara@school.edu Jeffrey@school.edu
140 Alfred@school.edu Carol@school.edu Henry@school.edu Judy@school.edu
150 Janet@school.edu Mary@school.edu Ronald@school.edu William@school.edu
160 Philip@school.edu

[/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!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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