10.07.2015 Views

Enterprise COBOL for z/OS V4.2 Programming Guide

Enterprise COBOL for z/OS V4.2 Programming Guide

Enterprise COBOL for z/OS V4.2 Programming Guide

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Recursive callsValue <strong>for</strong> num inLOCAL-STORAGEValue <strong>for</strong> numb inWORKING-STORAGEValue <strong>for</strong> fact inWORKING-STORAGE4 1 1 05 0 0 0GobacksValue <strong>for</strong> num inLOCAL-STORAGEValue <strong>for</strong> numb inWORKING-STORAGEValue <strong>for</strong> fact inWORKING-STORAGE5 0 0 14 1 0 13 2 0 22 3 0 61 4 0 24Main 5 0 120RELATED CONCEPTS“Comparison of WORKING-STORAGE and LOCAL-STORAGE” on page 16Using data from another programHow you share data depends on the type of program. You share data differently inprograms that are separately compiled than you do <strong>for</strong> programs that are nested or<strong>for</strong> programs that are recursive or multithreaded.RELATED TASKS“Sharing data in separately compiled programs”“Sharing data in nested programs”“Sharing data in recursive or multithreaded programs” on page 19“Passing data” on page 465Sharing data in separately compiled programsMany applications consist of separately compiled programs that call and pass datato one another. Use the LINKAGE SECTION in the called program to describe the datapassed from another program.In the calling program, use a CALL . . . USING or INVOKE . . . USING statementto pass the data.RELATED TASKS“Passing data” on page 465Sharing data in nested programsSome applications consist of nested programs, that is, programs that are containedin other programs. Level-01 data items can include the GLOBAL attribute. Thisattribute allows any nested program that includes the declarations to access thesedata items.18 <strong>Enterprise</strong> <strong>COBOL</strong> <strong>for</strong> z/<strong>OS</strong> <strong>V4.2</strong> <strong>Programming</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!