Well, IBM had a quick response - APAR PK69010, which states, in part: 
A complex IF statement containing abbreviated combined
  conditions with parenthesis around the distributed subjects is
  incorrectly flagged with message IGYPS2048-S.

 

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On
Behalf Of Greg Shirey
Sent: Monday, October 13, 2008 3:18 PM
To: IBM-MAIN@BAMA.UA.EDU
Subject: Re: COBOL abbreviated IF & message IGYPS2048-S

Thanks for the experiment, Peter.  I will open an ETR with IBM and let
them settle the issue.  

I agree with your sentiments about maintainability, and have suggested
such to our QA folks. 

Greg 

-----Original Message-----
From: IBM Mainframe Discussion List On Behalf Of Farley, Peter x23353
Sent: Monday, October 13, 2008 2:52 PM
To: IBM-MAIN@BAMA.UA.EDU
Subject: Re: COBOL abbreviated IF & message IGYPS2048-S

Greg,

I have to agree with your programmer, at least about whether it "used
to" work or not.  We're at Enterprise 3.4 here, and the programmer's
original version of the code compiles clean and generates the correct
object code.

Here's a copy of the pseudo-assembly listing of the programmer's
original code as compiled by Enterprise 3.4, edited to fit email width:

000027  IF

   00090A  5830 912C       L     3,300(0,9)              BLW=0 
   00090E  4820 3098       LH    2,152(0,3)              SUB
   000912  4C20 A0A4       MH    2,164(0,10)             PGMLIT AT +40 
   000916  1A23            AR    2,3                     
   000918  95E7 2129       CLI   297(2),X'E7'            WC-FUNC() 
   00091C  58B0 C020       L     11,32(0,12)             PBL=1 
   000920  4780 B158       BC    8,344(0,11)             GN=6(00092C) 
   000924  95E9 2129       CLI   297(2),X'E9'            WC-FUNC() 
   000928  4770 B16E       BC    7,366(0,11)             GN=5(000942) 
   00092C         GN=6     EQU   *

   00092C  F8F6 D2B0 212A  ZAP   688(16,13),298(7,2)  TS1=0 WC-AMTUSE() 
   000932  FA76 D2B8 2131  AP    696(8,13),305(7,2)   TS1=8
WC-AMT-PENDING() 
   000938  F971 D2B8 C010  CP    696(8,13),16(2,12)   TS1=8 SYSLIT AT
+16   
000029  GO                                            
   00093E  4740 B402       BC    4,1026(0,11)         G100-FIND-CREDIT-X


As you can see, the 3.4 compiler interpreted that COBOL syntax just the
way the programmer intended.

AFAICS, there was nothing *technically* wrong with the programmer's
original code, though I would not have coded it that way.  He used a
perfectly readable "abbreviated IF", though I avoid them if I can in my
own coding.  For clarity and maintainability, I tend to use full
parentheses for IF conditions so that my intentions are clear to future
maintainers.  My version of your programmer's code would have looked
like this:

IF (WC-FUNC (SUB) = ("X" OR "Z")) AND
   ((WC-AMTUSE (SUB) + WC-AMT-PENDING (SUB)) < 0)
   GO TO G100-FIND-CREDIT-X
END-IF.

Some programmers find that style annoying.  I try to think of the
maintainer rather than myself.

HTH

Peter

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to