Consider the Document detail file, which represents a series of Document Chapters. This file is the result of a DB2 unload of a table that has a foreign key to the Document table.
FB, LRECL = 175, logical record key (document number) a packed digit in position 1, 6 bytes long (s9(11) in cobol).
Also, there exists a second logical key (chapter code) at position 21, 18 characters long.
This file may contain several records with the same document number but only one record per (document number,chapter code) pair. Also, no document number exists in this file that does not exist in file 1.
Example, not accurate in terms of positions and LRECL:
What I need to do is sort the Document Detail file so that the records are:
a) first, sorted by Document Number in the same order than the Document file and,
b)second, sort all records with the same document number ascending by Chapter code[/list]
Can anyone help me do this? I have been trying some things but I get a strange order (not present in any of the input files) :roll:
As far as I can see I do not have the JOINKEYS operator available.
If you need more info to help me, let me know.
EDIT: Just to clear this up - I do not need any of the information present in the Document file.What I need is to sort the Document Detail file according to the order of the Document Number in the Document file AND the Chapter Code of each record in the Document Detail File.
Considering the examples above, the output should be
Joined: 06 Jan 2010 Posts: 9 Location: Lisbon, Portugal
Yes the Document number is an S9(11) COMP-3 field on both files, but your code does not provide what I need.
I need to sort the records by Document Number in the same order that the document number appears in the Document file, not descending like in your solution. I.e., I need the Document file to provide the first level sorting of the Document Detail records...
Using LookAt, I found the following explanation for the D37 ABEND in IEC031I:
A data set opened for output used all the primary space, and no secondary space was requested. Change the JCL specifying a larger primary quantity or add a secondary quantity to the space parameter on the DD statement.
What do your DD statements for the temporary files look like? Are you specifying a secondary quantity? Do you have that kind of space available on your system? I'd try something like
That would only work if the D37 ABEND was for one of DFSORT's dynamically allocated data sets. It would not help if the D37 ABEND is for one of the temporary data sets (T1 or T2). Of course, the OP didn't really say which data set got the D37 (well, why bother to actually supply pertinent information when you can have everyone guess instead).
Hmmm ... you should have gotten a JES message that indicated which data set the D37 was associated with. An IECxxxI message of some kind (not an ICExxxI message). If you still have the JES log from the job that got the D37, you might want to take another look for future reference. The JES messages have important information for some types of abends.