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

combine the records in the File Based on some key


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

New User


Joined: 12 Dec 2013
Posts: 5
Location: India

PostPosted: Thu Dec 12, 2013 9:51 am
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Dec 12, 2013 12:06 pm
Reply with quote

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
View user's profile Send private message
chethan.m99

New User


Joined: 12 Dec 2013
Posts: 5
Location: India

PostPosted: Thu Dec 12, 2013 12:32 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Dec 12, 2013 12:41 pm
Reply with quote

And which sort product are you using - this was also requested
Back to top
View user's profile Send private message
chethan.m99

New User


Joined: 12 Dec 2013
Posts: 5
Location: India

PostPosted: Thu Dec 12, 2013 12:43 pm
Reply with quote

I am using the DFSORT
... the Above code worked fine for Fixed byte records....
Back to top
View user's profile Send private message
chethan.m99

New User


Joined: 12 Dec 2013
Posts: 5
Location: India

PostPosted: Thu Dec 12, 2013 1:13 pm
Reply with quote

i wanted to know what parameted that i need to give for the Variable Block VB records..
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Dec 12, 2013 1:22 pm
Reply with quote

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
View user's profile Send private message
chethan.m99

New User


Joined: 12 Dec 2013
Posts: 5
Location: India

PostPosted: Thu Dec 12, 2013 2:59 pm
Reply with quote

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
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 0
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top