|
View previous topic :: View next topic
|
| Author |
Message |
Selvaganesan Muthusamy
New User
Joined: 30 Sep 2011 Posts: 3 Location: United States
|
|
|
|
Hi,
I am using DFSORT outfil to create reports. The Build has restart option to reset the line count to 1 or any start value. Similarly,
Is the outfil SECTIONS has any option to reset page number to 1 when the control value is changed ? |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I don't understand what you're trying to do.
If you want PAGE 1 for every SECTION, then you can just use a constant of 1 rather than the PAGE operand. For example:
| Code: |
OUTFIL SECTIONS=(1,10,
HEADER3=('PAGE 1'))
|
If that's not what you want, then you need to do a better job of explaining what you do want with examples of input and expected output, RECFM and LRECL, etc. |
|
| Back to top |
|
 |
Selvaganesan Muthusamy
New User
Joined: 30 Sep 2011 Posts: 3 Location: United States
|
|
|
|
Hello Frank
Thank you for the response.
Name DEPT Age Page : 1
A AAA 30
A1 AAA 20
...
...
Name DEPT Age Page : 2
B AAA 35
B1 AAA 33
...
...
Name DEPT Age Page : 3
C AAA 40
...
...
Name DEPT Age Page : 1 <------------ Page number resets to 1 here
CC1 BBB 40
CC2 BBB 50
...
...
In the above report the page number resets to 1 when department changes. Is this possible using OUTFIL SECTIONS? That is we can apply page break when control value changes. My doubt whether we can reset the page number to beginning in sections. |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Selvaganesan Muthusamy,
You cannot restart the page number from 1 once again with dept change. However you can mimic that functionality with seqnum.
The default number of lines per page is 60. So if you want to have ascending page numbers for the same dept and reset to 1 when the dept changes , use the following DFSORT JCL
I assumed that your input is FB RECFM and LRECL=80 and the dept is in position 5 for 3 bytes
| Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=Your input FB 80 byte file,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC OVERLAY=(81:SEQNUM,8,ZD,RESTART=(5,3),START=59,
81:81,8,ZD,DIV,+59,M10,LENGTH=8)
OUTFIL REMOVECC,BUILD=(1,80),
SECTIONS=(5,3,81,8,HEADER3=('NAME DEPT AGE PAGE : ',81,8))
//* |
|
|
| Back to top |
|
 |
Selvaganesan Muthusamy
New User
Joined: 30 Sep 2011 Posts: 3 Location: United States
|
|
|
|
Skolusu,
Thanks so much! This is fine.
Selva |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|