Page 1 of 1

Conditional change a positive number to negative

PostPosted: Mon May 03, 2010 7:45 pm
by John A
I have tried various ways to change a positive packed decimal field to negative - tried several ideas from various posts.

Here is my latest sort JCL & control cards.

//FMTCFO   EXEC PGM=ICETOOL                             
//TOOLIN   DD  *                                       
  COPY FROM(INPUT)  TO(OUTPUT)  USING(CTL1)             
/*                                                     
//*                     FROM - LENGTH                   
//CTL1CNTL  DD  *                                       
      OUTFIL FNAMES=OUTPUT                             
      INREC  IFTHEN=(WHEN=(14,1,CH,EQ,C'R'),           
          OVERLAY=(4:4,4,ZD,MUL,-1,TO=ZDC,LENGTH=4))   
/*                                                     
//**                                                   
//INPUT    DD  DISP=SHR,                               
//             DSN=T#JWA.TEMP.PACKED.DATA               
//OUTPUT   DD  DSN=T#JWA.TEMP.RECORD.SIZE,             
//             DISP=(,CATLG,DELETE),                   
//             UNIT=SYSDA,SPACE=(TRK,(15,15),RLSE),     
//             DCB=(RECFM=FB,LRECL=020,BLKSIZE=0)       

Below is my input file:

..1........  R     
00F0111022244D444444
001011C022D009000000


Result is an ABEND:

09.54.01 JOB28504 +IDI0002I Module ICEOUTF offset X'5552': Abend S0C7-X'0' (Data Exception)
09.54.01 JOB28504 IEA995I SYMPTOM DUMP OUTPUT 091


Any/all help appreciated, thanks.

Re: Conditional change a positive number to negative

PostPosted: Mon May 03, 2010 9:51 pm
by CICS Guy
If you are trying to reverse the sign of the 0011111 number, it is packed not zoned.....

Re: Conditional change a positive number to negative

PostPosted: Mon May 03, 2010 10:25 pm
by Frank Yaeger
John,

Since you want to change a PD field, why are you using ZD format instead of PD format? For the data you show, your OVERLAY operand should be:

          OVERLAY=(4:4,4,PD,MUL,-1,TO=PDC,LENGTH=4))   

Re: Conditional change a positive number to negative

PostPosted: Tue May 04, 2010 1:21 am
by John A
Thansk for the input.

Was pretty dumb on my part, that's why I'm on the beginner's forum.

Thanks again.