Generating report using DFSORT. How to get the previous month in the format MM/YYYY in the HEADER. I tried below code but its not working. HEADER1=(1:C'PREVIOUS MONTH',DATE2(/)-1)
If I have it correctly figured out, then no, we can not have DATE2 in HEADER1 (though an expert opinion would help here); you can use (DATE2-1) with OUTREC and write it conditionally; that should do as good a job as writing a HEADER1.
There is good documentation of HEADER1 which I suggest you locate and read.
You cannot invent your own syntax. Read what HEADER1 can do, and you'll know what you can do with HEADER1.
Now, what do you mean by "HEADER"? There is no "HEADER" function in DFSORT. Perhaps tell us what it is you are trying to do, rather than following the route you have chosen and refusing to turn back?
Hi BillyBoyo.. Thanks for your kind reply and suggestion. I meant HEADER1. I am not refusing to turn back rather I am in a situation where I have chosen DFSORT to build the report and I have already built the report and Now I got the requirement to add the previous month field like 04/2014 in my report header. As I already have HEADER1 statement in my SORT card so I thought of adding my new requirement field in the HEADER1.
I am not using HEADER2. I have not talked about 70 records..80 records...etc..anywhere else... My requirement is straight forward.. I need to add 2 fields in my report header Current month & previous month.. if you use &DATE - I will get current month (its in DD/MM/YYYY format but I need it in MM/YYYY format) Below is the sample of my report layout
I understand the difference between HEADER1 (Report Header ) HEADER2 (Page Header) But my issue is, I have needed the function in DFSORT which pulls system current month & previous month in the format MM/YYYY.