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

SORT intermediate records maintain orginal sort order


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Sun May 27, 2007 11:46 pm
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
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 Developer


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

PostPosted: Mon Jun 04, 2007 11:02 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
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 JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top