Previous month in header



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Previous month in header

Postby shankar_dh » Tue May 13, 2014 4:02 pm

Hi,

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)
shankar_dh
 
Posts: 41
Joined: Fri Mar 22, 2013 1:00 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Previous month in header

 

Re: Previous month in header

Postby Aki88 » Tue May 13, 2014 4:23 pm

Hello,

Have a look at this page; this might help you; it has a DFSORT solution shared by Kolusu:

http://ibmmainframes.com/about58606.html
Aki88
 
Posts: 371
Joined: Tue Jan 28, 2014 1:52 pm
Has thanked: 33 times
Been thanked: 35 times

Re: Previous month in header

Postby shankar_dh » Tue May 13, 2014 6:10 pm

Thanks Aki88 for your reply..Given link has 2 steps..
Can't we directly use DATE2(/)-1 in the HEADER?
Can anybody explain ?
shankar_dh
 
Posts: 41
Joined: Fri Mar 22, 2013 1:00 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Previous month in header

Postby Aki88 » Tue May 13, 2014 7:24 pm

Hello,

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.
Aki88
 
Posts: 371
Joined: Tue Jan 28, 2014 1:52 pm
Has thanked: 33 times
Been thanked: 35 times

Re: Previous month in header

Postby BillyBoyo » Tue May 13, 2014 8:43 pm

shankar_dh

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?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Previous month in header

Postby shankar_dh » Wed May 14, 2014 11:40 am

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.
shankar_dh
 
Posts: 41
Joined: Fri Mar 22, 2013 1:00 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Previous month in header

Postby BillyBoyo » Wed May 14, 2014 11:48 am

OK, let's be a bit more explicit. Is your report working when there are 70 records? Are you using HEADER2?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Previous month in header

Postby shankar_dh » Wed May 14, 2014 4:18 pm

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

***REPORT XYZ ****
CURRENT MONTH : 05/2014 PREVIOUS MONTH : 04/2014
shankar_dh
 
Posts: 41
Joined: Fri Mar 22, 2013 1:00 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Previous month in header

Postby BillyBoyo » Wed May 14, 2014 4:25 pm

Use HEADER2.

Until you can show that you understand the difference between HEADER1 and HEADER2, that's my last on this topic.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Previous month in header

Postby shankar_dh » Wed May 14, 2014 8:08 pm

Hi,

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.
shankar_dh
 
Posts: 41
Joined: Fri Mar 22, 2013 1:00 pm
Has thanked: 1 time
Been thanked: 0 time

Next

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post