Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 7314

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: 7314

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 Compare and COPY using DFSORT pshongal DFSORT/ICETOOL 3 Fri Nov 17, 2017 9:49 am
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm
No new posts Updating multiple counts in trailer!! Vignesh Sid SYNCSORT 4 Mon Nov 06, 2017 1:04 pm
No new posts Where is output from PARM ABEXIT (SNA... packerm CA Products 3 Thu Sep 28, 2017 4:06 pm
No new posts MQ command in option 6 of ISPF! Vignesh Sid All Other Mainframe Topics 3 Tue Sep 26, 2017 6:01 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us