Mainframes 360
The one stop destination for System Z professionals

Saturday, August 15, 2009



  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.

To many people who are thrown to work at a mainframe computer on their first job, they feel lost. Mainframe people seem to speak a completely different language and that doesn't make life easy. What's more, the books and manuals are incredibly hard to comprehend.

"What on earth is a Mainframe?" is an absolute beginner's guide to mainframe computers. We'll introduce you to the hardware and peripherals. We'll talk about the operating system, the software installed on a mainframe. We'll also talk about the different people who work on a mainframe. In a nutshell, we'll de-mystify the mainframe.

Readers based in India, can buy the e-book for Rs. 50 only or the print book. International readers based in the US and other countries can click here to purchase the e-book.