IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SOC7 abend while SUMming up ZD fields usinf ICETOOL


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
saurabh516

New User


Joined: 27 Nov 2006
Posts: 8
Location: Bangalore

PostPosted: Fri Sep 18, 2009 10:19 pm
Reply with quote

Hi Forum Members/Moderators,

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:

//SYMNAMES DD *
*DETAIL
AMOUNT,154,17,ZD

/CPY1CNTL DD *
SORT FIELDS=(RECKEY,A)
OPTION ZDPRINT
SUM FIELDS=(AMOUNT)
OUTREC BUILD=(1,153,
AMOUNT,MUL,-1,
C'DATA FIELD',4X,
186,894)
AMOUNT,154,17,ZD

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]
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Sep 18, 2009 10:39 pm
Reply with quote

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.

Code:

//S1    EXEC  PGM=ICETOOL
//SYMNAMES DD *
*DETAIL
AMOUNT,154,17,FS
ZDAMT,1101,16,ZD
RECKEY,...           ?????
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...  input file (FB/1100)
//OUT DD DSN=...  output file (FB/1078)
//TOOLIN   DD    *
SORT FROM(IN) TO(OUT) USING(CPY1)
/*
//CPY1CNTL DD *
 INREC OVERLAY=(ZDAMT:AMOUNT,TO=ZD,LENGTH=16)
 SORT FIELDS=(RECKEY,A)
 OPTION ZDPRINT
 SUM FIELDS=(ZDAMT)
 OUTREC BUILD=(1,153,
               ZDAMT,MUL,-1,EDIT=(STTTTTTTTTTTTTTTT),SIGNS=(+,-),
               C'DATA FIELD',4X,
               186,894)
/*
Back to top
View user's profile Send private message
saurabh516

New User


Joined: 27 Nov 2006
Posts: 8
Location: Bangalore

PostPosted: Fri Sep 18, 2009 11:02 pm
Reply with quote

Hi Frank,
Thanks for the above solution. I modified the CPY1 card and submited the same but received the error:

Code:

ICE282I 0 PERFORMING SYMBOL SUBSTITUTION AS NEEDED         
           INREC OVERLAY=(ZDAMT:AMOUNT,TO=ZD,LENGTH=16)   
                          £                               
ICE283A 0 SYMBOL, SYNTAX OR DELIMITER ERROR               
           SUM FIELDS=(ZDAMT)                             
                       £                                   
ICE283A 0 SYMBOL, SYNTAX OR DELIMITER ERROR               


Pls advice.

Regards,Saurabh
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Sep 18, 2009 11:22 pm
Reply with quote

You need to make the changes to SYMNAMES I show in my job:

Code:

//SYMNAMES DD *
*DETAIL
AMOUNT,154,17,FS
ZDAMT,1101,16,ZD


The £ under ZDAMT indicates that symbol was not found in SYMNAMES.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Sun Sep 20, 2009 8:02 pm
Reply with quote

Hi Frank,

I'm curious to know, here
Quote:
ZD format for +ze and -ze values
by +ze and -ze, did you mean positive and negative ZD values?
Back to top
View user's profile Send private message
saurabh516

New User


Joined: 27 Nov 2006
Posts: 8
Location: Bangalore

PostPosted: Mon Sep 21, 2009 2:03 pm
Reply with quote

Hey Frank, Thanks for the solution above. I received the desired result. Thanks,Saurabh
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Sep 21, 2009 9:26 pm
Reply with quote

Quote:
I'm curious to know, here Quote:
ZD format for +ze and -ze values
by +ze and -ze, did you mean positive and negative ZD values?


That was a typo. I meant +ve and -ve as in the OP's first post meaning +n...n and -n...n values which are, of course, not valid ZD values.

I've corrected +ze and -ze to +ve and -ve in my post. Thanks for pointing this out.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Mon Sep 21, 2009 9:53 pm
Reply with quote

saurabh516 wrote:
...It contains both +ve and -ve signs in it.

[rant on]Would it have been that much more inconvenient to spell out positive and negative?
[/rant off]
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Sep 21, 2009 10:16 pm
Reply with quote

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.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Mon Sep 21, 2009 10:32 pm
Reply with quote

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.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Sep 22, 2009 1:13 pm
Reply with quote

Thanks Frank -- I was little unsure about that, so I asked away.

Probably I'd agree with Terry as I was confused with "+ze/-ze" because before your recent post I was under the inpression that they mean something.
Back to top
View user's profile Send private message
saurabh516

New User


Joined: 27 Nov 2006
Posts: 8
Location: Bangalore

PostPosted: Fri Oct 09, 2009 2:16 pm
Reply with quote

Hi Frank,

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:

Code:
03102009GBP+0000000000004131ANS9004217212NU         
03102009GBP+0000000000004607ANS9004269192NU     
03102009GBP+0000000000002680ANS9004883012NU     
03102009GBP+0000000000002582ANS9004912432NU     
03102009GBP+0000000000003457ANS9005096342NU     
03102009GBP+0000000000002603ANS9005128802NU     
02102009GBP-000000000000486209035830862137       
02102009GBP-000000000000484809035831069643       
02102009GBP-000000000000404009035831124881       
02102009GBP-000000000000472009035832139718       
02102009GBP-000000000000283209035832478245       
02102009GBP-000000000000657809035832917338       
02102009GBP-000000000000177409035833605577       


Loaction of D2 135,8,CH
Loc of amount field(with sign) 154,17,CH

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.

4. Expected o/p file:

03102009GBP+0000000000012456ANS9004217212NU
02102009GBP-000000000000486209035830862137
01102009GBP-000000000000484809035831069643
xxxxxxxxxxxxxxxxxxxxxxxxxxx
30092009GBP-000000000000177409035833605577 [/code]

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:

Code:
*DETAIL                                                             
RECKEY,35,11,CH                                                     
AMOUNT,154,17,FS                                                   
ZDAMT,1080,16,ZD                                                   
/*                                                                 
//TOOLIN   DD *                                                     
 SORT FROM(INPUT) TO(OUTPUT1) USING(CPY1)                           
 SORT FROM(INPUT) TO(OUTPUT2) USING(CPY2)                           
/*                                                                 
//CPY1CNTL DD *                                                     
  INREC OVERLAY=(ZDAMT:AMOUNT,TO=ZD,LENGTH=16)                     
  SORT FIELDS=(RECKEY,A)                                           
  OPTION ZDPRINT                                                   
  SUM FIELDS=(ZDAMT)                                               
  OUTREC BUILD=(1,153,                                             
                ZDAMT,MUL,-1,EDIT=(STTTTTTTTTTT.TT),SIGNS=(+,-),   
                C'GENERAL INS',4X,                                 
                186,894)                 


Pls advice, hope I have made myself clear


Best Regards,
Saurabh
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Oct 09, 2009 9:56 pm
Reply with quote

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
Back to top
View user's profile Send private message
saurabh516

New User


Joined: 27 Nov 2006
Posts: 8
Location: Bangalore

PostPosted: Mon Oct 12, 2009 2:14 pm
Reply with quote

Hi Skolusu,

Here are the answers:
* I referred D2 as the Date value in the Input file, which has to summed and arranged wrt date viz DATE in control

*Is your intention to sum up only records which are matching with the date from date control file? Yes but the SUM has to be done wrt to Amount ONLY.

*I have a limitation of using only DFSORT tools for this operation and not a program. Is there any way out?

Regards,
saurabh516
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Mon Oct 12, 2009 8:41 pm
Reply with quote

wrt?? viz??
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts ISAM and abend S03B JCL & VSAM 10
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
No new posts how to calculate SUM for VB file usin... JCL & VSAM 1
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
Search our Forums:

Back to Top