Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Re-Assigning records into groups in SAS

Status
Not open for further replies.

ja01

Technical User
Dec 14, 2005
48
0
0
US
/*Print the report_log2 report, choosing variables
proc print data=test_log2;
run;

/*Use group count by rloguser */
/*Order=freq means sort descending*/
proc freq data=test_log2 order=freq;
tables rloguser;
run;

What I am trying to do is say that if the rloguser = 'Smith' then put him in the Group A, If rloguser = 'Jones' then put in group B. Right now I get a list of rlogusers in descending order which I asked for. Now I want to group them and reassign them to group names
 
Just use a data step.
Code:
 data testlog3;
   set testlog2;

   if rloguser = 'Smith' then group = 'A';
   else if reloguser = 'Jones' then group = 'B';
   ...
   ...
 run;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top