BookmarkSubscribeRSS Feed
ciccotelli412
Calcite | Level 5

Hey Everyone,

 

Hope this can be a quick answer

 

 

I have a dataset that appears as followed:

 

HSHLD_NO     PLU1     PLU2     PLU3     PLU4     PLU5

00000                234         345       456       567          678

 

I want it to appear as this:

HSHLD_NO      PLU

00000                234

00000                345

00000                456

00000                567

00000                678

 

How do I go about doing this?

 

Also, once it is formatted like this, how would I go about removing any duplicate entries?

 

For example:

 

HSHLD_NO     PLU

00000               234

00000               345

00000               456

00000               234

00000               567

00000               678

 

How would I remove one of the two entries that has HSHLD_NO = 00000 and PLU = 234

 

 

Thank you in advance

1 REPLY 1
JBailey
Barite | Level 11

Hi @ciccotelli412

 

Take a look at PROC TRANSPOSE. 

 

Here is the link to the doc...

http://support.sas.com/documentation/cdl/en/proc/70377/HTML/default/viewer.htm#p1n9l1b2dg00w9n1h3tov...

 

Best wishes,
Jeff

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!

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.

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