BookmarkSubscribeRSS Feed
aj34321
Quartz | Level 8
D/All,
I have a below sample dataset -
field1,field2,status
AM1,BM1,ST1
AM1,BM1,ST3
AM1,BM1,ST2
AM1,BM1,ST4
AM1,BM1,ST4
AM1,BM1,ST1
AM1,BM1,ST2
AM1,BM1,ST3
AM1,BM1,ST1
AM1,BM1,ST3
AM1,BM1,ST1
AM1,BM1,ST1
AM1,BM1,ST1
AM1,BM1,ST1
AM1,BM1,ST1
AM1,BM1,ST1
AM1,BM1,ST3
AM1,BM2,ST1
AM1,BM2,ST3
AM1,BM2,ST3
AM1,BM2,ST4
AM1,BM2,ST3
AM1,BM2,ST1
AM1,BM2,ST2
AM1,BM2,ST3
AM1,BM2,ST1
AM1,BM2,ST2
AM1,BM2,ST3
AM1,BM2,ST1
AM1,BM2,ST3
AM1,BM2,ST2
AM1,BM2,ST2
AM1,BM2,ST1
AM1,BM2,ST2
Need to create similar freq dataset.
field1,field2,ST1,ST2,ST3,ST4
AM1,BM1,9,2,4,2
AM1,BM2,5,5,6,1
I cannot attach any excel data hence the input and output both are in CSV format. Request if anyone can provide me a way to create this format output.
For now ST1, ST2, ST3, ST4 are fixed observations but need a code which dynamically creates the output variables.
Thanks a lot,
Rgds, Anil
.
1 REPLY 1
Reeza
Super User

1. Run a proc freq to get the counts

2. Use Proc Transpose to transpose to required format

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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