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
 

 

Sort to merge multiple rows to single row

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
purushottam

New User


Joined: 26 Feb 2007
Posts: 34
Location: pune

PostPosted: Thu May 23, 2013 4:48 pm    Post subject: Sort to merge multiple rows to single row
Reply with quote

Hi,

I have an input file with LRECL 38 and the contents as below:

Input:
0101491706051105OTE0000000000000000100
0101491706051105OTE0000000000000000200
0101491706051105OTE0001020000000000300
0101491706051105OTE0000000000000000400

Key is from position (1,13)
It is a Fixed Block file. I need the output as displayed below. I tried to used the SPLICE for the same but since my input can have variable number of key occurances (from 1-20)

Output:
0101491706051105OTE00000000000000001000101491706051105OTE00000000000000002000101491706051105OTE00010200000000003000101491706051105OTE0000000000000000400
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1539
Location: Andromeda Galaxy

PostPosted: Thu May 23, 2013 5:31 pm    Post subject:
Reply with quote

So you need the data in LRECL of 152 for every four records?

Which version of DFSORT are you using?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Thu May 23, 2013 6:27 pm    Post subject: Reply to: Sort to merge multiple rows to single row
Reply with quote

And is the output to be fixed-length, or variable?
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu May 23, 2013 10:53 pm    Post subject:
Reply with quote

purushottam,

Look up SPLICE with INREC IFTHEN and code it for your max occurrence which in your case is 20.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1539
Location: Andromeda Galaxy

PostPosted: Fri May 24, 2013 12:33 am    Post subject:
Reply with quote

Kolusu,

Why RESIZE is not a better option this case?
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri May 24, 2013 3:02 am    Post subject:
Reply with quote

Pandora-Box wrote:
Kolusu,

Why RESIZE is not a better option this case?



You need to read the requirement once again.

purushottam wrote:
Key is from position (1,13)
It is a Fixed Block file. I need the output as displayed below. I tried to used the SPLICE for the same but since my input can have variable number of key occurances (from 1-20)


OP has a multiple keys in his file and for each key can be variable with max of 20 records per key.

ex:
Code:

----+----1----+----2----+----
KEY01        DATA RECORD-01 
KEY01        DATA RECORD-02 
KEY01        DATA RECORD-03 
KEY01        DATA RECORD-04 
KEY01        DATA RECORD-05 
                             
KEY02        DATA RECORD-AA 
KEY02        DATA RECORD-BB 
                             
KEY03        DATA RECORD-CC 
KEY03        DATA RECORD-DD 
KEY03        DATA RECORD-EE 


OP wants to club 5 records of KEY01 as a single record, 2 records of Key02 as a single record and 3 records of Key03 as a single record. RESIZE works with fixed number of records for each key. So you need to use splice
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1539
Location: Andromeda Galaxy

PostPosted: Fri May 24, 2013 7:41 pm    Post subject:
Reply with quote

Thanks for the insight Kolusu icon_smile.gif
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 Changing sort Card Dynamically vickey_dw DFSORT/ICETOOL 2 Sat Aug 19, 2017 2:33 pm
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 10 Fri Aug 18, 2017 10:50 am
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts Changeman get multiple "Browse C... elixir1986 Compuware & Other Tools 4 Fri Jul 14, 2017 1:48 am


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