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

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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