Joined: 27 Jan 2010 Posts: 17 Location: Louisville, Ky
Hi,
I need a second pair of eyes on an issue I'm having. My shop has a batch job that does the following:
- The batch job de-allocates a VSAM file from the CICS region.
- It sorts 12 flat files created by several other jobs into a single flat file which is then repro'd to the above VSAM file.
- After the repro, the job re-allocates the VSAM back to CICS where it is available to users to browse only. No updates, adds, or deletes. This VSAM file is used to populate a report screen in our application.
Here's the problem:
The batch job abends with IDC33141 on the repro step. Here's what I've done so far:
I've read VSAM de-mystified, and didn't see anything that would help me out.
I've identified the last good record repro'd from the flat file to the VSAM. I've also identified the first out of sequence record from the flat file as well.
The first record is the last good record written to the VSAM. The second record is the out of sequence record. I've provided CHAR and HEX values.
Code:
File-AID - Browse - TEST.XXXX.XXXXXXX --------------------- LINE 5158 COL 1 80
COMMAND ===> SCROLL ===> CSR
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
LS 0460CUSGNEFL LOC - GNEFL 0 INBNDS FOR WEEK- 0 LATE L
LS 0460CUSD330
----+----1----+----2----+--
LS 0460CUSGNEFL
DE42129001FFFFCEECDCCD00134
320021C00C04603427556300EA0
---------------------------
LS 0460CUSD330
DE42129001FFFFCEECFFF400134
320021C00C04603424330000E50
---------------------------
The sort card that sorts the 26 byte key is as follows:
Code:
SORT FIELDS=(1,3,CH,A,4,4,PD,A,8,3,PD,A,11,2,CH,A,
13,2,CH,A,15,3,CH,A,18,5,PD,A,23,4,BI,A)
OMIT COND=(1,2,CH,NE,C'LS')
END
The job has ran like this forever and just abended with the out of sequence error. My suspisions are that the sort is not sorting the 26 byte key correctly, thus giving me the error.
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
since vsam sorts the key as 26 binary
why don't you sort the file(s) as 26 binary?
i did not even bother to check out your sort card,
but if there is an out of sequence problem
it is because all those sub-fields within the key
are not correctly coded for position and length.
as i said, stop that silliness and sort for the whole 26 at one shot.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
18,5,PD,A
Are you sure it ran for ever? No changes? Which sort product do you use?
By the way, why is the OMIT coded after the SORT. Logically, the OMIT happens first. It doesn't matter where you put it, but it'll confuse someone some time.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
From the DFSORT manual, when describing PD:
Quote:
1. The following are treated as positive sign indicators: F, E, C, A, 8, 6, 4, 2, 0.
2. The following are treated as negative sign indicators: D, B, 9, 7, 5, 3, 1.
So, the first record you showed had a "negative" value, whilst the second was "positive". "negative" is less than "positive", so sorted first.
Code:
SORT FIELDS=(1,26,CH,A)
CH sorts on all the bits as well, so is same as BI here.
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
I did not think the TS deserved our efforts to show him why,
especially after all that extensive research he performed and
still came-up with that idiot sort.
Joined: 27 Jan 2010 Posts: 17 Location: Louisville, Ky
Code:
18,5,PD,A
Bill,
You are correct. I made the change to the sort control and re-ran the repro step. I compared the two datasets (the production version that gets created daily) and the version that I created in development by NDM'ing the 12 flat files from production. The compare identified the "out of sequence" record show above.
Joined: 27 Jan 2010 Posts: 17 Location: Louisville, Ky
Dick,
I did not come up with the sort, it was already coded. Secondly, this forum is used to help developers with legitimate questions. Was my question not legit enough for you? As far as my extensive research is concerned, I guess you've never been under the gun with a production problem? I guess not, since you seem to have all the answers. I came here looking for help, and for those that gave it, I am truly grateful. If you want to call me (or my sort statement) and idiot, well that's on you. From now on, if you see a post from me, don't feel obligated to post, as I am not worthy of your time, sorry to bother you.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Crunch wrote:
Dick,
I did not come up with the sort, it was already coded. Secondly, this forum is used to help developers with legitimate questions. Was my question not legit enough for you? As far as my extensive research is concerned, I guess you've never been under the gun with a production problem? I guess not, since you seem to have all the answers. I came here looking for help, and for those that gave it, I am truly grateful. If you want to call me (or my sort statement) and idiot, well that's on you. From now on, if you see a post from me, don't feel obligated to post, as I am not worthy of your time, sorry to bother you.
/rant off
It took dbz a maximum of 22 minutes to spot the problem. And you don't want his help next time?
Next time, please use the Preview button to check your post is OK before pressing Submit, including checking any links that you have included (click on them from the preview). Without all the editing and checking done for you, you might have had a quicker answer.
Yes, that sort card deserves what it got. Come the day you specify individual items for a key to a VSAM fille, then sort on the individual items. If passing a group-item, sort on the group item. Simple.
Two things you've avoided. Why didn't it fail before? Does the field usually exclusively end in L or another "odd" number? Or does it usually contain a four-digit numeric with a trailing space?
Did you notice yet that you picked the wrong record as being out-of-sequence. The first record shown is out-iof-sequence, not the second.
Oh, and the OMIT.
And why sort to flat tile then REPRO. Why not sort to the KSDS? A timing thing?
EDIT: And why blame sort, which sorts billions of records daily. Why would you think it suddenly misbehaved with you? That gun thing, I guess.