IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

To break the page and to have Page nubmers in the report


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ratnakumar

New User


Joined: 07 May 2009
Posts: 30
Location: Banglore

PostPosted: Wed Nov 23, 2011 2:45 pm
Reply with quote

Hello,

I get a report (consisting of 'n' records)from the upstream, and I need break the page and append the header with page number.

say below is my sample input:
Code:

FUND#  FUND NAME                                PRICE
AAA123 xxxxxxxxxx xxxxxxx CORE FUND             115544
BBB123 yyyyyyyyyy yyyyyyy VALUE FUND            222233         
AAB123 zzzzzzzzz zzzzzzzzzz GROWTH FUND         999999       
.
.
.
. there might be around 3K records


My sample output should look like
Code:

PROGRAM  : CUXXXXX                          ABCDEFGH INVESTMENTS SUPPORT SYSTEMS         PAGE : 1
REPORT ID: CUXXXXX01                            TRADE PRICE BY FUND                  RUN DATE : 10/31/11
                                                                                  SYSTEM DATE : 11/01/11
                                                                                         TIME : 10:10:35
REPORTING PERIOD : OCTOBER 2011

FUND#  FUND NAME                                PRICE
AAA123 xxxxxxxxxx xxxxxxx CORE FUND             115544
BBB123 yyyyyyyyyy yyyyyyy VALUE FUND            222233         
AAB123 zzzzzzzzz zzzzzzzzzz GROWTH FUND         999999       
.
.
.

Break the page at the end and have the header repeated with page nubmers.


report length 133
Fund# is 6 Char
Fund Name is 30 char
Price is 6 digit

Can anyone please let me know if we can do it with sort?

Thanks you




Thank you
Back to top
View user's profile Send private message
kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Wed Nov 23, 2011 3:13 pm
Reply with quote

Yes, you can break the report under various pages. Have you tried the HEADER option available, if not try it and post us what difficulty you face in achieving the output mentioned.
Back to top
View user's profile Send private message
ratnakumar

New User


Joined: 07 May 2009
Posts: 30
Location: Banglore

PostPosted: Wed Nov 23, 2011 3:35 pm
Reply with quote

Yes, I tried with the HEADER operand , and it gave me only single header at the beginning of the page..

here is my Header operand details in SORT :

Code:

HEADER1=(001:'PROGRAM  : CUXXXXX',                       
         047:'ABCDEFGH INVESTMENTS SUPPORT SYSTEMS',     
         114:'PAGE:',PAGE,/,                             
         001:'REPORT ID: CUXXXXX01',                       
         050:'TRADE PRICE BY FUND ',             
         110:'RUN DATE:',DATE,/,                         
         107:'SYSTEM DATE:',DATE,/,                     
         114:'TIME:',TIME,/)       


But am not sure how to break the page and have page numbers for each.

Please help me out..

Thank you
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Wed Nov 23, 2011 8:01 pm
Reply with quote

ratnakumar,

Use HEADER2 for your requirement.

There are 3 headers. Refer to OUTFIL CONTROL STATEMENTS.

HEADER1 :- Specifies the report header to be used for the reports produced for this OUTFIL group. The report header appears by itself as the first page of the report.

HEADER2 :- Specifies the page header to be used for the reports produced for this OUTFIL group. The page header appears at the top of each page of the report, except for the report header page (if any) and report trailer page (if any).

HEADER3 :- Specifies the section header to be used with the associated section break field for the reports produced for this OUTFIL group. The section header appears before the first data record of each section.

Thanks,
Back to top
View user's profile Send private message
ratnakumar

New User


Joined: 07 May 2009
Posts: 30
Location: Banglore

PostPosted: Tue Nov 29, 2011 2:49 pm
Reply with quote

Thank you sqlcode1, It worked for me...

but how can I get the previous month 'OCTOBER 2011 ' in the report ?
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Tue Nov 29, 2011 6:28 pm
Reply with quote

ratnakumar,
Where are you getting run date from? Input file? If yes, please provide format/position and length of the date? In your report, how is run date different from system date?

Based on your HEADER1 statement provided earlier, your output doesn't match the sort card you provided.

Also please confirm OCTOBER 2011 is derived from run date.

Thanks,
Back to top
View user's profile Send private message
ratnakumar

New User


Joined: 07 May 2009
Posts: 30
Location: Banglore

PostPosted: Tue Nov 29, 2011 6:45 pm
Reply with quote

sqlcode1,

My job runs every month 1st. which processess the data for entire last month.
(Hence Run date would be current month and Reporting date would be the last month)

I get a date file, from the previous step, and it looks as shown below:

Code:

---+----1----+-
***************
OCTOBER   2011
***************


And I just need to update the field "REPORTING PERIOD :" with the date provided in the date file

Thank you..
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Tue Nov 29, 2011 9:23 pm
Reply with quote

ratnakumar,
See if below works....since you haven't really given input file's LRECL, I am going to assume it will be atleast less than or equal to 133. If its not you need, please post sample input and positions for the FUND#,FUND NAME and FUND PRICE.

Code:
//STEP0001 EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD YOUR DATE FILE FROM PREV. STEP                                                       
//DATEFL   DD DSN=&&DT,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)     
//SYSIN    DD *                                                       
  OPTION COPY                                                         
  OUTFIL FNAMES=DATEFL,REMOVECC,NODETAIL,       
     BUILD=(80X),                     
     TRAILER1=('DT,C''',01,15,C'''')               
/*                                                                   
//STEP0002 EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SYMNAMES DD DSN=&&DT,DISP=(OLD,PASS)                               
//SORTIN   DD YOUR INPUT FILE WITH APPROX. 3K RECORDS                                                       
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD *                                                       
  OPTION COPY                                                         
  OUTFIL HEADER2=(001:'PROGRAM  : CUXXXXX',                           
                  047:'ABCDEFGH INVESTMENTS SUPPORT SYSTEMS',         
                  114:'PAGE:',PAGE,/,                                 
                  001:'REPORT ID: CUXXXXX01',                         
                  050:'TRADE PRICE BY FUND ',                         
                  110:'RUN DATE:',DATE,/,                             
                  107:'SYSTEM DATE:',DATE,/,                         
                  114:'TIME:',TIME,/,                                 
                  001:'REPORTING PERIOD : ',DT,/)                     
/*

Thanks,
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Nov 30, 2011 12:30 am
Reply with quote

sqlcode1,

A couple of changes were needed to your job:

I added BUILD=(80X) to STEP0001 - you need that unless the input file has LRECL=80. I changed HEADER1 to HEADER2 since the OP asked for page headers.

Personally, I would use INREC BUILD rather than OUTFIL TRAILER1 to build the symbol:

Code:

//STEP0001 EXEC PGM=SORT                                           
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD DSN=...  date record (FB)                           
//SORTOUT  DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)   
//SYSIN    DD *                                                     
  OPTION COPY                                                       
  INREC BUILD=(C'DT,''',1,15,C'''',80:X)                           
/*           
//STEP0002 EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)                           
//SORTIN   DD DSN=...  input file                         
//SORTOUT  DD SYSOUT=*                                           
//SYSIN    DD *                                                   
  OPTION COPY                                                     
  OUTFIL HEADER2=(001:'PROGRAM  : CUXXXXX',                       
                  047:'ABCDEFGH INVESTMENTS SUPPORT SYSTEMS',     
                  114:'PAGE:',PAGE,/,                             
                  001:'REPORT ID: CUXXXXX01',                     
                  050:'TRADE PRICE BY FUND ',                     
                  110:'RUN DATE:',DATE,/,                         
                  107:'SYSTEM DATE:',DATE,/,                     
                  114:'TIME:',TIME,/,                             
                  001:'REPORTING PERIOD : ',DT,/)                 
/*                                                                                                       
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Wed Nov 30, 2011 12:54 am
Reply with quote

Frank,
Thanks for the correction on HEADER2, I copied OP's card but forgot to change HEADER1 to 2.

Quote:
Personally, I would use INREC BUILD rather than OUTFIL TRAILER1 to build the symbol:


However, I have seen solution using INREC BUILD and OUTFIL to build symnames and I kind of want to take this opportunity to ask you which is better?

I was leaning towards OUTFIL so that if a date file (or any file used to build symname) is empty, it atleast puts spaces. On the other hand, using INREC BUILD to create SYMNAME results in abend in next step if a file to create symname is empty.

Is this just a personal preference or a good coding practice or something related to efficiency(because of the different DFSort phases for INREC and OUTFIL)?

Thanks,
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Nov 30, 2011 1:06 am
Reply with quote

If we know we have only one record to create the symbol from and that record is always there (which seemed to be the case here), I would use INREC because it's simpler - just BUILD vs OUTFIL for which you'd need REMOVECC,NODETAIL,BUILD and TRAILER1. Just a personal preference.

If you're trying to build a symbol from an empty data set, it isn't going to work either way.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Wed Nov 30, 2011 1:09 am
Reply with quote

Frank,
Thanks for the explanation.

Thanks,
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need help on formatting a report DFSORT/ICETOOL 14
No new posts Creating Report using SORT DFSORT/ICETOOL 7
No new posts Abend S0C4 11 (Page Translation Excep... PL/I & Assembler 16
No new posts Ca7 long running jobs report All Other Mainframe Topics 1
No new posts Report of batch jobs JCL & VSAM 1
Search our Forums:

Back to Top