• Demo: convert Cobol file to csv

    From Saravanan@21:1/5 to All on Fri Feb 19 05:33:30 2021
    I see below line in this program
    $SET SOURCEFORMAT"FREE"

    Will this program work on IBM z/OS mainframe or will it work only on Microfocus?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kerry Liles@21:1/5 to Saravanan on Fri Feb 19 14:44:17 2021
    Saravanan wrote:

    I see below line in this program
    $SET SOURCEFORMAT"FREE"

    Will this program work on IBM z/OS mainframe or will it work only on Microfocus?

    Well, you could just try it... :)

    I think most of the zOS or VSE compilers will choke on free-format (long lines, lower case etc?) [I am guessing at what SOURCEFORMAT"FREE" actually means...
    The real mainframe compilers tend to be very much stuck in the past about the
    A and B columns etc. (you may have to Google that concept because I assume you are less than 60 years old?) cheers

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Arnold Trembley@21:1/5 to Saravanan on Fri Feb 19 23:12:22 2021
    On 2/19/2021 7:33 AM, Saravanan wrote:
    I see below line in this program
    $SET SOURCEFORMAT"FREE"

    Will this program work on IBM z/OS mainframe or will it work only on Microfocus?


    I don't believe IBM COBOL for z/OS supports free format COBOL. It may
    be tedious but not too difficult to convert to 80-column fixed format.

    GnuCOBOL supports both fixed format and free format. According to the
    GnuCOBOL programmer's guide, in free format there is no distinction
    between Area A and Area B, and the maximum line length is 255
    characters. Since Column 7 no longer has a defined usage, you need to
    use "*>" to indicate that everything to the end of the current line is a comment.

    There is also an open source COBOL program for converting between fixed
    format and free format. Unfortunately, it is in free format for GnuCOBOL: https://sourceforge.net/p/gnucobol/contrib/HEAD/tree/trunk/tools/changeformat/

    Kind regards,

    --
    https://www.arnoldtrembley.com/

    --
    This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Vincent Coen@21:1/5 to Arnold Trembley on Sat Feb 20 13:56:47 2021
    Hello Arnold!

    Saturday February 20 2021 05:12, Arnold Trembley wrote to All:

    On 2/19/2021 7:33 AM, Saravanan wrote:
    I see below line in this program
    $SET SOURCEFORMAT"FREE"

    Will this program work on IBM z/OS mainframe or will it work only on
    Microfocus?


    I don't believe IBM COBOL for z/OS supports free format COBOL. It may
    be tedious but not too difficult to convert to 80-column fixed
    format.

    GnuCOBOL supports both fixed format and free format. According to the
    GnuCOBOL programmer's guide, in free format there is no distinction
    between Area A and Area B, and the maximum line length is 255
    characters. Since Column 7 no longer has a defined usage, you need
    to use "*>" to indicate that everything to the end of the current line
    is a comment.

    There is also an open source COBOL program for converting between
    fixed format and free format. Unfortunately, it is in free format for GnuCOBOL: https://sourceforge.net/p/gnucobol/contrib/HEAD/tree/trunk/tools/chang eformat/


    There is now file changeformat-f.cbl that is in fixed format but otherwise
    has no other changes.



    Vincent

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dumas Walker@21:1/175 to ARNOLD TREMBLEY on Sat Feb 20 08:55:00 2021
    I don't believe IBM COBOL for z/OS supports free format COBOL. It may
    be tedious but not too difficult to convert to 80-column fixed format.

    It may depend on what compiler settings are being used but, where I have
    worked it is not supported.


    * SLMR 2.1a * May The Force be with you...
    --- SBBSecho 3.12-Linux
    * Origin: capitolcityonline.net * Telnet/SSH:2022/HTTP (21:1/175)
  • From pete dashwood@21:1/5 to Saravanan on Sun Feb 21 12:20:52 2021
    On 20/02/2021 02:33, Saravanan wrote:
    I see below line in this program
    $SET SOURCEFORMAT"FREE"

    Will this program work on IBM z/OS mainframe or will it work only on Microfocus?

    Both Micro Focus and Fujitsu COBOLs support Free Format.

    I have never seen an IBM site that did, but I haven't worked on an IBM
    site for over 25 years...

    It is pretty trivial to write a program that converts COBOL source from
    free to fixed format.

    I guess a utility that could convert both ways might be useful...

    Oops!, I just realized that fixed format will compile fine as free
    format (at least, it will under Fujitsu...), so that isn't needed.

    But the subject of your post says convert to .csv.

    Given that COBOL source is TEXT, there doesn't seem to be much point in
    making it .csv; (every line would be a text literal, separated from the
    other lines by a comma and any commas in the text would result in
    confusion in the output...). Treat COBOL source as a TEXT file (LINE SEQUENTIAL) because that's what it is. As such, it can be easily
    transferred between mainframe and network environments.


    Pete.
    --
    I used to write *COBOL*; now I can do *anything*...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)