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 intermediate records maintain orginal sort order

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

New User


Joined: 21 Sep 2005
Posts: 2

PostPosted: Thu May 17, 2007 11:59 pm    Post subject: SORT intermediate records maintain orginal sort order
Reply with quote

Hi.

I need help on a DFSORT requirement. Please note that we are not
allowed to implement ICETOOL in production and hence the problem can be addressed only using DFSORT.

I need to sort certain types of records (trans code = -29 - this is a field on the file) on the another field CXL indicator in such a way that the original sort order of the file does not fet affected.

Example :

Input file

acc no trans code cxl ind

1234 48 0
1234 -29 1
1234 -29 0
1234 67 1
2321 48 0
2321 -29 1
2321 -29 0
2321 67 1


SORTED FILE
----------------

acc no trans code cxl ind

1234 48 0
1234 -29 0
1234 -29 1
1234 67 1
2321 48 0
2321 -29 0
2321 -29 1
2321 67 1
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: Sun May 27, 2007 11:46 pm    Post subject:
Reply with quote

It's not clear what the data looks like.

Does each key have only two -29 values or can there be more than two -29 values per key?

Are the -29 values for a key always consecutive?

Please show an example of the records in the input file with ALL of the possible variations and the expected output records.

What is the RECFM and LRECL of the input file?

What is the starting position, length and format of each of the three fields?
Back to top
View user's profile Send private message
pratikagarwal53

New User


Joined: 21 Sep 2005
Posts: 2

PostPosted: Sun Jun 03, 2007 1:49 am    Post subject: Re: SORT intermediate records maintain orginal sort order
Reply with quote

Hi Frank,

To answer your questions,

Each key can have more than ONE -29 values. The -29 values can come in any sequence. LRECL = 814, RECFM = VB.

The input file is already sorted on 5 fields.

Field Position Length Datatype SORT order
----- --------- -------- ---------- --------------
Account 143 8 CH Ascending
Sec 9 5 CH Ascending
NN code 27 2 BI Ascending
SRC code 151 1 CH Ascending
SEQ NO 160 2 BI Ascending

The file contains many other fields but they are not important with respect to the SORT sequence . I am trying to design a SORT card which will not disturb the above SORT sequence but for -29 type of transactions

The fields which are to be considered for SORT are :

Field Position Length Datatype
----- --------- -------- ----------
Tran No 71 3 BI
CXL IND 121 1 CH

The requirement is as follows :

For a key of Account / Security / NN Code / SRC Code we have to sort the input file in such a way that the -29 transactions are sorted based on the CXL indicator (Descending order) so that all the -29 CXL transactions (CXL IND = '1' OR '6') for the above key are placed before the first -29 non CXL transaction (CXL IND = 0). The original SORT order for other transactions should not be altered.

Input file
----------

Key Transaction No. CXL IND Quantity
---- ----------------- ---------- ---------

12345678 48 0 10
12345678 48 0 10
12345678 -29 0 20
12345678 48 0 10
12345678 -29 1 40
12345678 -29 0 30
12345678 48 0 10
12345678 -29 1 70
22222222 48 0 10
22222222 48 0 10
22222222 -29 0 20
22222222 -29 0 40
22222222 -29 1 30
22222222 -29 1 70


SORTED file
--------------

Key Transaction No. CXL IND Quantity
---- ----------------- ---------- ---------

12345678 48 0 10
12345678 48 0 10
12345678 -29 1 40
12345678 -29 1 70
12345678 -29 0 20
12345678 48 0 10
12345678 -29 0 30
12345678 48 0 10
22222222 48 0 10
22222222 48 0 10
22222222 -29 1 30
22222222 -29 1 70
22222222 -29 0 20
22222222 -29 0 40


Please note that the requirement has to be met using DFSORT. We are not allowed to implement ICETOOL in production. However, we can use more than one SORT to achieve this.

Any help you provide would be appreciated.

thanks,
Pratik.
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: Mon Jun 04, 2007 11:02 pm    Post subject:
Reply with quote

I still can't figure out what you want. For 12345678, you have four -29 input records in various places and they end up in different places for output, but I can't see the pattern for where they end up. Why is it that three of them end up after the second 48 record and the fourth one ends up after the fourth 48 record? What are the relations here? I can't see the pattern or "rules".

I really don't have time to try to figure out what you want. If you can't explain the "rules" of how you get from input to output more clearly, I can't help.
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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm


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