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

How to update a portion of text in a trailer record


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

New User


Joined: 05 Mar 2009
Posts: 20
Location: Pune

PostPosted: Mon Nov 14, 2016 7:13 pm
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: 2481
Location: @my desk

PostPosted: Mon Nov 14, 2016 7:28 pm
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

Moderator Emeritus


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

PostPosted: Mon Nov 14, 2016 10:16 pm
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: 20
Location: Pune

PostPosted: Tue Nov 15, 2016 7:36 pm
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: 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

Moderator Emeritus


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

PostPosted: Tue Nov 15, 2016 7:53 pm
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: 20
Location: Pune

PostPosted: Wed Nov 16, 2016 1:58 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top