|
--- "Stone, Joel" <StoneJ@xxxxxxxxxxxxxxxx> wrote: > COBOL & RPG are pretty much the same regarding IF ... ENDIF. All the COBOL code I've been working with does NOT use the END-IF. What a relief that is! > Unfortunately RPG is still behind in many areas. In your example, in RPG > you cannot test the first four bytes of a field without moving to another > field (as far as I know). With the new free-form specs (c/free) that came out in v5r1, I believe this is no longer true, from what I've heard, but I haven't actually tried it out myself. With a few BIF's and no indicators. This is a real *rough* idea from what I know: If %check('1234567890' : %subst(VNCOMPANY:1:4)) > Most people would never suggest ending an IF stmt with a period. Periods > are too hard to see, they can be commented out and seem to be there but are > just comments, and they arent so reliable. Agreed! Now that I know of the END-IF, well, that pain is gone. > Not sure what you mean that Cobol can have multiple IF's on one stmt. Are > you defining one stmt as one source line? No one ever puts multiple IF's on > one source line I dont think. Here's the code I am dealing with that explains this: IF VNGROUP = 'CORP' AND LFNCT-OT = 'E' IF WS-VNCOMPANY-1-4 = SPACES MOVE 0030 TO WS-VND-COMPANY ELSE MOVE WS-VNCOMPANY-1-4 TO WS-VND-COMPANY. How would I do an ELSE on the first IF after this code snippet? Just remove the period and add the ELSE condition, with a period at the end? If so, bleahhh. Thanks to all who helped me on this one! - Dan __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.