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
 

 

Rearrange records without effecting other records

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

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Wed Nov 29, 2006 8:22 am    Post subject: Rearrange records without effecting other records
Reply with quote

Hi,

I have a flat file with the following layout -

(1) Policy# (12 bytes)
(2) Date (ddmmyy format)
(3) Remaining data (given as ????)

In the file, we have set of records with the same policy# but with different set of dates like......

IP file Example-

1234567890abc 120506 ???????
1234567890abc 140506 ???????
5678123456xyz 140506 ???????
1234567890abc 130506 ???????


My requirement is to re-arrange the records as per the date but without sorting on any of the field. i.e, other records place shouldn't change.

OP file should be -

1234567890abc 120506 ???????
1234567890abc 130506 ??????? --- this was 4 record in ip file
5678123456xyz 140506 ???????
1234567890abc 140506 ??????? --- this was record #2 in ip file


Is it possible to acheive this using DFSORT? If yes, please provide the code.

Thanks & Regards,
Mohan
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Wed Nov 29, 2006 9:39 am    Post subject:
Reply with quote

Hi Mohan,

If i/p file like

IP file Example-

1234567890abc 120506 ???????
1234567890abd 140506 ???????
5678123456xyz 140506 ???????
1234567890abc 130506 ???????
Then tell me what should be the output
Back to top
View user's profile Send private message
jeetpratap

New User


Joined: 21 Jul 2006
Posts: 5

PostPosted: Wed Nov 29, 2006 11:21 am    Post subject:
Reply with quote

Hi

IP file Example-

1234567890abc 120506 ???????
1234567890abc 140506 ???????
5678123456xyz 140506 ???????
1234567890abc 130506 ???????


My requirement is to re-arrange the records as per the date but without sorting on any of the field. i.e, other records place shouldn't change.

OP file should be -

1234567890abc 120506 ???????
1234567890abc 130506 ??????? --- this was 4 record in ip file
5678123456xyz 140506 ???????
1234567890abc 140506 ??????? --- this was record #2 in ip file

as per the example quoted by you, you are not even sorting the records on Dates. otherwise, the output should have been

1234567890abc 120506 ???????
1234567890abc 130506 ???????
1234567890abc 140506 ???????
5678123456xyz 140506 ???????

But in your example, WHY IS 2ND RECORD PLACED AT 4TH POSTION?

PLEASE CLARIFY1

REGARDS
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Wed Nov 29, 2006 3:03 pm    Post subject:
Reply with quote

The date represents transaction date for that policy and the records which has the same date (say 12th) has to come along with other 12th transacted policies.

Because of some reason, few policies are getting stored in random order like 12th followed by 14th and 13th.

My requirement is to rearrange all those policies which have random date order with out effeting the other records/policies.

I hope Im clear to all.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Wed Nov 29, 2006 8:27 pm    Post subject: Re: Rearrange records without effecting other records
Reply with quote

Also I would like to provide more info which may be helpful for you people -

Total # of records - Around 1.4 M (7 flat files each having 0.2M records)

And we identified 17 policies which has the above problem (stored in random date order).

Regards,
Mohan
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed Nov 29, 2006 9:47 pm    Post subject:
Reply with quote

Just sort on the date but use the equals parameter so when the sort key is equal sort will keep the original sequence intact.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Nov 29, 2006 10:09 pm    Post subject:
Reply with quote

William is correct. You want to SORT by the date but use the EQUALS parameter to ensure that records with the same date are kept in their original order. You can use these DFSORT control statements:

Code:

   OPTION EQUALS
   SORT FIELDS=(...)


Note that a ddmmyy date should really be sorted as yymmdd.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Thu Nov 30, 2006 8:28 am    Post subject:
Reply with quote

Thanks Williams and Frank for your quick response.

Regards,
Mohan
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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 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 abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


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