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.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.