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
 

 

how to split records based on specific value using SORT

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

New User


Joined: 03 Dec 2007
Posts: 39
Location: United States

PostPosted: Wed Sep 28, 2016 3:20 am    Post subject: how to split records based on specific value using SORT
Reply with quote

Hi,

Can someone help me on this?

I have a record like below it should be split into two records it finds 'where'

i/p
Code:
update user-table set username='xyz' where username='abc'


o/p
Code:
update user-table set username='xyz'
where username='abc'


Code'd

Thanks
Venkat
Back to top
View user's profile Send private message

RahulG31

Active User


Joined: 20 Dec 2014
Posts: 331
Location: USA

PostPosted: Wed Sep 28, 2016 3:32 am    Post subject: Reply to: how to split records based on specific value using SORT
Reply with quote

Simplest thing to use would be the OUTFIL slash (/) operator.

.
Back to top
View user's profile Send private message
Kerry Ropar

New User


Joined: 14 Sep 2016
Posts: 25
Location: Australia

PostPosted: Wed Sep 28, 2016 8:25 am    Post subject:
Reply with quote

RahulG31 wrote:
Simplest thing to use would be the OUTFIL slash (/) operator


Well, this might be with the assumption that the user wants to split the record precisely at the same position for all records within data set. RahulG31 can correct me if my assumption is wrong with his response.

Venkata Ramayya wrote:
I have a record like below it should be split into two records it finds 'where'


Not sure if the text "where" will always be at static offset for each record, you can consider using PARSE.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Wed Sep 28, 2016 9:31 am    Post subject:
Reply with quote

Almost 9 years on the forum but you still need to learn the use of BB codes.
You could do a google search or forum search by yourself and think of your own ideas how this can be achieved instead of blindly posting here.
This is what I have found which is what you want.
http://www.ibmmainframeforum.com/dfsort-icetool-icegener/topic2777.html
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 331
Location: USA

PostPosted: Wed Sep 28, 2016 9:57 am    Post subject: Reply to: how to split records based on specific value using SORT
Reply with quote

That's true Kerry. The TS mentioned that he had 'a' record. Since he didn't mention that he had a number of those records, I assumed that there is only a single record. In that case, the position/length is fixed and it is easy to use only the OUTFIL slash (/) operator.

If the position is Not fixed then it can be made fixed by using PARSE (as you had mentioned) and then use OUTFIL slash (/).

.
Back to top
View user's profile Send private message
Venkata Ramayya

New User


Joined: 03 Dec 2007
Posts: 39
Location: United States

PostPosted: Wed Sep 28, 2016 8:18 pm    Post subject:
Reply with quote

Thanks guys it worked. Thanks again for your help.
Venkat
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Thu Sep 29, 2016 3:26 am    Post subject: Reply to: how to split records based on specific value using SORT
Reply with quote

Amazing. If the "where" is variably located, use PARSE to divide in two, then the BUILD with the PARSEd fields separated by the slash-operator on OUTFIL.

However, TS/OP is already happy...
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 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 How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm


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