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

To display total Page in report trailer using SYNCSORT


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Anil George

New User


Joined: 13 Feb 2008
Posts: 7
Location: India

PostPosted: Thu Feb 14, 2008 12:48 pm
Reply with quote

Hi all...
i need to print the total of pages in the trailer.PAGE is displayed in all pages ,now i need to display in the trailer the Total number of pages.
pls suggest ...
thanks in advance
icon_smile.gif
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Feb 14, 2008 3:17 pm
Reply with quote

Have you looked at the &PAGE parameter in the TRAILER?
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Thu Feb 14, 2008 3:51 pm
Reply with quote

Are you putting the page number in every page?
How many lines make one page?
Back to top
View user's profile Send private message
Anil George

New User


Joined: 13 Feb 2008
Posts: 7
Location: India

PostPosted: Thu Feb 14, 2008 5:09 pm
Reply with quote

Hi,
To William:wen &PAGE is given it is displaying the subsequent page number.I need the same total page ie, the last page number shuould be displayed.

TO Krisprems: ya page number is shown in all pages.
der are 24 lines in one page.

Thanks and regards,
Anil
Back to top
View user's profile Send private message
Anil George

New User


Joined: 13 Feb 2008
Posts: 7
Location: India

PostPosted: Thu Feb 14, 2008 7:59 pm
Reply with quote

I have given &PAGE=(LENGTH=6) to display the page number in all the pages. However the requirement is to add the total number of pages in the report trailer for which I have used TRAILER1 parameter. But the issue is that when I give &PAGE in the trailer its displaying the next value of the last page. Ie if the last page is 13 in the trailer it should display as “Total number of pages is 223” but the display is coming as 224 which is wrong. Is there any way I can decrement the value.
Sample Input

Quote:

101198777 03/05/08 PXXXXX 1100.00 S 121042882

101198777 03/05/08 PXXXXX 1100.00 S 121042882

101198777 03/05/08 PXXXXX 1100.00 S 121042882



Sample output
Quote:

1011987 03/05/08 P1878 03/05/08 P1878 03/05/08 P1878

1011987 03/05/08 P1878 03/05/08 P1878 03/05/08 P1878

TOTAL NO OF MISMATCHES: 10020 224


code
Quote:

SORT FIELDS=(1,9,CH,A)

OUTFIL FILES=OUT,

LINES=50,

HEADER2=('DATE:',&DATE=(DM4/),12X,'XXXXXXXXXXXXXXXXXXXXXXXX',13X,

1/1:'REPORT ID:',17X,' XXXXXXXXXXXXXXXXXXXXXXXX,

2/1:'ACCOUNT NO',2X,'XXXX FILE',10X,'XXXX FILE',10X,

'XXXXXXX,10X,'REASON',24X,'PAGE:',

&PAGE=(FS,LENGTH=3),/),

OUTREC=(1:1,9,13:13,16,31:13,16,49:13,16,68X),

TRAILER1=(5:'TOTAL NO OF MISMATCHES:',X,COUNT,5X,&PAGE=(FS,LENGTH=3))
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Thu Feb 14, 2008 8:13 pm
Reply with quote

This sample SORT JCL is for an i/p or o/p file of LRECL=50,RECFM=FB
Code:
//*******************************************************
//STEP1    EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD *                                         
QWE                                                     
QWE                                                     
QWE                                                     
QWE                                                     
QWE                                                     
QWE                                                     
QWE                                                     
QWE                                                     
QWE                                                     
QWE                                                     
QWE                                                     
QWE                                                     
QWE                                                     
QWE
QWE
QWE
QWE
QWE
QWE
QWE
QWE
QWE
QWE
QWE
QWE
QWE
QWE
QWE
QWE
QWE
QWE
QWE
QWE
QWE
QWE
QWE
QWE
QWE
QWE
QWE
QWE
QWE
QWE
QWE
QWE
QWE
QWE
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD *                                                       
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(60:SEQNUM,8,ZD,                   
        68:(60,8,ZD,MOD,+2),ADD,(60,8,ZD,MOD,+23),EDIT=(TT),         
                 70:(60,8,ZD,DIV,+23),EDIT=(TTT))),                   
  IFTHEN=(WHEN=(68,2,ZD,NE,+0),OVERLAY=(70:70,3,ZD,ADD,+1,EDIT=(TTT)))
  SORT FIELDS=COPY                                                   
 OUTFIL LINES=24,TRAILER2=(C'PAGE#',&PAGE),                           
 TRAILER1=('TOT# PAGES',70,3),                                       
 BUILD=(1,50)                                                         
/*                                                                   

Try this and modify as per your requirement.
Any prob persists..just revert!!
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
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 Insert trailer for non empty file only DFSORT/ICETOOL 6
Search our Forums:

Back to Top