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
 

 

Merge two files having two trailer records into one trailer

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

New User


Joined: 03 Feb 2015
Posts: 4
Location: INDIA

PostPosted: Wed Nov 25, 2015 9:18 pm    Post subject: Merge two files having two trailer records into one trailer
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

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Wed Nov 25, 2015 9:24 pm    Post subject:
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.
http://www.ibmmainframes.com/viewtopic.php?t=55129&start=15&postdays=0&postorder=asc&highlight=
http://www.ibmmainframes.com/about42096.html
Back to top
View user's profile Send private message
R.Manivannan

New User


Joined: 03 Feb 2015
Posts: 4
Location: INDIA

PostPosted: Wed Nov 25, 2015 9:47 pm    Post subject:
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: 4
Location: INDIA

PostPosted: Thu Nov 26, 2015 3:56 pm    Post subject: Merge two files having two trailer records into one trailer
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: 269
Location: Mumbai

PostPosted: Thu Nov 26, 2015 4:21 pm    Post subject: Reply to: Merge two files having two trailer records into one trailer
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    Post subject: Reply to: Merge two files having two trailer records into one trailer
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: 4
Location: INDIA

PostPosted: Thu Nov 26, 2015 6:15 pm    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Thu Nov 26, 2015 8:56 pm    Post subject:
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    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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
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 Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm


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