View previous topic :: View next topic
|
Author |
Message |
chethan.m99
New User
Joined: 12 Dec 2013 Posts: 5 Location: India
|
|
|
|
Hi,
I have a requirement to combine the records Based on some key
For Example:
Input file:
Code: |
@CHETHAN 01
+123400
+569800
@RAMESH 56
+678899
+978090
+539309
+589889
@DAVID 34
+256709
+678990 |
Output file
Code: |
CHETHAN 01 123400
CHETHAN 01 569800
RAMESH 56 678899
RAMESH 56 978090
RAMESH 56 539309
RAMESH 56 589889
DAVID 34 256709
DAVID 34 678990
|
Wanted to achieve this result using any Mainframe Utility.
Can you please help me in getting the solution?
Code'd |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Chetan, Welcome...
There are lot of things you did not specify to provide you correct rather exact solution.
Like what is LRECL,RECFM of input and output files.
Also Sort product you are using etc..
Code: |
//STEP0002 EXEC PGM=SORT
//SORTIN DD *
@CHETHAN 01
+123400
+569800
@RAMESH 56
+678899
+978090
+539309
+589889
@DAVID 34
+256709
+678990
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'@'),
PUSH=(21:2,13))
OUTFIL OMIT=(1,1,CH,EQ,C'@'),
BUILD=(21,13,2,6,1X)
/*
|
Above code assumes your input file is of LRECL 20 RECFM FB and expected output file is of LRECL 20 and RECFM FB
Also it assumes you want to bring in 13 bytes from position 2 from header
Output of this would be
Code: |
CHETHAN 01 123400
CHETHAN 01 569800
RAMESH 56 678899
RAMESH 56 978090
RAMESH 56 539309
RAMESH 56 589889
DAVID 34 256709
DAVID 34 678990
|
|
|
Back to top |
|
|
chethan.m99
New User
Joined: 12 Dec 2013 Posts: 5 Location: India
|
|
|
|
Sorry for not specifying the details....
The Input file is of Record Length = 3984 & Formate is VB
The Output file is of Record Length = 80 & Format is FB |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
And which sort product are you using - this was also requested |
|
Back to top |
|
|
chethan.m99
New User
Joined: 12 Dec 2013 Posts: 5 Location: India
|
|
|
|
I am using the DFSORT
... the Above code worked fine for Fixed byte records.... |
|
Back to top |
|
|
chethan.m99
New User
Joined: 12 Dec 2013 Posts: 5 Location: India
|
|
|
|
i wanted to know what parameted that i need to give for the Variable Block VB records.. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
chethan.m99
1) OK you are using DFSORT, but in a lot of cases we want you to post the line of output below
Code: |
ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1 |
which shows us the release level that you have installed as this may affect the solutions given.
2) The use of VB records against FB records has been discussed many many times in this forum - did you search
3) Please learn to use the code tags
Code: |
[code] ..... your code here .... [/code] |
|
|
Back to top |
|
|
chethan.m99
New User
Joined: 12 Dec 2013 Posts: 5 Location: India
|
|
|
|
I got he resolution for the issue of VB to FB ... the job is working fine.. thanks for all your help & support |
|
Back to top |
|
|
|