Hi All, trying to find possible solution to my issue. Any assistance would be appreciated.
I have check_dt that is in format mmyy7. (JAN2009,DEC2008, NOV2008 etc) . However, there is also possibility of having check_dt=SEP9999 (month9999 year).
If that is the case, if check_dt has year(check_dt)=9999 then I want to have new_check_dt=n/a, otherwise new_check_dt=check_dt.
That changes from date format to character if done in data step. So, I thought I could do something like this
%let lowdate = '31DEC2008'd;
%let highdate = '01JAN2009'd;
value nadate low-&lowdate = [monyy7.]
&highdate-high = ' N/A';
Then....in proc tabulate steps...are something like this
table check_dt='Check Date'*f=nadate.
But formatting my check_dt to above proc format...is not doing anything to my output! Can anyone help? Thanks.
One last question. Currently I have, proc sort by descending CHECK_Dt & then proc tabulate steps. My output has following pattern from top to bottom for the check_dt: n/a, Jan2009, Dec2008,Nov2008 & so on down to back 3 years. Is there a way to have my n/a rows to be moved to the bottom of this column, but KEEP my true dates in descending order? So it would be: Jan2009, Dec2008,Nov2008 .....n/a
I would change year = 9999 to missing then use MISSING DESCENDING on class statement.
input id:$2. date:monyy.;
if year(date) eq 9999 then date = .;
format date monyy.;
value nadate . = 'N/A' other = [monyy7.];
class date / missing descending;
format date nadate.;