I need to process the data in input file which is prior to current day to output file.
My requirements are:
If the day is "MON", I need to process the data from friday to saturday.
If the day is other than "MON",I need to process the data prior to the current day.
The input file has the below fields having the LRECL of 30
Now I need to process the previous day data by comparing with the entry date. If it is "MON" and current date is 06-6-2011, then records which have the entry date 06-3-2011, 06-4-2011 and 06-5-2011 are to be processed.
If it is not equal "MON" and current date is 06-7-2011,then records which have the entry date 06-6-2011 are to be processed.
Input file should get filtered with the above conditions and written to output file having an LRECL of 30.
Joined: 06 Jun 2008 Posts: 8280 Location: Dubuque, Iowa, USA
Please suggest how to resolve this.
First, you need to repost your JCL using the Code button to preserve the exact spacing of your JCL. Since you did not do so, it appears that your SORT control statements start in column 1, which is not allowed. Hence, based on what you've posted it does not appear your syntax for the SORT control statements is correct.
Also, you need to post a few lines of SORT output so we can know which SORT product you are using.
Please provide sample input and expected output.
The INREC definition doesn't match with original layout you had provided. In the sort card, you are using 26 byte timestamp but in the original post you mentioned its a 10 byte date field (Entry date).
If I understand your requirement correctly, all you want to do is process friday thru monday records if the day of the week is monday and if it any other day you want to process the prior day records. If that is the case then you can use the following DFSORT JCL which will give you the desired results.
If you want to compare 26 byte timestamp field then you need to use DATE5 keyword instead of DATE4