Monday, December 22, 2008

Call and Link in cobol

What is the difference between Call and Link in COBOL?

To start with the most basic difference. LINK is not a COBOL statement, its a CICS verb. CALL statement is certainly inside the boundaries of COBOL language.

If you still comapre their performance then here is the detailed list of differences. Please keep in mind we will be comparing only Dynamic Call with Link.

Please do provide comments or reactions.

Wednesday, December 10, 2008

What is the difference between NEXT SENTENCE and CONTINUE ?

NEXT SENTENCE gives control to the statement following the next period.

CONTINUE gives control to the next (imperative) verb after the explicit scope terminator. (This is not one of COBOL II's finer implementations). It's safest to use CONTINUE rather than NEXT SENTENCE in COBOL II.

Example :
IF A > C
IF A > B
CONTINUE
ELSE
MOVE WS-A TO WS-B
END-IF
MOVE WS-C TO WS-B
END-IF.
MOVE WS-B TO WS-A

In the above example , once the CONTINUE is executed the control will be transfered to next imperative executable statement ( MOVE WS-C TO WS-B).

Whereas, If we use NEXT SENTENCE instead of CONTINUE then control gets transferred to the statement following the next Period (MOVE WS-B TO WS-A).

Hope this helps.
Please do comment if you have any further questions on this.

Wednesday, December 3, 2008

What is the difference between a COBOL subscript and an index ?

An index is defined with it's associated table using the INDEXED BY phrase. Itis a storage area generated by the compiler. It is a register item that exists outside the program's working storage. It is 4 bytes in length. You can’tdisplay an index. The SET statement sets up and down an index,PERFORM VARYING.

A subscript is a positive integer defined in working-storage. It's best to define it as S9(4) COMP. A subscript is changed using ADD, SUBTRACT, MOVE or PERFORM VARYING like any other numeric working storage variable.

For detailed queries on subscript and index click here.

Please do provide your comments or reactions.

Thursday, November 20, 2008

Difference between static and dynamic call in COBOL

Hi,

Lets start with one of the most common questions for a cobol beginner.

What does static and dynamic call mean in COBOL?
How do we use these calls?
Which call is better Static or dynamic ?

Below is the answer for all your queries :
All about static and dynamic calls in cobol

Please do provide your comments or reactions for this post.

Thanks,
-Kaps