On the attached file is a assessment that I have to complete but i'm having trouble with questions part 1a and 1b. I'm not to sure how I can approach this problem so I was hoping so one can lead me in the right direction. As of now I have the data imported:
/*printing out import*/
proc print data = uchi (obs = 10);
run;
proc sort data = uchi;
by person_id;
run;
proc print data = uchi (obs = 100);
run;
/*creating numeric dates*/
data case;
set uchi;
informat arrest_date yymmdd10. dispos_date yymmdd10.;
if arrest_date < dispos_date then re_arrest = 1;
run;
proc print data = case (obs = 10);
format arrest_date yymmdd10.;
run;
Looks like you're trying to calculate a moving cumulative total. Do you have SAS ETS? If so, try PROC EXPAND. If not, if you search moving statistics you'll find a ton of examples on here or online on how to calculate moving statistics in SAS.
I don't know that uploading your actual assignment is the best idea though....
@ogarduno wrote:
On the attached file is a assessment that I have to complete but i'm having trouble with questions part 1a and 1b. I'm not to sure how I can approach this problem so I was hoping so one can lead me in the right direction. As of now I have the data imported:
/*printing out import*/
proc print data = uchi (obs = 10);
run;
proc sort data = uchi;
by person_id;
run;proc print data = uchi (obs = 100);
run;
/*creating numeric dates*/
data case;
set uchi;
informat arrest_date yymmdd10. dispos_date yymmdd10.;
if arrest_date < dispos_date then re_arrest = 1;
run;
proc print data = case (obs = 10);
format arrest_date yymmdd10.;
run;
"questions part 1a and 1b" are what exactly? If there was an attempt to attach something it apparently did not get attached.
If the questions are plain text no need to "attach" anything. Open a code box using the {I} menu icon, copy the text from your document and paste into the box.
@ballardw He attached his full assignment which I suggested he remove, it had personal information.
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.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.