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

Merge two files having two trailer records into one trailer


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

New User


Joined: 03 Feb 2015
Posts: 6
Location: Canada

PostPosted: Wed Nov 25, 2015 9:18 pm
Reply with quote

I am having two input files (LRECL = 583)
I need to Merge two files having two trailer records into one trailer record and the counts need to be accumulated in the output file.

Input File 1:
D....
D....
T20151125000000000100000000020000000003

Input File 2:
D....
D....
T20151125000000000100000000020000000003

Expected Output File:
D....
D....
D....
D....
T20151125000000000200000000040000000006


Trailer Format:
Positions(Data)
1(T)
2 to 9(Date)
10 to 19(Count-1)
20 to 29(Count-2)
30 to 39(Count-3)
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Wed Nov 25, 2015 9:24 pm
Reply with quote

If you could done some search by yourself than just posting it blindly then you could have got this link and some modifications to that now will give you desired results.
www.ibmmainframes.com/viewtopic.php?t=55129&start=15&postdays=0&postorder=asc&highlight=
www.ibmmainframes.com/about42096.html
Back to top
View user's profile Send private message
R.Manivannan

New User


Joined: 03 Feb 2015
Posts: 6
Location: Canada

PostPosted: Wed Nov 25, 2015 9:47 pm
Reply with quote

Thanks Mr.Rohit
Back to top
View user's profile Send private message
R.Manivannan

New User


Joined: 03 Feb 2015
Posts: 6
Location: Canada

PostPosted: Thu Nov 26, 2015 3:56 pm
Reply with quote

Hi,

Can anyone please help me on the below one....

I've tried but couldn't be able to obtain the desired output.

I am having two input files (LRECL = 583)
I need to Merge two files having two trailer records into one trailer record and the counts need to be accumulated in the output file.

Input File 1:
D....
D....
T20151125000000000100000000020000000003

Input File 2:
D....
D....
T20151125000000000100000000020000000003

Expected Output File:
D....
D....
D....
D....
T20151125000000000200000000040000000006


Trailer Format:
Positions(Data)
1(T)
2 to 9(Date)
10 to 19(Count-1)
20 to 29(Count-2)
30 to 39(Count-3)
Back to top
View user's profile Send private message
chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 275
Location: Mumbai

PostPosted: Thu Nov 26, 2015 4:21 pm
Reply with quote

Can you share the SORT JCL you have used?

Also did you refer the links provided by Rohit? those should work

Thanks and regards,
Chandan
Back to top
View user's profile Send private message
boyti ko

New User


Joined: 03 Nov 2014
Posts: 78
Location: Malaysia

PostPosted: Thu Nov 26, 2015 5:04 pm
Reply with quote

This one will produce the trailer only.

Code:
  OPTION COPY                                       
  OUTFIL REMOVECC,NODETAIL,INCLUDE=(1,1,CH,EQ,C'T'),
      TRAILER1=(1,9,TOT=(10,10,ZD,M11,LENGTH=10),   
                    TOT=(20,10,ZD,M11,LENGTH=10),   
                    TOT=(30,10,ZD,M11,LENGTH=10))   
Back to top
View user's profile Send private message
R.Manivannan

New User


Joined: 03 Feb 2015
Posts: 6
Location: Canada

PostPosted: Thu Nov 26, 2015 6:15 pm
Reply with quote

It Works fine with the following....

Code:
 SORT FIELDS=COPY

 INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'T'),PUSH=(584:ID=1)),
       IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'T',AND,584,1,ZD,EQ,1),
       PUSH=(585:10,60))

 OUTREC IFTHEN=(WHEN=(1,1,CH,EQ,C'T'),
        OVERLAY=(10:10,10,ZD,ADD,585,10,ZD,ZDF,LENGTH=10,
                 20:20,10,ZD,ADD,595,10,ZD,ZDF,LENGTH=10,
                 30:30,10,ZD,ADD,605,10,ZD,ZDF,LENGTH=10,
                 40:40,10,ZD,ADD,615,10,ZD,ZDF,LENGTH=10,
                 50:50,10,ZD,ADD,625,10,ZD,ZDF,LENGTH=10,
                 60:60,10,ZD,ADD,635,10,ZD,ZDF,LENGTH=10))

OUTFIL BUILD=(1,583),
OMIT=(1,1,CH,EQ,C'T',AND,584,1,ZD,EQ,1)

icon_biggrin.gif
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Thu Nov 26, 2015 8:56 pm
Reply with quote

Good to know, hence little search could save time.
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 Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
Search our Forums:

Back to Top