View previous topic :: View next topic
Author
Message
R.Manivannan New User Joined: 03 Feb 2015Posts: 6 Location: Canada
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
Rohit Umarjikar Global Moderator Joined: 21 Sep 2010Posts: 3051 Location: NYC,USA
Back to top
R.Manivannan New User Joined: 03 Feb 2015Posts: 6 Location: Canada
Thanks Mr.Rohit
Back to top
R.Manivannan New User Joined: 03 Feb 2015Posts: 6 Location: Canada
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
chandan.inst Active User Joined: 03 Nov 2005Posts: 275 Location: Mumbai
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
boyti ko New User Joined: 03 Nov 2014Posts: 78 Location: Malaysia
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
R.Manivannan New User Joined: 03 Feb 2015Posts: 6 Location: Canada
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)
Back to top
Rohit Umarjikar Global Moderator Joined: 21 Sep 2010Posts: 3051 Location: NYC,USA
Good to know, hence little search could save time.
Back to top
Please enable JavaScript!