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

Rearrange records without effecting other records


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

Senior Member


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

PostPosted: Wed Nov 29, 2006 8:22 am
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: 1208
Location: Bangalore,India

PostPosted: Wed Nov 29, 2006 9:39 am
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
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: 1436
Location: Bangalore,India

PostPosted: Wed Nov 29, 2006 3:03 pm
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: 1436
Location: Bangalore,India

PostPosted: Wed Nov 29, 2006 8:27 pm
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: 3156
Location: Tucson AZ

PostPosted: Wed Nov 29, 2006 9:47 pm
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 Developer


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

PostPosted: Wed Nov 29, 2006 10:09 pm
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: 1436
Location: Bangalore,India

PostPosted: Thu Nov 30, 2006 8:28 am
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 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 Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
Search our Forums:

Back to Top