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
 

 

combine the records in the File Based on some key

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: combine the records in the File Based on some key
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    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Thu Dec 12, 2013 12:41 pm    Post subject:
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    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Thu Dec 12, 2013 1:22 pm    Post subject:
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    Post subject:
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    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 Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 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 convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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