What’s new at MAINFRAMES 360
(Updates May '11)...
- We are a cosmopolitan community of 400 members, from around the globe.
- Working on writing and publishing articles on CICS.
- Special article on "How do I learn Mainframe Programming"

Saturday, August 15, 2009

WORKING-STORAGE SECTION, Rough-work areas in COBOL


Contents

  1. WORKING-STORAGE SECTION 
  2. Simple COBOL Program to declare and use WORKING STORAGE Areas 



Q. Could you throw some light on the WORKING-STORAGE SECTION of a COBOL Program?

The WORKING-STORAGE SECTION is used to declare any fields or records that are not going to be used in input files, or output files, but they are used to store the intermediate results of processing in a temporary storage area. WORKING STORAGE SECTION will always follow the FILE SECTION. Here too, we can describe the records in the same as we do in the FILE SECTION.
WORKING-STORAGE SECTION can contain group-items and elementary data-items also, just like the FILE SECTION Paragraph. An initial value may also be assigned to the data-items by using the VALUE Clause.

The storage for WORKING-STORAGE items is allocated, when you start running the COBOL Program.

Given below is a simple program that stores some data in Working Storage Variables, and then displays them on the Spool Output SYSOUT Dataset.


Upon running the above COBOL Program, we get the following output in the SYSOUT Dataset.

Related Posts Plugin for WordPress, Blogger...

Note :

Protected by Copyscape Online Copyright Protection
© Copyright – Quasar Chunawalla, 2010.
Note : The copyrights of all the material, text and pictures posted in this website belong to the author. Any instance of lifting the material from this website, shall be considered as an act of plagiarism. For any clarifications, please drop me a line at
 
back to top