BookmarkSubscribeRSS Feed
bondtk
Quartz | Level 8

Hi

 

I have got data like this:

 

App_type_flag

 

Rural

Consumer

Commercial

Agri

Mining

 

Questions 1.    What I want to is : When I run the grouping of this data in proc sql...

                        I want to combine the Rural and Agri as one.

 

so the App_type_flag  should take Rural and Agri as one observation , 

so Rural + Agri  should be considered as Agri . So App_type_flag  just show,  Agri, consumer, commercial, mining .

 

What would be the appropriate way to do this:

 

Should I create a new variable or just change the rural to agri with some code,  please advise.

 

 

Question2 :

 

Also I want to segment the data to remove those records which are withdrawn and it matches the certain app_types

 

data tk.SBOS_final;

set tk.application_fj;

where final_decision_flag not in ('Withdrawn');

 

also want to add where app_type_flag not in ('TEMP' , ' ' )

so trying to say where app_type_flag doesn't match TEMP and blanks and the final_decision flag is not in Withdrawn,  how do I combine them and how to write the code effectively.

 

Please advise.

 

thanks

1 REPLY 1
novinosrin
Tourmaline | Level 20

data have:

set have;

_App_type_flag=App_type_flag;

if App_type_flag= 'Rural' then  _App_type_flag='Agri';

run;

 

then do group by using _App_type_flag.. You can keep both the columns just to check the flow of data just in case.

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 664 views
  • 1 like
  • 2 in conversation