Page 1 of 1

z/OS IGYWCL removing/ignoring periods and line breaks

PostPosted: Sat Jul 07, 2018 4:33 am
by bellmar
I have the following COBOL program for Muller's recession:
https://drive.google.com/file/d/1sNhXcrCicnuTD1mxmoO1BcncRo9lSrsw/view?usp=sharing

Compiles and runs fine in GnuCOBOL, but I wanted to try it on z/OS. When I run a foreground job to compile it I get a series of errors that seem to suggest the compiler is ignoring line breaks and treating periods like non-COBOL valid characters. It seems to think the Program-ID section is on line 1 when it's on line 2 (for example)

https://drive.google.com/file/d/1CQ6Z_yhizxWRduUqrRpThFaRP78brS_0/view?usp=sharing

Any ideas?

Re: z/OS IGYWCL removing/ignoring periods and line breaks

PostPosted: Sat Jul 07, 2018 4:54 am
by NicC
How did you transfer the source code to the mainframe? It looks like whatever transferred the data did not remove the crlf (which is not used on the mainframe).
Why could you not simply cut and paste the stuff on those links into your post? Many people will not look at those links because they may not be allowed by their company's firewall or in case there is a virus or similar.

Re: z/OS IGYWCL removing/ignoring periods and line breaks

PostPosted: Sat Jul 07, 2018 5:09 am
by bellmar
It's a short program so I just retyped it into ISPF after I had created the data set.

Re: z/OS IGYWCL removing/ignoring periods and line breaks

PostPosted: Sat Jul 07, 2018 3:53 pm
by NicC
What are the data set characteristics? Do they conform to what the compiler expects as documented?

Re: z/OS IGYWCL removing/ignoring periods and line breaks

PostPosted: Sat Jul 07, 2018 5:33 pm
by bellmar
HA! Well to be honest I spent close to a week trying to find any documentation at all on what the characteristics of a data set should be for COBOL programs and came up with nothing.... so if you know of one that would be appreciated.

Otherwise, these are the characteristics I used working from this tutorial https://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.ikjp100/pds.htm and adjusting to account for COBOL's 80 columns fixed width.

Volume serial : JASYS1
Device type: 3390
Organization: PO
Record format: VB
Record length: 80
Block size: 4000
1st extent blocks: 72
Secondary blocks: 20

Re: z/OS IGYWCL removing/ignoring periods and line breaks

PostPosted: Sat Jul 07, 2018 5:44 pm
by Robert Sample
The Enterprise COBOL documentation can be found at https://www-01.ibm.com/support/docview.wss?uid=swg27036733Bookmark this site and refer to as needed.

COBOL does not use a "80 columns fixed width" as your post indicates. COBOL uses columns 1 through 72 for specific purposes; traditionally (since punch cards were 80 columns and the length carried over) COBOL data sets are RECFM=FB,LRECL=80,BLKSIZE=(some multiple of 80). As long as columns 1 through 72 are available, I don't think the compiler cares if records are variable or fixed length. However, check your profile for your data set -- COBOL source code CANNOT be packed; if your ISPF profile specifies packed then that could cause the issue you had.

Re: z/OS IGYWCL removing/ignoring periods and line breaks

PostPosted: Sat Jul 07, 2018 5:47 pm
by bellmar
Okay I moved the program from a data set with a record type of VB to a data set with a record type of FB and that seemed to do the trick. It's compiling without errors now!