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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 687 views
  • 0 likes
  • 2 in conversation