12-18-2014 08:52 AM
It depends on what system you are using on the mainframe.
From your example, it looks like you have CYYMMDD as the format where C=century. If C=1 then it is 2000 + year and if there is no
leading 1 then it is 1900 + year.
We usually take a SAS date in format CCYYMMDD and subtract 19000000 from that value to give us a date in this format. In our case
we are actually going from mainframe to the server so the formula is the other way around.
12-18-2014 10:25 AM
what I am trying to do is take the sas date and convert it to the mainframe format to use in a high level filter of a mainframe file. Right now we read in all the records, reformat the mf date to a sas date the delete the records that are not the correct date. I would be much more efficient to strip out the unneeded records at the read in, I just need to know how to format the sas date to the mf format so I can do that. Thanks,
12-18-2014 11:16 AM
There is probably a much easier way, but the following should work:
informat date date9.;
format date mmddyy10.;
format date 8.;
12-18-2014 03:11 PM
12-18-2014 12:17 PM
If you just want the number and for it not to be a SAS date the easiest way should be
date1 = today();
adate = put(date1,yymmddn8.)-19000000;
12-18-2014 02:01 PM
At the moment of reading the mainframe data you can decide to skip those records not storing those in a sas-dataset.
Why are you storing/saving them would be my first question. It is am unnecessary complicating approach to adjust before or after that.