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

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: 2426
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: 6
Location: Canada

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: 6
Location: Canada

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: 272
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: 6
Location: Canada

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: 2426
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 PKZIP - extracting multiple txt files drarem All Other Mainframe Topics 3 Tue Jul 07, 2020 8:47 pm
No new posts Problem while trying to manipulate re... amitc23 DFSORT/ICETOOL 3 Tue Jun 30, 2020 1:19 pm
No new posts Want to check if trailer count is 0 a... rohanthengal JCL & VSAM 10 Fri Jun 26, 2020 10:47 am
No new posts Need to select all records belonging ... Q5P418 DB2 2 Mon Jun 22, 2020 11:34 pm
No new posts How to filter out certain records bas... manugeorge2004 JCL & VSAM 5 Wed Jun 17, 2020 10:05 pm

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