1) I have been receiving SOC7 abend while adding up the ZD field values. It contains both +ve and -ve signs in it. I aslo tried to strip off the sign and then add. It was successful but additional without sign would be incorrect. The SUM has to be done based on REC 35,11,CH from IN file.
2) I also have the requirement to reverse the sign of the resulting field, as in MUL by -1. I have tried varius sort cards but the actual result seems to either vary or error out. Pls advice
Input field eg:
size-17
contents:
-+----6----+----7
+0000000000002816
+0000000000005156
+0000000000003084
+0000000000003741
+0000000000001131
-0000000000001058
-0000000000003263
-0000000000002409
-0000000000003315
-0000000000003803
Defined as ZD in my sort card:
How can i SUM up the fields to receive a REVERSED sign value which actually corresponds to the input. Questions welcome.pls advice
Regards,Saurabh
P.S--> the abend
SYSTEM COMPLETION CODE=0C7 REASON CODE=00000000
TIME=15.49.32 SEQ=53355 CPU=0000 ASID=00DB
PSW AT TIME OF ERROR 078D2000 8000BE1C ILC 6 INTC 07 [/code]
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
You can't use ZD format for +ve and -ve values. You can use FS format, but you can't use FS format in SUM. So you need to convert the values from FS format to ZD format and then SUM on the ZD values. You can use a DFSORT job like the following to do what you asked for. I assumed your input file has RECFM=FB and LRECL=1100, but you can change the job appropriately for other attributes.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
I've seen +ve and -ve used quite often. I suspect it's a notation from some particular language or convention, but I don't know for sure. Probably just a shorthand way of indicating what the values look like. Since the orginal post had examples of what the values look like, it seemed sufficient to me.
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
I agree that it was probably sufficient to know what the original poster meant, but what really irritates me is the amount of "chat speak" and site-specific abbreviations I see here. Information Technology usually requires very precise terminology and the use of these abbreviations oftentimes results in a lot of people wasting time doing a lot of guessing as to what the "real" question actually was.
Thanks for the previous solution.
I have additional reqmnt changes proposed, in addition to the icetool card above. I have to use JCL cards only for this process and not cobol source.
I am listing them below:
1. Read the DATE from date control IN1 file: at (70,8,CH)
Code:
********************************* Top of Data **********************************
HRINSIGHT 03102009
******************************** Bottom of Data
2.Compare the DATE(above) with DA1(from below file), arrange records accordingly, sort with Account code(pos 35,11,CH) SUM them up sequentially:
IN2 file format:
I need to also convert the amount ZD values to 15 bytes with 2 decimal places for which I used EDIT=(STTTTTTTTTTT.TT),thats fine. The earlier card which u had adviced was:
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Saurabh516,
Quote:
3. There can be instances where D2 can vary by +/- 5 days wrt to control DATE, so the no of records to be arranged and summed up can be dynamic.
what is D2?
Is your intention to sum up only records which are matching with the date from date control file?
Does the date control file have current date or can it be any date?
Sort products do not have the ability of performing date arithmetic. So if you want to sum records within a range then you need a program for that. But if it is based off an offset from the current date then it can be done easily within sort itself