gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [open-cobol-list] Small addition for OpenCOBOL Programmers Guide


From: William M Klein
Subject: Re: [open-cobol-list] Small addition for OpenCOBOL Programmers Guide
Date: Wed, 11 Apr 2012 15:21:22 -0500

Sorry not to "jump into" this conversation earlier

As I think has already been mentioned, there are VERY different rules (in the 
Standard, for Micro Focus, for OpenCOBOL, and for every other compiler that I 
know of) for fixed form reference format and free form reference format.  (Some 
compilers also support non-standard variations on free form reference format).

In fixed format (which was ALL there was in the '85 Standard - and is still all 
there is for IBM mainframe compiler)
 In column 7
   *  - means a comment
   /  - means a comment but "page eject for listings"
   -  - means continuation (of literals or words)
   D  - means a debugging line
   EVERYTHING else (except a space) is an "error"

I think that OC supports all of this and works "just fine" when in fixed form 
reference format

When in FREE form reference format, column 7 is just "any old line" and NEVER 
means anything special
  *> - at the begging (not necessarily column 1) if a line is a comment
  >>PAGE  - means page eject in listing
  >>D - means debugging line
    no way to continue COBOL words and a new way of continuing literals

Again, as far as I know OC works just fine for these too

As far as other
   $xyz
syntax, this comes from Micro Focus and corresponds closely (but not exactly) 
with Standard
  >>xyz
syntax, like
  >>IF

Micro Focus also has an option for treating "*" (not *>) in column 1 as a 
comment line,  I could be wrong, but I don't think OC supports that variation.

Bottom-Line:
  I don't know what, if any, changes to OC are being requested by this thread 
but I think everything currently works both as it should and as expected in the 
current OC compiler

-----Original Message-----
From: Fred Mobach [mailto:address@hidden 
Sent: Wednesday, April 11, 2012 3:56 AM
To: address@hidden
Subject: Re: [open-cobol-list] Small addition for OpenCOBOL Programmers Guide

On Tuesday 10 April 2012 21:25:38 vince wrote:
> On Tuesday 10 Apr 2012 19:28:11 Fred Mobach wrote:
> > In chapter 1.5 of OpenCOBOL Programmers Guide.pdf is noted:
> >
> > The following are special directives or characters that may be used
> > in OpenCOBOL programs to signify various things.
> > “*” in column 7            Signifies the source line is a comment.
> > This is valid only when in FIXED mode.
> >
> > What is NOT yet mentioned is that the slash character ("/") in
> > column 7 in FIXED mode is also accepted as a special character to
> > be skipped.
>
> Err, according to my passing through OC a large number of
> programs/modules from MF Workbench etc, and OC then complaining, I
> would suggest not so.
>
> '/' are not an accepted character, which is used to eject page on
> printing and as the compiler does not really produce full reporting
> (other than via the -P flag) it would not get used so sounds
> reasonable that it is not liked :)
>
> Also the MF other printer control tags, as far as I know also not
> liked (migration was too long ago).
>
> However certain aspects of the $IF, $ELSE & $END are accepted
> although I do seem to get some mixed results.

The MF compiler is unknown to me, but I stumbled upon this behavior of 
openCOBOL during a migration of sources previously used in 
Siemens/Bull/IBL environments. As most of the source works as expected 
I won't blame openCOBOL for accepting the slash, just enjoy being 
surprised. 

To make a simple check possible the openCOBOL version and the test 
source are below.

address@hidden:~/cob/tests> cobc -m -W retcode.cob
address@hidden:~/cob/tests> cat retcode.cob
       identification division.
       program-id. x.
       environment division.
       data division.
       working-storage section.
       01  ws-variables.
           03  returncode            pic s9(12) comp sync value -11.
      /
       procedure division.
       mainline section.
       p00.
           move 21 to return-code
           display "return-code=" return-code end-display
               .
       peos.
           stop run.
address@hidden:~/cob/tests> cobc --version
cobc (OpenCOBOL) 1.1.0
Copyright (C) 2001-2009 Keisuke Nishida / Roger While
Built    Feb 19 2012 22:24:40
Packaged Feb 06 2009 10:30:55 CET
address@hidden:~/cob/tests>
-- 
Fred Mobach
website : https://fred.mobach.nl
 .... In God we trust ....
 .. The rest we monitor ..

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
open-cobol-list mailing list
address@hidden
https://lists.sourceforge.net/lists/listinfo/open-cobol-list



reply via email to

[Prev in Thread] Current Thread [Next in Thread]