BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
septemberbulb
Obsidian | Level 7

Hello, I am trying to create table using proc transpose to generate the things below. I dont know how to just convert the CODE to horizen but still fits the application_number and action and also the appstatusdate will change with it.  If anyone could help, I will appreciate that. Thanks.

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

Could be as simple as:

 

proc transpose data=have out=want(drop=_name_) prefix=code;
by APPLICATION_NUMBER APPSTATUSDATE ACTION notsorted;
var CODE;
run;
PG

View solution in original post

6 REPLIES 6
Shmuel
Garnet | Level 18

proc sort data=have; by application_numbar appstatusdate action code; run;

data want;

 set have;

    by application_numbar appstatusdate action;

        length code1 code2 $1;

        retain code1 code2;

        if first.action then do;

           code1=' '; code2=' ';

       end;

       if code='f' then code1=code;

       if code='s' then code2=code;

       if last.action then output;

run; 

Reeza
Super User

How do you identify a 'group' or know that the two rows go together?

PGStats
Opal | Level 21

Please post a machine readable version of your data. Can't do any processing on a picture of your data.

PG
septemberbulb
Obsidian | Level 7
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      

hope to change different code to a new column. thanks

PGStats
Opal | Level 21

Could be as simple as:

 

proc transpose data=have out=want(drop=_name_) prefix=code;
by APPLICATION_NUMBER APPSTATUSDATE ACTION notsorted;
var CODE;
run;
PG
septemberbulb
Obsidian | Level 7
Thank you very much. It works.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 6 replies
  • 948 views
  • 0 likes
  • 4 in conversation