Nathan,

For SUM processing, 0 through 9 for the sign or A through F for a digit 
results in a data exception (0C7 ABEND). For example, a ZD value such as 
3.5 (X'F34BF5') results in an 0C7 because B is treated as an invalid 
digit. You can use ICETOOL's   DISPLAY or VERIFY operator can be used to 
identify ZD values with invalid digits. ICETOOL's VERIFY operator can be 
used to identify ZD values with invalid signs. 

//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG  DD SYSOUT=* 
//DFSMSG   DD SYSOUT=* 
//IN       DD DISP=SHR,DSN=Your Input file
//TOOLIN   DD * 
  VERIFY FROM(IN) ON(36,8,ZD) 
//* 

Look at the output in TOOLMSG which will list the invalid records.

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

The purpose of SUM is to have a single record with a total summed on the 
summing field. As you pointed out you have 3 records with spaces and when 
DFSORT tries to sum those space record it results in S0C7 abend. 

>>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?

Your job worked because when you have SORT FIELDS=COPY your SUM statement 
is IGNORED. If you look at the results it would be a simple copy of input 
to output as is. It did NOT perform the summing on the field at 36.

Here is an alternative way of handling those records with spaces. Use an 
INREC to covert the ZD field to actual ZD field and perform the sum on it. 


//SYSIN    DD * 
  INREC OVERLAY=(81:36,8,ZD,ZD,LENGTH=8) 
  SORT FIELDS=(1,35,A,44,37,A),FORMAT=CH 
  SUM FIELDS=(81,8,ZD) 
  OUTREC BUILD=(1,35,81,8,44,37) 
//* 

Further if you have any questions please let me know

Thanks
Kolusu
DFSORT Development
IBM Corporation



From:   "Pfister, Nathan" <[email protected]>
To:     [email protected]
Date:   06/09/2016 10:45 AM
Subject:        DFSORT Question
Sent by:        IBM Mainframe Discussion List <[email protected]>



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






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

Reply via email to