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...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

To receive a parameter that was passed by value, code the division header <strong>for</strong> aprogram as follows:PROCEDURE DIVISION USING BY VALUE datanameTo return a value as a result, code the division header as follows:PROCEDURE DIVISION RETURNING dataname2You can also combine USING and RETURNING in a PROCEDURE DIVISION header:PROCEDURE DIVISION USING dataname RETURNING dataname2Be sure to define dataname and dataname2 in the LINKAGE SECTION.RELATED CONCEPTS“How logic is divided in the PROCEDURE DIVISION”RELATED TASKS“Eliminating repetitive coding” on page 679RELATED REFERENCESThe procedure division header (<strong>Enterprise</strong> <strong>COBOL</strong> Language Reference)The USING phrase (<strong>Enterprise</strong> <strong>COBOL</strong> Language Reference)CALL statement (<strong>Enterprise</strong> <strong>COBOL</strong> Language Reference)How logic is divided in the PROCEDURE DIVISIONThe PROCEDURE DIVISION of a program is divided into sections and paragraphs,which contain sentences, statements, and phrases.SectionLogical subdivision of your processing logic.A section has a section header and is optionally followed by one or moreparagraphs.A section can be the subject of a PERFORM statement. One type of section is<strong>for</strong> declaratives.ParagraphSubdivision of a section, procedure, or program.A paragraph has a name followed by a period and zero or more sentences.A paragraph can be the subject of a statement.SentenceSeries of one or more <strong>COBOL</strong> statements that ends with a period.StatementPer<strong>for</strong>ms a defined step of <strong>COBOL</strong> processing, such as adding twonumbers.A statement is a valid combination of words, and begins with a <strong>COBOL</strong>verb. Statements are imperative (indicating unconditional action),conditional, or compiler-directing. Using explicit scope terminators insteadof periods to show the logical end of a statement is preferred.PhraseA subdivision of a statement.RELATED CONCEPTS“Compiler-directing statements” on page 2220 <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!