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
 

 

DFSORT - TRAILER option

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: DFSORT - TRAILER option
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Wed Jul 30, 2014 2:39 pm    Post subject: Reply to: DFSORT - TRAILER option
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Wed Jul 30, 2014 3:37 pm    Post subject: Reply to: DFSORT - TRAILER option
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    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 How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts BWO option in VSAM blayek CICS 3 Sat Nov 05, 2016 10:47 am
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm


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