Hi,
please help me do this
all dates are in date9. format
do I need an array???
/*HAVE*/
admit_dt Pdate1 date2 Pdate3 Pdate4 Pdate5
01OCT13 02oct13 09oct13 11oct13 15oct13 01OCT13
/*logic*/
Pdate1-admit_dt=PRday1
Pdate2-admit_dt=PRday2
Pdate3-admit_dt=PRday3
Pdate4-admit_dt=PRday4
Pdate5-admit_dt=PRday5
/*WANT*/
admit_dt Pdate1 Pdate2 Pdate3 Pdate4 Pdate5 PRday1 PRday2 PRday3 PRday4 PRday5
01OCT13 02oct13 09oct13 11oct13 15oct13 01OCT13 1 8 10 14 0
Thanks
The only possible mistake I see is that you have Admit_date1 rather than Admit_date in your example above.
Other than that it should work, if it doesn't you'll have to post the error or why it isn't.
robertrao wrote:
/*logic*/
Pdate1-admit_dt=PRday1
Pdate2-admit_dt=PRday2
Pdate3-admit_dt=PRday3
Pdate4-admit_dt=PRday4
Pdate5-admit_dt=PRday5
You don't need an array but it helps avoid the repetition of code.
What have you tried?
You can flip the above for starters:
PRDay1=Pdate1-admit_dt to get what you need without going into arrays.
thanks for the reply.
I wanted to write the way you mentioned.
But there are 65 Pdate's
so I was trying to see if there is any easier way???
Thanks
You've asked at least a dozen questions on arrays here. While I don't mind helping, you should try to do some of it on your own otherwise you'll always be dependent on the forum.
hmmm
it has always been a learning process for me.
this is what I tried
please correct me
thanks
data array;
set demog;
array prox{*} PROCDT1-PROCDT65;
array pr{*} PRDAY1-PRDAY65;
do i=1 to dim(prox);
pr{i}=prox{i}-ADMIT_DATE1;
end;
run;
The only possible mistake I see is that you have Admit_date1 rather than Admit_date in your example above.
Other than that it should work, if it doesn't you'll have to post the error or why it isn't.
thanks you so very much.
I get some results.
Thanks
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.