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

DFSORT - TRAILER option


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

New User


Joined: 04 Jan 2009
Posts: 18
Location: Germany

PostPosted: Wed Jul 30, 2014 1:51 pm
Reply with quote

I have a requirement to include a header record after every 30 records in the output file. I have used the below JCL for this purpose

Code:
//STEP1    EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SORTIN    DD DSN=input ds,
//            DISP=SHR
//SORTOUT   DD DSN=output ds,
//            DISP=(NEW,CATLG,CATLG),
//            SPACE=(CYL,(100,50),RLSE),
//            DCB=(RECFM=FB,LRECL=540)
//SORTWK01  DD UNIT=SYSDA,
//            SPACE=(CYL,(30,30),RLSE)
//SORTWK02  DD UNIT=SYSDA,
//            SPACE=(CYL,(30,30),RLSE)
//*
//SYSIN    DD  *
      OPTION COPY -
      INREC IFTHEN=(WHEN=GROUP,RECORDS=30,PUSH=(541:ID=8))
      OUTFIL REMOVECC,BUILD=(1,540),
      SECTIONS=(541,8,TRAILER3=(C'.........................'))


Now the problem is that the header is around 400 characters long but within c'...' the maximum allowed is only 256 characters.

Kindly let me know whether we have any possibility to give multiple texts within the same trailer?

I also tried keeping the header in separate file and include that after every 30 records, but atleast my code is not successful and thats the reason i switched to this simple hardcoded method.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Jul 30, 2014 2:39 pm
Reply with quote

You don't need SORTWKnn for a COPY operation. You are tying up diskspace for the duration of the step for no purpose.

Why do you have the WHEN=GROUP? I can't see a purpose. Then you'd not need the BUILD.

What is the content of your "header"? Is it fixed throughout the file?
Back to top
View user's profile Send private message
Haresh

New User


Joined: 04 Jan 2009
Posts: 18
Location: Germany

PostPosted: Wed Jul 30, 2014 2:48 pm
Reply with quote

thanks for the hint on the SORTWKnn, i shall remove it.

I want to repeat the fixed header after every 30 records, thats the reason i have used group function with just record option.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Jul 30, 2014 3:37 pm
Reply with quote

OK, the most important question you missed.

Have a look at SEQNUM with RESTART. This will be more efficient than the WHEN=GROUP.

In the OUTFIL, don't use the reporting functions if you've come to a limit, but you can use the slash operator on BUILD, which will allow you to output two records from one input record.

If you can source from a file, you could set up a number of symbols/SYMANES in a separate small step.
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 Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts SCOPE PENDING option -check data DB2 2
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
Search our Forums:

Back to Top