You may notice some odd code, I am learning how to write COBOL and I wrote in a lot of END-IF and END-ACCEPT to appease every single possible error from the -W flag.
Line endings should be simple \n, and there are absolutely NO tabs. All lines of code should be in fixed format, terminating before column 72.
This snippet of code does correctly compile on RM/COBOL 12.17
IDENTIFICATIONDIVISION.PROGRAM-ID.FXSHHIST.*DATE-COMPILED.ENVIRONMENTDIVISION.CONFIGURATIONSECTION.COPYJDSECURE.*******************************************************************CHANGE&ENHANCEMENTLOG********************************************************************promptforLoc,WO,Seg*RunthrougheachSHHIST-USEDDEBUGtofixafield*thiswillrewriteitforyou******************************************************************INPUT-OUTPUTSECTION.FILE-CONTROL.SELECTSHHISTASSIGNTORANDOM"HIST"ORGANIZATIONISINDEXEDACCESSMODEISDYNAMICRECORDKEYISSH-KEYALTERNATERECORDKEYISSH-CUST-ALPHAWITHDUPLICATESFILESTATUSISSTATUS-KEY.*DATADIVISION.FILESECTION.COPYFSHHIST.WORKING-STORAGESECTION.COPYW1FKEY.01WS-CTRPIC9(3).01UPD-SWPICX.01SAVE-SERNOPICX(20).01SAVE-WOPIC9(9).01SAVE-SEGPIC9(2).01ALL-OK-SWPICX.88ALL-OK-VALIDVALUE"Y""N""Q".88ALL-OK-YESVALUE"Y".88ALL-OK-QUITVALUE"Q".01DONE-SWPICX.88DONEVALUE"Y".01DUMMYPICX.01BLANK-LINEPICX(79)VALUESPACES.01DISP-CNTPICZZZZZ9.01FIELD-LETTERPICX.01FIELD-CONFIRMPICX.01CLEAR-SCREENPICXXXXVALUEX"1B5B324A".01WS-MAKEPICX(5).*USERI/OVARIABLES01IO-YESNO-POS-XPIC99.01IO-YESNO-POS-YPIC99.01IO-YESNOPICX.88IO-YESVALUE"Y".88IO-NOVALUE"N".01IO-YESNO-POS-X2PIC99.*PRINTVARIABLES01LINE-NUMBERPIC99.COPYW1USE./PROCEDUREDIVISION.DECLARATIVES.SHHIST-STATUSSECTION.USEAFTERSTANDARDEXCEPTIONPROCEDUREONSHHIST.USE-SHHIST.MOVE"I"TOFILE-TYPE.MOVE"SHHIST "TOSTAT-FILE.PERFORMUSE-PERFORMTHRUUSE-EXIT.GOTOUSE-END.*COPYP1USE.******************************************************************MAIN-CONTROLSECTION.*0000-BEGIN-PROGRAM.MOVE"ERROR: "TOMSG-TYPE.MOVE"FXSHHIST"TOPROGRAM-NAME.PERFORM1100-DRAW-TITLE.OPENI-OSHHISTMOVEZEROSTOSTATUS-KEYPERFORMUNTILCMD-KEYORALL-OK-QUITMOVESPACESTODONE-SWALL-OK-SWPERFORM1000-PROMPTTHRU1500-EXITUNTILDONEIFALL-OK-YESPERFORM2000-UPDATEEND-IFEND-PERFORMCLOSESHHIST.0000-EXIT.GOBACK.1000-PROMPT.PERFORM1100-DRAW-TITLEDISPLAY" SerialNo: "LINE6POSITION1"Work Order: "LINE7POSITION1" Segment: "LINE8POSITION1"All OK? (Y,N,Q): "LINE14POSITION1ACCEPTSAVE-SERNOLINE6POSITION13TABNOBEEPUPDATEONEXCEPTION*WS-FKEY-VALUECONTINUEEND-ACCEPTIFCMD-KEYORSAVE-SERNO=SPACESMOVE"Y"TODONE-SWGOTO1500-EXITEND-IFACCEPTSAVE-WOLINE7POSITION13TABUPDATEONEXCEPTION*WS-FKEY-VALUECONTINUEEND-ACCEPTIFCMD-KEYORSAVE-WO=SPACESORZEROSMOVE"Y"TODONE-SWGOTO1500-EXITEND-IFACCEPTSAVE-SEGLINE8POSITION13TABUPDATEONEXCEPTION*WS-FKEY-VALUECONTINUEEND-ACCEPTIFCMD-KEYMOVE"Y"TODONE-SWGOTO1500-EXITEND-IF.DISPLAY" "LINE13POSITION1.1300-ALL-OK.ACCEPTALL-OK-SWLINE14POSITION18TABUPDATEONEXCEPTION*WS-FKEY-VALUECONTINUEEND-ACCEPT.IFCMD-KEYMOVE"Y"TODONE-SWGOTO1500-EXITEND-IFDISPLAY" "LINE14POSITION22IFNOTALL-OK-VALIDDISPLAY"Valid values are Y, N, Q"LINE14POSITION22GOTO1300-ALL-OKEND-IFIFALL-OK-QUITORALL-OK-YESMOVE"Y"TODONE-SWEND-IF.1500-EXIT.EXIT.2000-UPDATE.INITIALIZESH-KEYMOVESAVE-SERNOTOSH-SERNOMOVESAVE-WOTOSH-WORKORDMOVESAVE-SEGTOSH-SEGMENTSTARTSHHISTKEYNOT<SH-KEYEND-STARTIFNOTSUCCESSFUL-IOEXITPARAGRAPHEND-IF.PERFORMWITHTESTAFTERUNTILNOTRECORD-LOCKREADSHHISTNEXTWITHLOCKEND-READEND-PERFORMIFAT-ENDOR(SAVE-SERNONOT=SH-SERNO)OR(SAVE-WONOT=SH-WORKORD)OR(SAVE-SEGNOT=SH-SEGMENT)UNLOCKSHHISTEXITPARAGRAPHEND-IF.MOVE"N"TODONE-SW.PERFORM2100-RECORD-VIEWUNTILDONE.2100-RECORD-VIEW.PERFORM1100-DRAW-TITLE.PERFORM1200-DRAW-RECORD.*1200-DRAW-RECORDdisplaysallrecordfieldsonscreen*fromAthroughV.DISPLAY"Need to update? -Y/N-: "LINE18POSITION1.MOVE18TOIO-YESNO-POS-Y.MOVE24TOIO-YESNO-POS-X.PERFORM1105-PROMPT-YESNO.IFIO-NOMOVE"Y"TODONE-SWEXITPARAGRAPHEND-IF.MOVE"Z"TOFIELD-LETTER.PERFORMUNTILFIELD-LETTER>="A"ANDFIELD-LETTER<="V"DISPLAY"Which field to modify? -A-V-: "LINE19POSITION1ACCEPTFIELD-LETTERLINE19POSITION31TABEND-ACCEPTEND-PERFORM.*Pre-emptivelydisplayfieldstosavelinesofcodePERFORM1100-DRAW-TITLE.DISPLAY"Current Value: "LINE5POSITION1Display" New value: "LINE7POSITION1EVALUATEFIELD-LETTERWHEN"A"DISPLAY"MODIFYING SH-SERNO"LINE3POSITION20DISPLAYSH-SERNOLINE5POSITION20ACCEPTSH-SERNOLINE7POSITION20END-ACCEPTWHEN"B"DISPLAY"MODIFYING SH-WORKORD"LINE3POSITION20DISPLAYSH-WORKORDLINE5POSITION20ACCEPTSH-WORKORDLINE7POSITION20END-ACCEPTWHEN"C"DISPLAY"MODIFYING SH-SEGMENT"LINE3POSITION20DISPLAYSH-SEGMENTLINE5POSITION20ACCEPTSH-SEGMENTLINE7POSITION20END-ACCEPTWHEN"D"DISPLAY"MODIFYING SH-COUNT"LINE3POSITION20DISPLAYSH-COUNTLINE5POSITION20ACCEPTSH-COUNTLINE7POSITION20END-ACCEPTWHEN"E"DISPLAY"MODIFYING SH-CUSTOMER"LINE3POSITION20DISPLAYSH-CUSTOMERLINE5POSITION20ACCEPTSH-CUSTOMERLINE7POSITION20END-ACCEPTWHEN"F"DISPLAY"MODIFYING SH-CUST-ALPHA"LINE3POSITION20DISPLAYSH-CUST-ALPHALINE5POSITION20ACCEPTSH-CUST-ALPHALINE7POSITION20END-ACCEPTWHEN"G"DISPLAY"MODIFYING SH-MAKE"LINE3POSITION20DISPLAYSH-MAKELINE5POSITION20ACCEPTSH-MAKELINE7POSITION20END-ACCEPTWHEN"H"DISPLAY"MODIFYING SH-MODEL"LINE3POSITION20DISPLAYSH-MODELLINE5POSITION20ACCEPTSH-MODELLINE7POSITION20END-ACCEPTWHEN"I"DISPLAY"MODIFYING SH-EQUIP"LINE3POSITION20DISPLAYSH-EQUIPLINE5POSITION20ACCEPTSH-EQUIPLINE7POSITION20END-ACCEPTWHEN"J"DISPLAY"MODIFYING SH-SPG-CD"LINE3POSITION20DISPLAYSH-SPG-CDLINE5POSITION20ACCEPTSH-SPG-CDLINE7POSITION20END-ACCEPTWHEN"K"DISPLAY"MODIFYING SH-COMPONENT"LINE3POSITION20DISPLAYSH-COMPONENTLINE5POSITION20ACCEPTSH-COMPONENTLINE7POSITION20END-ACCEPTWHEN"L"DISPLAY"MODIFYING SH-JOBCD"LINE3POSITION20DISPLAYSH-JOBCDLINE5POSITION20ACCEPTSH-JOBCDLINE7POSITION20END-ACCEPTWHEN"M"DISPLAY"MODIFYING SH-MODIFIER"LINE3POSITION20DISPLAYSH-MODIFIERLINE5POSITION20ACCEPTSH-MODIFIERLINE7POSITION20END-ACCEPTWHEN"N"DISPLAY"MODIFYING SH-EQ"LINE3POSITION20DISPLAYSH-EQLINE5POSITION20ACCEPTSH-EQLINE7POSITION20END-ACCEPTWHEN"O"DISPLAY"MODIFYING SH-PARTS"LINE3POSITION20DISPLAYSH-PARTSLINE5POSITION20ACCEPTSH-PARTSLINE7POSITION20END-ACCEPTWHEN"P"DISPLAY"MODIFYING SH-LABOR"LINE3POSITION20DISPLAYSH-LABORLINE5POSITION20ACCEPTSH-LABORLINE7POSITION20END-ACCEPTWHEN"Q"DISPLAY"MODIFYING SH-MISC"LINE3POSITION20DISPLAYSH-MISCLINE5POSITION20ACCEPTSH-MISCLINE7POSITION20END-ACCEPTWHEN"R"DISPLAY"MODIFYING SH-METER"LINE3POSITION20DISPLAYSH-METERLINE5POSITION20ACCEPTSH-METERLINE7POSITION20END-ACCEPTWHEN"S"DISPLAY"MODIFYING SH-INVDATE"LINE3POSITION20DISPLAYSH-INVDATELINE5POSITION20ACCEPTSH-INVDATELINE7POSITION20END-ACCEPTWHEN"T"DISPLAY"MODIFYING SH-SERVTYP"LINE3POSITION20DISPLAYSH-SERVTYPLINE5POSITION20ACCEPTSH-SERVTYPLINE7POSITION20END-ACCEPTWHEN"U"DISPLAY"MODIFYING SH-SPG-TYPE"LINE3POSITION20DISPLAYSH-SPG-TYPELINE5POSITION20ACCEPTSH-SPG-TYPELINE7POSITION20END-ACCEPTWHEN"V"DISPLAY"MODIFYING SH-SPG-DESC"LINE3POSITION20DISPLAYSH-SPG-DESCLINE5POSITION20ACCEPTSH-SPG-DESCLINE7POSITION20END-ACCEPTEND-EVALUATE.*PromptforuserinputvalidationDISPLAY"Are you SURE? -Y/N-: "LINE9POSITION1MOVE9TOIO-YESNO-POS-Y.MOVE22TOIO-YESNO-POS-X.PERFORM1105-PROMPT-YESNO.IFIO-YESREWRITESERVHISTEND-REWRITEEND-IFEXITPARAGRAPH.*Thefollowingparagraphsshouldnotbeexecutedunlesscalled1100-DRAW-TITLE.MOVE1toLINE-NUMBER.PERFORMVARYINGLINE-NUMBERFROM1BY1UNTILLINE-NUMBER=24DISPLAYSPACESLINELINE-NUMBERSIZE80END-PERFORM.DISPLAY"PARTS MARKETING MANAGEMENT"LINE1POSITION28.DISPLAY"-FXSHHIST-1-"LINE2POSITION65.DISPLAY"CMD-Quit"LINE24POSITION37.1200-DRAW-RECORD.DISPLAY"A) SH-SERNO: "LINE3POSITION1SH-SERNOLINE3POSITION20"B) SH-WORKORD: "LINE4POSITION1SH-WORKORDLINE4POSITION20"C) SH-SEGMENT: "LINE5POSITION1SH-SEGMENTLINE5POSITION20"D) SH-COUNT: "LINE6POSITION1SH-COUNTLINE6POSITION20"E) SH-CUSTOMER: "LINE7POSITION1SH-CUSTOMERLINE7POSITION20"F) SH-CUST-ALPHA: "LINE8POSITION1SH-CUST-ALPHALINE8POSITION20"G) SH-MAKE: "LINE9POSITION1SH-MAKELINE9POSITION20"H) SH-MODEL: "LINE10POSITION1SH-MODELLINE10POSITION20"I) SH-EQUIP: "LINE11POSITION1SH-EQUIPLINE11POSITION20"J) SH-SPG-CD: "LINE12POSITION1SH-SPG-CDLINE12POSITION20"K) SH-COMPONENT: "LINE13POSITION1SH-COMPONENTLINE13POSITION20"L) SH-JOBCD: "LINE3POSITION40SH-JOBCDLINE3POSITION60"M) SH-MODIFIER: "LINE4POSITION40SH-MODIFIERLINE4POSITION60"N) SH-EQ: "LINE5POSITION40SH-EQLINE5POSITION60"O) SH-PARTS: "LINE6POSITION40SH-PARTSLINE6POSITION60"P) SH-LABOR: "LINE7POSITION40SH-LABORLINE7POSITION60"Q) SH-MISC: "LINE8POSITION40SH-MISCLINE8POSITION60"R) SH-METER: "LINE9POSITION40SH-METERLINE9POSITION60"S) SH-INVDATE: "LINE10POSITION40SH-INVDATELINE10POSITION60"T) SH-SERVTYP: "LINE11POSITION40SH-SERVTYPLINE11POSITION60"U) SH-SPG-TYPE: "LINE12POSITION40SH-SPG-TYPELINE12POSITION60"V) SH-SPG-DESC: "LINE15POSITION1SH-SPG-DESCLINE15POSITION20.1105-PROMPT-YESNO.MOVE"N"TOIO-YESNOACCEPTIO-YESNOLINEIO-YESNO-POS-YPOSITIONIO-YESNO-POS-XTABEND-ACCEPTIFIO-YESORIO-NOEXITPARAGRAPHEND-IFCOMPUTEIO-YESNO-POS-X2=IO-YESNO-POS-X+5END-COMPUTEDISPLAY"Response must be Y or N."LINEIO-YESNO-POS-YPOSITIONIO-YESNO-POS-X2GOTO1105-PROMPT-YESNO.END-PROGRAM.
Finally, on to the error that I am getting (on the last line of code):
END-PROGRAM.
FXSHHIST.CBL2: in paragraph 'END-PROGRAM':
END-PROGRAM is in margin "A" (COLUMN 8) - Thought to be a paragraph label.
Move it to column 12
Change END-PROGRAM to "END PROGRAM" or "STOP RUN"
Ralph
Last edit: Ralph Linkletter 2024-01-18
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
END PROGRAM - same error
STOP RUN - same error
END PROGRAM column 12 - same error
STOP RUN column 12 - same error
(NO END PROGRAM OR STOP RUN) - same error
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2024-01-18
Suggestions, in my opinion, useful for those who are learning COBOL.
use the END PROGRAM statement only if you write nested programs. In other cases like this it serves no purpose and is a source of potential errors.
write programs with the new >>SOURCE FREE format (like all other languages C, Java, Python ... and for available large screens), do not use the old format >>SOURCE FIXED (only for COBOL and for old 80 cols green screens). This way programs are more compact and readable with fewer lines and less need to go to new line for same statement. A singke statement / verb should all be on the same line. The indentations are clearer. There is less risk of errors due to the constraints of the fixed format.
perhaps the file you are using has some incorrect characters at the end of the file.
my suggestion to use free format was related to writing new programs.
if you already have fixed format programs then forget it.
if you really want to try, keep in mind that there are already utilities written by someone in cobol that allow you to modify the format of cobol sources.
I've never used them. There are several posts that deal with this topic. I think they are in the "contributions" folder.
the syntax of *> says it can be placed anywhere in a line of code. from column 1 onwards (up to column 256 I think).
it can also be positioned to the right of a statement.
eg MOVE A TOB *> this is a comment
Last edit: Eugenio Di Lorenzo 2024-01-18
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sadly I get the same error with or without END PROGRAM in any column
(see previous reply)
I would like to use the SOURCE FREE format, however, when I try to
compile, it complains about comments in column 7. In the source code
and copybooks.
Should I write a script that converts comments starting in column 7
into *> ? Does that syntax work anywhere in a line?
You could or simply cheat and put in on line 1 :
>>source variable
Now you can continue beyond cc 72. I have done this to 40+ programs
written as FIXED to save a bit of time before converting to FREE.
For FREE using a good editor such as kate use in replace mode for " "
without the quotes to " >" one by one if you have asterisk any where
else and/or using *> already as a floating comment.
Remove the / or replace for *>
IN the block of comments starting with * only replace on the FIRST
ocurrence i.e.,
* * comment **
* more text including *
for *> * comment **
etc
For a perform that is used in only one place use an inline perform with
places you want to quit with
EXIT PERFORM
or if terminating that cycle use EXIT PERFORM CYCLE
This does depend on how complex the perform para's are though.but it
does save on using GO TO;s.
No, if you have fixed-form reference-format ted code, then stay with this.
If you write me one out of a good idea to start your comments in col. 7 with > this way, it will possibly additional* compile in free-form.
... for the other thing (the error) I'll have a look at this next week, including if the compiler should accept an empty paragraph at the end - I think it should.
Small point you are using DS and you are performing and goto paras outside the DS and that is a nono at least in my experience of using them but I must admit I try to avoid the use of it.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you use the Declaratives you must only have any perform, goto code
with that block.
For more information read the GnuCobol Programmers Guide.
For more look at some of the programs supplied in the Contrib area under
the SVN tag at sourceforge/p/gnucobol
and grab my nightly builds of ACAS which includes the OE (Order Entry)
sub system which makes a lot of use of Declaratives, possibly too much
but it was written by another in late 79 - 80 which I have been
migrating it over to the GnuCobol compiler from RM v1.4 or so.
This is still in a test / bug fix / coding mode or has been for almost 2
months so I am taking a wee rest from it to work on testing and
documentation of ACAS which is over due :(
In that archive you will see one of the folders as OE with w folders src
and one within copybooks
the later must be set up for compiling by using command (and I have a
Linux script for doing this called comp-oe.sh .
Before I forget the compile process does not generate prn files (Print)
as that line is remarked out but you could swap them around to do so.
The other script supplied is comp-oe-diags.sh which is similar, does
produce print files but also include full diagnostics such as runtime
checks and full tracing of the code.
For new systems and while testing I find this very useful to discover
any hiding bugs and mismatched linkage sections and more such as doing
numeric processing on non-numeric data, etc.
This concatenates two folders for the copy libraries for both OE and
ACAS although the needed copybooks should be in src/copybook as far as I
know, but I still use the above export - JIC (Just in case I missed any).
The script comp-oe.sh build all of the Cobol programs and the C routine
ACCEPT_NUMERIC which is used in some of the OE programs to accept a
number field storing it into a COMP-£ type field. Without this getting
edited number fields is a pain.
This is NEW code written by Chuck for us all to test and OE is the
primary system being used to do so..
So far it has worked a treat but I only use it in Update mode having any
virgin data field preset to zeroes.
Here see the programs used within Billing as this is where almost of of
it is currently used.
Warning OE documentation consists of only ONE document and that is the
original System Specifications and here some of the Screen and reporting
layouts have been changed.
It is another job that will need to be done - creating an OR manual even
if it is a simple one :)
There is separate archives for both ACAS and OE and even one for some
test data that I have been using for ACAS although not complete as some
testing is done in another folder and subject to change depending on
what is being tested and at what level..
Yes, I was a professional Test lead and manager as well as a Programmer,
Operator (mainframes), IT Manager and Director to name a few of my past
titles as well as gopher :)
Have fun,
Vincent
On 18/01/2024 18:39, Michael Smith wrote:
Ha- this is it! I commented out the DS lines of code and it compiles!!
Thank you!
Now I must ask - I am a COBOL newbie so is there anything I can do to
move this section of code somewhere else to avoid this type of error?
Output of cobc --info
I am trying to compile the following program which I will include in its entirety for the sake of it.
I try to compile with:
cobc -W -v -x -I . -I COPYBOOK/ -std=rm-strict -findirect-redefines FXSHHIST.CBL2
You may notice some odd code, I am learning how to write COBOL and I wrote in a lot of END-IF and END-ACCEPT to appease every single possible error from the -W flag.
Line endings should be simple \n, and there are absolutely NO tabs. All lines of code should be in fixed format, terminating before column 72.
This snippet of code does correctly compile on RM/COBOL 12.17
Finally, on to the error that I am getting (on the last line of code):
Last edit: Michael Smith 2024-01-18
Michael,
the END-PROGRAM statement requires the program-id as follows.
END PROGRAM FXSHHIST.
.
Last edit: Michael Smith 2024-01-18
END-PROGRAM.
FXSHHIST.CBL2: in paragraph 'END-PROGRAM':
END-PROGRAM is in margin "A" (COLUMN 8) - Thought to be a paragraph label.
Move it to column 12
Change END-PROGRAM to "END PROGRAM" or "STOP RUN"
Ralph
Last edit: Ralph Linkletter 2024-01-18
None of this works sadly.
END PROGRAM - same error
STOP RUN - same error
END PROGRAM column 12 - same error
STOP RUN column 12 - same error
(NO END PROGRAM OR STOP RUN) - same error
Suggestions, in my opinion, useful for those who are learning COBOL.
use the END PROGRAM statement only if you write nested programs. In other cases like this it serves no purpose and is a source of potential errors.
write programs with the new >>SOURCE FREE format (like all other languages C, Java, Python ... and for available large screens), do not use the old format >>SOURCE FIXED (only for COBOL and for old 80 cols green screens). This way programs are more compact and readable with fewer lines and less need to go to new line for same statement. A singke statement / verb should all be on the same line. The indentations are clearer. There is less risk of errors due to the constraints of the fixed format.
see attached a sample of your last statements ...
Last edit: Eugenio Di Lorenzo 2024-01-18
Sadly I get the same error with or without END PROGRAM in any column (see previous reply)
I would like to use the SOURCE FREE format, however, when I try to compile, it complains about comments in column 7. In the source code and copybooks.
Should I write a script that converts comments starting in column 7 into *> ? Does that syntax work anywhere in a line?
perhaps the file you are using has some incorrect characters at the end of the file.
my suggestion to use free format was related to writing new programs.
if you already have fixed format programs then forget it.
if you really want to try, keep in mind that there are already utilities written by someone in cobol that allow you to modify the format of cobol sources.
I've never used them. There are several posts that deal with this topic. I think they are in the "contributions" folder.
see also at : https://sourceforge.net/p/gnucobol/discussion/contrib/thread/e8f43ee517/
the syntax of
*>
says it can be placed anywhere in a line of code. from column 1 onwards (up to column 256 I think).it can also be positioned to the right of a statement.
eg
MOVE A TOB *> this is a comment
Last edit: Eugenio Di Lorenzo 2024-01-18
Converting all * to *> did allow me to compile everything with the FREE format which is pretty nice! Thank you for the syntax help :)
On 18/01/2024 17:02, Michael Smith wrote:
Now you can continue beyond cc 72. I have done this to 40+ programs
written as FIXED to save a bit of time before converting to FREE.
For FREE using a good editor such as kate use in replace mode for " "
without the quotes to " >" one by one if you have asterisk any where
else and/or using *> already as a floating comment.
Remove the / or replace for *>
IN the block of comments starting with * only replace on the FIRST
ocurrence i.e.,
* * comment **
* more text including *
for *> * comment **
etc
For a perform that is used in only one place use an inline perform with
places you want to quit with
EXIT PERFORM
or if terminating that cycle use EXIT PERFORM CYCLE
This does depend on how complex the perform para's are though.but it
does save on using GO TO;s.
No, if you have fixed-form reference-format ted code, then stay with this.
If you write me one out of a good idea to start your comments in col. 7 with > this way, it will possibly additional* compile in free-form.
... for the other thing (the error) I'll have a look at this next week, including if the compiler should accept an empty paragraph at the end - I think it should.
Can you supply a copy of the program source with ALL copy books included and make it available here so we can try and compile it ?
and YES must have the copy books or you can also include them as the five? separate files.
Small point you are using DS and you are performing and goto paras outside the DS and that is a nono at least in my experience of using them but I must admit I try to avoid the use of it.
Ha- this is it! I commented out the DS lines of code and it compiles!! Thank you!
Now I must ask - I am a COBOL newbie so is there anything I can do to move this section of code somewhere else to avoid this type of error?
If you use the Declaratives you must only have any perform, goto code
with that block.
For more information read the GnuCobol Programmers Guide.
For more look at some of the programs supplied in the Contrib area under
the SVN tag at sourceforge/p/gnucobol
and grab my nightly builds of ACAS which includes the OE (Order Entry)
sub system which makes a lot of use of Declaratives, possibly too much
but it was written by another in late 79 - 80 which I have been
migrating it over to the GnuCobol compiler from RM v1.4 or so.
This is still in a test / bug fix / coding mode or has been for almost 2
months so I am taking a wee rest from it to work on testing and
documentation of ACAS which is over due :(
In that archive you will see one of the folders as OE with w folders src
and one within copybooks
the later must be set up for compiling by using command (and I have a
Linux script for doing this called comp-oe.sh .
Before I forget the compile process does not generate prn files (Print)
as that line is remarked out but you could swap them around to do so.
The other script supplied is comp-oe-diags.sh which is similar, does
produce print files but also include full diagnostics such as runtime
checks and full tracing of the code.
For new systems and while testing I find this very useful to discover
any hiding bugs and mismatched linkage sections and more such as doing
numeric processing on non-numeric data, etc.
In there is :
export
COBCPY=/home/vince/cobolsrc/oe/src/copybook:/home/vince/cobolsrc/ACAS/copybooks
This concatenates two folders for the copy libraries for both OE and
ACAS although the needed copybooks should be in src/copybook as far as I
know, but I still use the above export - JIC (Just in case I missed any).
The script comp-oe.sh build all of the Cobol programs and the C routine
ACCEPT_NUMERIC which is used in some of the OE programs to accept a
number field storing it into a COMP-£ type field. Without this getting
edited number fields is a pain.
This is NEW code written by Chuck for us all to test and OE is the
primary system being used to do so..
So far it has worked a treat but I only use it in Update mode having any
virgin data field preset to zeroes.
Here see the programs used within Billing as this is where almost of of
it is currently used.
Warning OE documentation consists of only ONE document and that is the
original System Specifications and here some of the Screen and reporting
layouts have been changed.
It is another job that will need to be done - creating an OR manual even
if it is a simple one :)
To get the nightly builds go to :
http://www.applewood.linkpc.net/files/acas/nightlybuilds/
There is separate archives for both ACAS and OE and even one for some
test data that I have been using for ACAS although not complete as some
testing is done in another folder and subject to change depending on
what is being tested and at what level..
Yes, I was a professional Test lead and manager as well as a Programmer,
Operator (mainframes), IT Manager and Director to name a few of my past
titles as well as gopher :)
Have fun,
Vincent
On 18/01/2024 18:39, Michael Smith wrote:
DS = Declarative section