We have a sort on a file with LRECL 80 that is FB.

The sort statements are as follows:
SORT FIELDS=(1,35,A,44,37,A),FORMAT=CH
SUM  FIELDS=(36,8,ZD)

This failed last night for the first time with a S0C7, and the applications 
team asked me to look at it.  I started looking at it and, not being the most 
sort knowledgeable person, I don't understand why it failed or how it even ran 
in the first place.

The data looks like this:
P0095WCI0029909070003616WC 0004707000047000160609 11491100160000
P0095WCI8927171000004536WC 0162620000813100160605 99000100010751E
57500
P0087FAM8017732138500119APV0003590000035900160609 99000100010206I
P0087FAM8018524148500328APV0004630000023150160519 99000100010207C
P0087FAM8277753138500529APV0001315000013150160604 99000100010208E
57500

There are spaces (x'40') in the columns that are being summed (36,8).  This 
normally works.  Last night this failed, and the only difference was that those 
rows with blanks were identical numbers (which never happened before).


My questions are this:
My fundamental understanding of sort might be flawed here.  How does this work 
to begin with?  Shouldn't I be getting a S0C7 regardless of the value of the 
first 5 columns of the data?

Second, why would I get a S0C7 when these rows have the same value?

Third, if I run this as two separate steps first SORT 
FIELDS=(1,35,A,44,37,A),FORMAT=CH then SORT FIELDS=COPY with the SUM  
FIELDS=(36,8,ZD) statement, it works.  Why would it work this way and not as a 
combined sort?

Thanks in advance!;

Nathan Pfister
Systems Programmer
Donegal Insurance Group
[email protected]

E-MAIL CONFIDENTIALITY NOTICE: This e-mail from Donegal Insurance Group may 
contain CONFIDENTIAL and legally protected information. If you are not an 
intended recipient, please do not copy, use or disclose this email or its 
contents to others; and please notify us by calling toll free (800) 877-0600 
x7880 or by replying to this message, and then delete it from your system. 
Delivery of this email to an unintended recipient is not a waiver of any 
attorney-client or other applicable privilege.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to