MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem in display header and trailer

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
mfuser
Banned


Joined: 01 Mar 2005
Posts: 105
Topics: 58

PostPosted: Wed Jan 04, 2006 7:49 am    Post subject: Problem in display header and trailer Reply with quote

Hai All,

I am basically trying to generate a report with SORT where in i shoud be having headers one after the other in different lines in the report in the format and at the end of the report a trailer display.

Code:

PAGE    :          1
DATE    : 01/04/2006
TIME    :   10:10:10


So in my SORT Card i am giving

Code:

//SYSIN    DD *                                 
  SORT FIELDS=(2,4,A,5,4,A,10,4,A),FORMAT=CH     
  OUTREC FIELDS=(2,4,5,4,10,4)                   
  OUTFIL HEADER1=(41:C'PAGE    :          1',2/),
         HEADER2=(41:C'DATE: 01/04/2006',2/,
                  41:C'TIME:   10:10:10'),                 
         TRAILER1=(41:C'FINISH')


I am getting the following error as below.Can anybody help me out how do i achieve my desired result.Morever how do i take care of the page numbers increasing when the pages exceed more than one ?

Code:

ICE201I 0 RECORD TYPE IS F - DATA STARTS IN POSITION 1                   
ICE230A 0 67 BYTE HEADER/TRAILER RECORD EXCEEDS 10 BYTE LRECL FOR SORTOUT

Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Jan 04, 2006 8:09 am    Post subject: Reply with quote

Mfuser,

The messages are self explanatory. your OUTREC fields are only creating a file of 10 bytes length, but you are specifying the date and page fields to start at pos 41 which is NOT possible.

So you need to change your OUTREC FIELDS to accomadate the additional fields. So change your sort card to the following. Btw you don't have to hardcode the date/time/page in your sort card. you can use the system defined variables &date/&time/&page for current date/time and page numbers respectively.

Code:

//SYSIN    DD *                             
  SORT FIELDS=(2,4,A,5,4,A,10,4,A),FORMAT=CH
  OUTREC FIELDS=(2,4,5,4,10,4,80:X)         
  OUTFIL HEADER1=(41:C'PAGE: ',&PAGE,2/),   
         HEADER2=(41:C'DATE: ',&DATE,2/,     
                  41:C'TIME: ',&TIME),       
         TRAILER1=(41:C'FINISH')             
/*                                           


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Wed Jan 04, 2006 11:48 am    Post subject: Reply with quote

mfuser,

The error message you show does NOT correspond to the control statements you show. When I run your control statements, I get:

ICE230A 0 61 BYTE HEADER/TRAILER RECORD EXCEEDS 13 BYTE LRECL FOR SORTOUT

Do you have LRECL=10 for SORTOUT? If so, remove it.

But Kolusu is right that you need to use n:X in OUTREC to make the output data records longer than the Header/Trailer records.

Another thing I noticed is that you're using:

Code:

  OUTFIL HEADER1=(41:C'PAGE    :          1',2/),
          HEADER2=(41:C'DATE: 01/04/2006',2/,
                   41:C'TIME:   10:10:10'),       


HEADER1 is the report header and will give you a page with those lines. HEADER2 is the page header and will give you those lines at the top of every page starting with the second page (after the header1 page). Is that what you want or did you really want the PAGE literal as part of HEADER2?
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mfuser
Banned


Joined: 01 Mar 2005
Posts: 105
Topics: 58

PostPosted: Wed Jan 04, 2006 2:22 pm    Post subject: Reply with quote

Thanks Kolusu,

I have understood the steps from your answers and my concepts are clear and i am able to write Control statements.I have few queries:

1)If i would like to take care of page numbers incremental ,how do i do that ,can we make use of line counter if it exceeds 50 lines, the page should be incremented to 2.
2)the date format is mm/dd/yy ,if i want the format to be mm/dd/20yy how can it be achieved
3)if i want to insert a blank line after the headers how can it be achieved

Code:

                                                    PAGE    :          1
                                                    DATE    :   01/04/06
                                                    TIME    :   10:10:10
                                                                       
                      SUMMARY REPORT     


4)Similary for a blank line before FINISH.

Code:
                                                                       
                                                                       
                      FINISH                                             

Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Jan 04, 2006 3:00 pm    Post subject: Reply with quote

mfuser,

Quote:

1)If i would like to take care of page numbers incremental ,how do i do that ,can we make use of line counter if it exceeds 50 lines, the page should be incremented to 2.


You need to use HEADER2 if you want the header on every page. For controlling the no: of line per page on the report you can use the LINES parameter. you can use the PAGE parm for auto increment of the page number. remember to count the header lines also as a part of the total lines/page.

Quote:

2)the date format is mm/dd/yy ,if i want the format to be mm/dd/20yy how can it be achieved


Simple you can use the DATE parm and specify the pattern i.e

ex:
Code:
41:C'DATE: ',DATE=(MD4/)


this will print the date at 41 pos in the MM/DD/CCYY format.

Quote:

3)if i want to insert a blank line after the headers how can it be achieved


If you want blank lines to appear in headers and trailers, you can use n/.

where n is the no: of lines you want.

Ex: if you want three blank lines then you can specify 3/

run this sample job and take a look at the sortout after completion
Code:

//STEP0100 EXEC PGM=SORT                       
//SYSOUT   DD SYSOUT=*                         
//SORTIN   DD *                                 
REC01                                           
REC02                                           
REC03                                           
REC04                                           
REC05                                           
REC06                                           
REC07                                           
REC08                                           
REC09                                           
REC10                                           
REC11                                           
//SORTOUT  DD SYSOUT=*                         
//SYSIN    DD *                                 
  SORT FIELDS=COPY                             
  OUTFIL LINES=7,                               
  HEADER2=(41:C'PAGE: ',PAGE,/,                 
           41:C'DATE: ',DATE=(MD4/),/,         
           41:C'TIME: ',TIME,2/,               
           25:C'SUMMARY REPORT'),               
 TRAILER1=(2/,41:C'FINISH')                     
/*


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mfuser
Banned


Joined: 01 Mar 2005
Posts: 105
Topics: 58

PostPosted: Wed Jan 04, 2006 3:59 pm    Post subject: Reply with quote

Kolusu,

Thanks for the help for which u have provided for the solution to my queries.I had come across some more:

OUTPUT:

Code:

---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8-
********************************* TOP OF DATA **********************************
                                        PAGE:      1                           
                                        DATE: 01/05/2006                       
                                        TIME: 01:49:03                         
                        SUMMARY REPORT                                         
REC01                                                                           
REC02                                                                           
                                        PAGE:      2                           
                                        DATE: 01/05/2006                       
                                        TIME: 01:49:03                         
                        SUMMARY REPORT                                         
REC03                                                                           
REC04                                                                           
                                        PAGE:      3                           
                                        DATE: 01/05/2006                       
                                        TIME: 01:49:03                         
                        SUMMARY REPORT                                         
REC05                                                                           
REC06                                                                           
                                        PAGE:      4                           
                                        DATE: 01/05/2006                       
                                        TIME: 01:49:03                         
                        SUMMARY REPORT                                         
REC07                                                                           
REC08                                                                           
                                        PAGE:      5                           
                                        DATE: 01/05/2006                       
                                        TIME: 01:49:03                         
                        SUMMARY REPORT                                         
REC09                                                                           
REC10                                                                           
                                        PAGE:      6                           
                                        DATE: 01/05/2006                       
                                        TIME: 01:49:03                         
                        SUMMARY REPORT                                         
REC11                                                                           
                                                                               
                                        FINISH   


1.Why is the output SYOUT which has generated is 82 columns in spool actually i had kept the input data in a input dataset of 80 LRECL.
2.In the code

Code:

SORT FIELDS=COPY                   
OUTFIL LINES=7,                     
HEADER2=(41:C'PAGE: ',PAGE,/,       
         41:C'DATE: ',DATE=(MD4/),/,
         41:C'TIME: ',TIME,2/,     
         25:C'SUMMARY REPORT'),     
TRAILER1=(2/,41:C'FINISH')



My assumption is that

a)1 line for Page,1 line for Date,1 line for Time and after that u are using 41:C'TIME: ',TIME,2/, which means u should leave two lines after TIME which is being not done .
b)Is n/ is used to have blank lines after printing the desired line.
c)Moreover with the OUTFIL LINES=7 means after completing six lines increment the page counter and write the headers.
d)And before writing 'FINISH' u are using TRAILER1=(2/,41:C'FINISH') u are expecting 2 lines to be blank before 'FINISH' which is not happening.
5)Why is that we are mentioing 41 st column to start with ,but it is starting from 42 column is it because of Carriage control character and can it be removed.
[/color]
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Jan 05, 2006 8:50 am    Post subject: Reply with quote

Quote:

a)1 line for Page,1 line for Date,1 line for Time and after that u are using 41:C'TIME: ',TIME,2/, which means u should leave two lines after TIME which is being not done .
b)Is n/ is used to have blank lines after printing the desired line.


Here is a detailed explanation straight from the DFSORT manual.

Code:

.../ or n/

Blank records or a new record. A new output record is to be started with or without intervening blank output records. If /.../ or n/ is specified at the beginning or end of OUTREC, n blank output records are to be produced. If /.../ or n/ is specified in the middle of OUTREC, n-1 blank output records are to be produced (thus, / or 1/ indicates a new output record with no intervening blank output records).
At least one input field or separation field must be specified if you use /.../ or n/. For example, OUTREC=(//) is not allowed, whereas OUTREC=(//X) is allowed.

Either n/ (for example, 5/) or multiple /'s (for example, /////) can be used. n can range from 1 to 255. If n is omitted, 1 is used.

As an example, if you specify:




                   OUTFIL OUTREC=(2/,C'Field 2 contains ',4,3,/,
                                     C'Field 1 contains ',1,3)


an input record containing:



                   111222


would produce the following four output records:



                   Blanks
                   Blanks
                   Field 2 contains 222
                   Field 1 contains 111


Note that four OUTFIL output records are produced for each OUTFIL input record.



Quote:


c)Moreover with the OUTFIL LINES=7 means after completing six lines increment the page counter and write the headers.


What makes you think that ? Lines=7 means to write 7 lines/page counting the headers also.

Quote:

d)And before writing 'FINISH' u are using TRAILER1=(2/,41:C'FINISH') u are expecting 2 lines to be blank before 'FINISH' which is not happening.


Refer to the first answer above.

Quote:

5)Why is that we are mentioing 41 st column to start with ,but it is starting from 42 column is it because of Carriage control character and can it be removed.


Yes it is because of the carriage control character since you are using reporting features(header,trailer....). you can remove the carriage control using the parm REMOVECC

6. I am creating a seperate topic for this as it is totally different question.


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group