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
 

 

How to update a portion of text in a trailer record
Goto page Previous  1, 2
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Trinadh

New User


Joined: 05 Mar 2009
Posts: 18
Location: Pune

PostPosted: Mon Nov 14, 2016 7:13 pm    Post subject:
Reply with quote

Hi Bill,

I've given the sort control cards from position 2 only. I think this is a problem with my editor, as I'm coding it here directly instead of pasting the content.

The $ sign is showing at OVERLAY statement.

I'm sure that the error is causing due to the multiple OUTRECS coded in each OUTFIL.

When I removed the OUTREC in OUTFIL FILES =02 and 03, it is working fine.

But couldn't succeed ahead.
Back to top
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2253
Location: @my desk

PostPosted: Mon Nov 14, 2016 7:28 pm    Post subject:
Reply with quote

Quote:
When I removed the OUTREC in OUTFIL FILES =02 and 03, it is working fine
Are you sure, it is giving you the expected results? If it does not, then it IS NOT 'working fine'.

If you are ok to build a new trailer, and skip the original trailer, this might help, and maybe easier to understand. This is the alternative explained earlier in this thread.
Code:
//SYSIN    DD *                                       
 OMIT COND=(5,5,CH,EQ,C'TRAIL')                       
 SORT FIELDS=COPY                                     

 OUTFIL FILES=01,                                     
    INCLUDE=(1,3,CH,EQ,C'HDR',OR,25,3,CH,EQ,C'XXX'), 
 TRAILER1=('TR1 TRAIL',30:COUNT-1=(M11,LENGTH=4))     

 OUTFIL FILES=02,                                     
    INCLUDE=(1,3,CH,EQ,C'HDR',OR,25,3,CH,EQ,C'YYY'), 
 TRAILER1=('TR2 TRAIL',30:COUNT-1=(M11,LENGTH=4))     

 OUTFIL FILES=03,                                     
    INCLUDE=(1,3,CH,EQ,C'HDR',OR,25,3,CH,EQ,C'ZZZ'), 
 TRAILER1=('TR3 TRAIL',30:COUNT-1=(M11,LENGTH=4))     
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Mon Nov 14, 2016 10:16 pm    Post subject: Reply to: How to update a portion of text in a trailer record
Reply with quote

Although you can have multiple OUTFIL statements, you can only have one OUTREC.

Just define one OUTREC, which will change the trailer text, then all you OUTFILs will get data with the changed result.
Back to top
View user's profile Send private message
Trinadh

New User


Joined: 05 Mar 2009
Posts: 18
Location: Pune

PostPosted: Tue Nov 15, 2016 7:36 pm    Post subject:
Reply with quote

Thanks Arun, that way it worked successfully.

Bill,

I came across an example 3 in the below link of using multiple OUTREC, one for each OUTFIL.
Link: https://www.ibm.com/support/knowledgecenter/SSLTBW_1.13.0/com.ibm.zos.r13.icea100/ofendex.htm

Also I tried the below code and couldn't get the perfect count in the trailer record after the file split. Assume my input file has 90 records and each split may contain 30 records. The below sort is throwing (no it isn't - it is showing a) record count of 100 in the trailer record in all the three split files.



Code:
 SORT FIELDS=COPY                                     

 OUTFIL FILES=01,                                     
    INCLUDE=(1,3,CH,EQ,C'HDR',OR,25,3,CH,EQ,C'XXX'),
    IFTHEN=(WHEN=(5,5,CH,EQ,'TRAIL'),
        BUILD=(1:C'TR1',4,26,30,4,UFF,M11,LENGTH=4))
  OUTFIL FILES=02,                                     
    INCLUDE=(1,3,CH,EQ,C'HDR',OR,25,3,CH,EQ,C'YYY'),
    IFTHEN=(WHEN=(5,5,CH,EQ,'TRAIL'),
        BUILD=(1:C'TR2',4,26,30,4,UFF,M11,LENGTH=4))
 OUTFIL FILES=03,                                     
    INCLUDE=(1,3,CH,EQ,C'HDR',OR,25,3,CH,EQ,C'ZZZ'),
    IFTHEN=(WHEN=(5,5,CH,EQ,'TRAIL'),
        BUILD=(1:C'TR3',4,26,30,4,UFF,M11,LENGTH=4))

Thanks for your help.

RE CODE' D
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Tue Nov 15, 2016 7:53 pm    Post subject: Reply to: How to update a portion of text in a trailer record
Reply with quote

Well, no you didn't. OUTREC is a parameter on OUTFIL, is what you discovered in the example. This is entirely different from... OUTREC. Note the comma indicating a continuation. All that OUTREC on OUTFIL is, is BUILD.
Back to top
View user's profile Send private message
Trinadh

New User


Joined: 05 Mar 2009
Posts: 18
Location: Pune

PostPosted: Wed Nov 16, 2016 1:58 am    Post subject:
Reply with quote

Thanks for the clarification, Bill.
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
Goto page Previous  1, 2
Page 2 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm


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