Help using Base SAS procedures

Various questions on SAS procedures

Reply
Occasional Contributor
Posts: 9

Various questions on SAS procedures

[ Edited ]

 

Hi to all,

i have a problem with this:

The dataset initial is below:

ASSET TIPE DOB VEHICLE_AGE VEHICLE COST REG_DATE SNAPSHOT_DATE TERM
NEW 10/09/81 0 15000 01/03/14 01/04/14 12
USED 15/08/86 6 10000 01/09/13 01/04/14 12
NEW 26/11/92 0 20000 01/03/14 01/04/14 24
USED 17/02/95 18 5000 01/09/12 01/04/14 36

 

 can you help me please??

 

Find the resulting outputs for each of the below

1.

proc freq data= work initial_data noprint;

table ASSETTYPE/out=freq (drop=percent);

where vehicle_age<12;

run;

 

2.proc summary data=work.initial_data nway missing;

class ASSETTYPE;

var vehicle_cost;

where year(reg_date)>2012;

output out=summary (drop=type__freq_)

sum(vehicle_cost=summary;

run;

 

3.proc sort data=freq(where=(ASSETTYPE='NEW'));by ASSETTYPE;run;

proc sort data=summary;by ASSETTYPE;run;

data output_merged (keep=new_var);

merge freq (in=a)summary(in=b);

by ASSETTYPE;

if a;

 

new_var='count*summary;

run;

 

 

Super User
Super User
Posts: 9,599

Re: proc sql

These are some sort of learning exercises are they not?  If so they are there for you to learn, copy the code into your code window in University Edition, or whichever SAS product you use and run them to get the outputs.

Also, as noted before use a descriptive title line.

Super User
Posts: 10,250

Re: Various questions on SAS procedures

See Maxim 4.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Ask a Question
Discussion stats
  • 2 replies
  • 140 views
  • 2 likes
  • 3 in conversation