Hi, while migrating a 4th gen language to DFsort, i need to calculate an end-date and begin-date, based on a date in a sequential infile.
If the month of that infile date is 1, then the begindate is yearminusone/01/01 (format is YYYY/MM/DD) and the end date is yearminusone/12/31. in the other case (MM ne 1), the begindate is the beginning of the year and the enddate is the last day of the previous month. (e.g. 2016/01/14 => begindate = 2015/01/01, enddate = 2015/12/31 - 2016/05/14 => begindate = 2016/01/01, enddate = 2016/04/30.
(Later i need to check if a date in another input file is between these dates).
I have tried a variety of calculations, but it looks too complicated right now. Can you suggest a (the best) way to do this.
Kind Regards, Gerd.
If numeric-data is in a fixed position, prefer ZD to UFF/SFF.
You don't need a LENGTH with an EDIT, since the mask determines the length. The other option is with TO= and LENGTH=, which I've shown just for an example. Chose one or the other.
No need to negate the condition. IFTHEN=(WHEN=(logicalexpression) is like an EVALUATE in COBOL, once a condition is true, IFTHEN processing stops, unless you specify HIT=NEXT (when you need it) for one or more IFTHENs. WHEN=NONE is like WHEN OTHER in a COBOL EVALUATE.
If you only have one option on INREC/OUTREC/OUTFIL, you don't need WHEN=INIT. You need WHEN=INIT if you have multiple distinct things to do to each record.
Many thanks for the valuable directions. I am trying (learning) to use DFSORT in the way it needs to be used. It's a fantastic product, and i am putting a lot of effort into it to make it a standard for replacing other program languages (in combination with cobol). So far, it works great.
btw. i am working as a self-employed consultant at a large bank on a migration project. Again, many thanks and keep up the good work ;)
Kind Regards, Gerd.