Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: To break the page and to have Page nubmers in the report
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    Post subject:
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    Post subject:
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: 578
Location: USA

PostPosted: Wed Nov 23, 2011 8:01 pm    Post subject:
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    Post subject:
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: 578
Location: USA

PostPosted: Tue Nov 29, 2011 6:28 pm    Post subject:
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    Post subject:
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: 578
Location: USA

PostPosted: Tue Nov 29, 2011 9:23 pm    Post subject:
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 Moderator


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

PostPosted: Wed Nov 30, 2011 12:30 am    Post subject:
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: 578
Location: USA

PostPosted: Wed Nov 30, 2011 12:54 am    Post subject:
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 Moderator


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

PostPosted: Wed Nov 30, 2011 1:06 am    Post subject:
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: 578
Location: USA

PostPosted: Wed Nov 30, 2011 1:09 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Detailed Transaction History report f... Kyle Carroll CICS 5 Tue Oct 18, 2016 12:42 am
No new posts Easytrieve - Report writing - Only 1 ... Abhi Nature CA Products 2 Wed Sep 14, 2016 11:40 am
No new posts Daily report to be extracted from CA ... polymathtarun DFSORT/ICETOOL 5 Mon Jul 11, 2016 4:33 pm
No new posts Report view in Mobile devices Robert Sample All Other Mainframe Topics 0 Thu Jun 23, 2016 7:05 pm
No new posts COBOL Report view in Mobile devices balaji81_k COBOL Programming 4 Thu Jun 23, 2016 6:41 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us