File identification and entry

Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Re: File identification and entry

Postby dick scherrer » Fri Jun 14, 2013 6:59 pm


Lots of Stuff, but not what was requested. . .

How was the input file created?

Post a couple of input records in HEX.

Why was the entire source posted?
Hope this helps,
User avatar
dick scherrer
Global moderator
Posts: 6308
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 90 times

Re: Re: File identification and entry


Re: File identification and entry

Postby BillyBoyo » Sat Jun 15, 2013 4:55 am

I notice that you are DISPLAYing ENTRADA, not REG-ENTRADA.

As I mentioned before, you are "processing" a record after end-of-file. You also do your DISPLAY before you have read the first record.

You don't seem to fully understand about the use of SECTIONs. It is not good practice, to my mind, to PERFORM a SECTION which contains a STOP RUN. STOP RUN is not such a good way to end a program, particularly as yours is using SQL. GOBACK will be much better. PERFORM the final part, then just GOBACKm outside of the SECTION.

Find out about and use 88s, with EVALUATE TRUE. Avoid "nested" EVALUATEs. Put them into SECTIONs (since you use those) with meaningful names.

Again as I mentioned before, you have no FILE-STATUS checking. You should check after every I/O operation that all was well, It will save you many, many hours over the years.
Global moderator
Posts: 3732
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 254 times


Return to IBM Cobol


  • Related topics
    Last post