MainframeMaster
MainframeMaster

COBOL Tutorial

Progress0 of 0 lessons

COBOL WORKING-STORAGE SECTION

The WORKING-STORAGE SECTION is one of the most important sections in the COBOL DATA DIVISION. It's where you define all the internal variables, constants, work areas, and data structures that your program needs for processing. Understanding WORKING-STORAGE is fundamental to writing effective COBOL programs, as it's where you'll spend much of your time defining the data your program will work with.

In this comprehensive guide, you'll learn everything about WORKING-STORAGE SECTION: how to define data items, initialize them with values, organize them into groups, use condition names for readable code, and follow best practices that make your programs maintainable and professional. Whether you're a beginner learning COBOL or an experienced programmer looking to refine your skills, this guide will help you master WORKING-STORAGE.

What is WORKING-STORAGE SECTION?

The WORKING-STORAGE SECTION is a section within the DATA DIVISION where you define data items that are used internally by your program. These data items are:

  • Private to the program: They belong to this program only and cannot be accessed by other programs. This provides encapsulation and data protection.
  • Persistent during execution: They exist for the entire duration of program execution, from when the program starts until it ends. Values are retained between different procedure calls.
  • Initialized at startup: You can specify initial values using the VALUE clause, which are set when the program begins execution.
  • Used for processing: They hold variables, constants, flags, counters, accumulators, work areas, calculation results, and any other data needed for program logic.

WORKING-STORAGE is different from other DATA DIVISION sections:

  • FILE SECTION: Contains file record definitions - data structures that describe the format of records in files your program reads or writes.
  • LINKAGE SECTION: Contains parameter definitions - data items that are passed to or from other programs. These reference storage in the calling program, not storage in this program.
  • LOCAL-STORAGE SECTION: Similar to WORKING-STORAGE but automatically reinitialized each time the program is entered (useful for called programs).

Basic WORKING-STORAGE Syntax

The WORKING-STORAGE SECTION appears in the DATA DIVISION, typically after the FILE SECTION (if present) and before the LINKAGE SECTION (if present):

cobol
1
2
3
4
5
6
7
8
9
10
11
DATA DIVISION. FILE SECTION. *> File definitions go here (if any) WORKING-STORAGE SECTION. *> Your internal variables, constants, and work areas go here 01 data-item-name PIC data-type. 01 another-item PIC data-type VALUE initial-value. LINKAGE SECTION. *> Parameters go here (if this is a called program)

Data items in WORKING-STORAGE are defined using level numbers and PIC (Picture) clauses:

  • Level numbers: 01 for independent items or the top level of groups. 05, 10, 15, etc. for items within groups.
  • Data item name: A name you choose that describes what the data represents. Common prefixes include WS- (working storage), C- (constants), or descriptive names.
  • PIC clause: Defines the data type and size. Examples: PIC 9(5) for a 5-digit number, PIC X(30) for 30 characters of text, PIC 9(7)V99 for a decimal number.
  • VALUE clause (optional): Sets the initial value when the program starts.

Simple Data Items

Let's start with simple, individual data items. These are the building blocks of WORKING-STORAGE:

cobol
1
2
3
4
5
6
7
8
9
10
11
12
13
WORKING-STORAGE SECTION. *> Numeric variables 01 WS-RECORD-COUNT PIC 9(5) VALUE 0. 01 WS-TOTAL-AMOUNT PIC 9(9)V99 VALUE 0. 01 WS-AVERAGE PIC 9(7)V99. *> Text variables 01 WS-CUSTOMER-NAME PIC X(30). 01 WS-ERROR-MESSAGE PIC X(100). *> Single character flags 01 WS-EOF-FLAG PIC X VALUE 'N'. 01 WS-VALID-FLAG PIC X VALUE 'Y'.

In these examples:

  • WS-RECORD-COUNT: A 5-digit number initialized to zero. The WS- prefix indicates it's a working storage item.
  • WS-TOTAL-AMOUNT: A decimal number that can hold up to 9 digits before the decimal point and 2 after, initialized to zero.
  • WS-CUSTOMER-NAME: A text field that can hold up to 30 characters. No VALUE clause means it starts with undefined content (typically spaces or garbage).
  • WS-EOF-FLAG: A single character flag initialized to 'N' (No, not end of file).

Initializing Data with VALUE

The VALUE clause sets the initial value of a data item when the program starts. This is crucial for ensuring variables start with known, predictable values:

cobol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
WORKING-STORAGE SECTION. *> Initialize with numeric literals 01 WS-COUNTER PIC 9(5) VALUE 0. 01 WS-MAX-RECORDS PIC 9(5) VALUE 10000. 01 WS-TAX-RATE PIC V999 VALUE .08. *> Initialize with text literals 01 WS-COMPANY-NAME PIC X(20) VALUE 'ACME CORPORATION'. 01 WS-DEFAULT-STATUS PIC X(1) VALUE 'A'. *> Initialize with figurative constants 01 WS-BUFFER PIC X(100) VALUE SPACES. 01 WS-ACCUMULATOR PIC 9(9) VALUE ZERO. 01 WS-HIGH-VALUE PIC X(10) VALUE HIGH-VALUES. 01 WS-LOW-VALUE PIC X(10) VALUE LOW-VALUES. *> Initialize with other data items (must be same type/size) 01 WS-SOURCE PIC X(30) VALUE 'INITIAL VALUE'. 01 WS-COPY PIC X(30) VALUE WS-SOURCE.

Important points about VALUE initialization:

  • Numeric literals: Use numbers like 0, 10000, or .08. For decimals, use V in the PIC clause (like PIC V999 for .08).
  • Text literals: Use quoted strings like 'ACME CORPORATION'. The literal must fit within the field size.
  • Figurative constants: SPACES (blanks), ZERO (numeric zero), HIGH-VALUES (highest possible value), LOW-VALUES (lowest possible value), QUOTES (quote character), and others.
  • Initialization happens once: At program startup, not each time a procedure is called.
  • If no VALUE: The data item starts with undefined content. Always initialize important variables to avoid unpredictable behavior.

Group Items

Group items allow you to organize related data together into structures. They're defined using hierarchical level numbers:

cobol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
WORKING-STORAGE SECTION. *> Simple group item 01 WS-DATE-FIELDS. 05 WS-YEAR PIC 9(4). 05 WS-MONTH PIC 9(2). 05 WS-DAY PIC 9(2). *> Group with initialization 01 WS-CONSTANTS. 05 C-MAX-RECORDS PIC 9(5) VALUE 10000. 05 C-TAX-RATE PIC V999 VALUE .08. 05 C-COMPANY-NAME PIC X(20) VALUE 'ACME CORP'. *> Nested group items 01 WS-CUSTOMER-DATA. 05 WS-CUSTOMER-ID PIC 9(8). 05 WS-CUSTOMER-NAME PIC X(50). 05 WS-CUSTOMER-ADDRESS. 10 WS-STREET PIC X(50). 10 WS-CITY PIC X(30). 10 WS-STATE PIC X(2). 10 WS-ZIP-CODE PIC X(10). 05 WS-CUSTOMER-BALANCE PIC S9(9)V99.

Key points about group items:

  • Level hierarchy: 01 is the top level (the group), 05/10/15/etc. are items within the group. You can nest groups (a group within a group).
  • Accessing fields: You can reference the entire group (WS-CUSTOMER-DATA) or individual fields (WS-CUSTOMER-ID, WS-STREET).
  • Organization: Group related items together logically. This makes code more readable and maintainable.
  • Initialization: You can initialize individual fields within a group, or initialize the entire group as a unit.

Using Group Items

Here's how you use group items in your program:

cobol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
WORKING-STORAGE SECTION. 01 WS-DATE-INFO. 05 WS-YEAR PIC 9(4) VALUE 2024. 05 WS-MONTH PIC 9(2) VALUE 12. 05 WS-DAY PIC 9(2) VALUE 25. PROCEDURE DIVISION. MAIN-LOGIC. *> Access individual fields DISPLAY 'Year: ' WS-YEAR DISPLAY 'Month: ' WS-MONTH DISPLAY 'Day: ' WS-DAY *> You can also reference the entire group *> (useful for moving entire structures) MOVE WS-DATE-INFO TO some-other-date-structure *> Modify individual fields ADD 1 TO WS-DAY IF WS-DAY > 31 MOVE 1 TO WS-DAY ADD 1 TO WS-MONTH END-IF STOP RUN.

Condition Names (88-Level Items)

Condition names are special data items (level 88) that create meaningful names for specific values. They make your code much more readable by allowing you to test conditions using descriptive names instead of comparing to literal values:

cobol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
WORKING-STORAGE SECTION. *> Flag with condition names 01 WS-EOF-FLAG PIC X VALUE 'N'. 88 END-OF-FILE VALUE 'Y'. 88 NOT-END-OF-FILE VALUE 'N'. *> Status with condition names 01 WS-PROCESSING-STATUS PIC X VALUE 'A'. 88 STATUS-ACTIVE VALUE 'A'. 88 STATUS-PENDING VALUE 'B'. 88 STATUS-COMPLETE VALUE 'C'. 88 STATUS-ERROR VALUE 'E'. *> Numeric condition names 01 WS-RETURN-CODE PIC 9(2) VALUE 0. 88 SUCCESS VALUE 00. 88 ERROR-INVALID VALUE 01. 88 ERROR-SYSTEM VALUE 99. PROCEDURE DIVISION. MAIN-LOGIC. *> Instead of: IF WS-EOF-FLAG = 'Y' IF END-OF-FILE DISPLAY 'Reached end of file' END-IF *> Instead of: IF WS-PROCESSING-STATUS = 'A' IF STATUS-ACTIVE PERFORM PROCESS-RECORD END-IF *> Instead of: IF WS-RETURN-CODE = 0 IF SUCCESS DISPLAY 'Operation successful' ELSE DISPLAY 'Operation failed' END-IF STOP RUN.

Benefits of condition names:

  • Readability: "IF END-OF-FILE" is much clearer than "IF WS-EOF-FLAG = 'Y'"
  • Maintainability: If you need to change the value, you only change it in one place (the condition name definition)
  • Self-documenting: The condition name explains what the test means
  • Multiple values: You can define multiple condition names for the same field, representing different possible values

Organizing WORKING-STORAGE

Good organization makes your WORKING-STORAGE section readable and maintainable. Here's a recommended organization pattern:

cobol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
WORKING-STORAGE SECTION. *> ======================================== *> CONSTANTS - Values that don't change *> ======================================== 01 WS-CONSTANTS. 05 C-MAX-RECORDS PIC 9(5) VALUE 10000. 05 C-TAX-RATE PIC V999 VALUE .08. 05 C-COMPANY-NAME PIC X(20) VALUE 'ACME CORP'. 05 C-DEFAULT-STATUS PIC X(1) VALUE 'A'. *> ======================================== *> COUNTERS - Accumulating values *> ======================================== 01 WS-COUNTERS. 05 WS-RECORD-COUNT PIC 9(6) VALUE 0. 05 WS-ERROR-COUNT PIC 9(4) VALUE 0. 05 WS-VALID-COUNT PIC 9(6) VALUE 0. 05 WS-TOTAL-RECORDS PIC 9(8) VALUE 0. *> ======================================== *> FLAGS - Control flow indicators *> ======================================== 01 WS-FLAGS. 05 WS-EOF-FLAG PIC X VALUE 'N'. 88 END-OF-FILE VALUE 'Y'. 88 NOT-END-OF-FILE VALUE 'N'. 05 WS-VALID-FLAG PIC X VALUE 'Y'. 88 VALID-RECORD VALUE 'Y'. 88 INVALID-RECORD VALUE 'N'. 05 WS-PROCESSING-FLAG PIC X VALUE 'A'. 88 PROCESSING-ACTIVE VALUE 'A'. 88 PROCESSING-COMPLETE VALUE 'C'. *> ======================================== *> ACCUMULATORS - Running totals *> ======================================== 01 WS-ACCUMULATORS. 05 WS-TOTAL-AMOUNT PIC S9(9)V99 VALUE 0. 05 WS-TOTAL-QUANTITY PIC 9(8) VALUE 0. 05 WS-AVERAGE-AMOUNT PIC 9(7)V99. *> ======================================== *> WORK AREAS - Temporary storage *> ======================================== 01 WS-WORK-AREAS. 05 WS-TEMP-AMOUNT PIC S9(9)V99. 05 WS-TEMP-NAME PIC X(50). 05 WS-CALC-RESULT PIC 9(9)V99. *> ======================================== *> FORMATTED OUTPUT AREAS *> ======================================== 01 WS-OUTPUT-AREAS. 05 WS-FORMATTED-DATE PIC X(10). 05 WS-FORMATTED-AMOUNT PIC X(15). 05 WS-REPORT-LINE PIC X(132).

This organization pattern:

  • Groups related items: Constants together, counters together, flags together, etc.
  • Uses clear prefixes: C- for constants, WS- for working storage items
  • Includes comments: Section headers make it easy to find what you need
  • Follows a logical order: Constants first (they're referenced often), then counters, flags, accumulators, work areas, and output areas

Complete Example: Customer Processing Program

Let's see a complete example that demonstrates WORKING-STORAGE in a realistic program:

cobol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
IDENTIFICATION DIVISION. PROGRAM-ID. CUSTOMER-PROCESSOR. *> Example program demonstrating WORKING-STORAGE usage DATA DIVISION. FILE SECTION. *> File definitions would go here WORKING-STORAGE SECTION. *> ======================================== *> PROGRAM CONSTANTS *> ======================================== 01 WS-CONSTANTS. 05 C-MAX-CUSTOMERS PIC 9(5) VALUE 50000. 05 C-TAX-RATE PIC V999 VALUE .0825. 05 C-COMPANY-NAME PIC X(30) VALUE 'ACME CORPORATION'. 05 C-DEFAULT-STATUS PIC X(1) VALUE 'A'. 88 STATUS-ACTIVE VALUE 'A'. 88 STATUS-INACTIVE VALUE 'I'. *> ======================================== *> PROCESSING COUNTERS *> ======================================== 01 WS-COUNTERS. 05 WS-CUSTOMER-COUNT PIC 9(6) VALUE 0. 05 WS-PROCESSED-COUNT PIC 9(6) VALUE 0. 05 WS-ERROR-COUNT PIC 9(4) VALUE 0. 05 WS-VALID-COUNT PIC 9(6) VALUE 0. *> ======================================== *> CONTROL FLAGS *> ======================================== 01 WS-FLAGS. 05 WS-EOF-FLAG PIC X VALUE 'N'. 88 END-OF-FILE VALUE 'Y'. 88 NOT-END-OF-FILE VALUE 'N'. 05 WS-VALID-FLAG PIC X VALUE 'Y'. 88 VALID-RECORD VALUE 'Y'. 88 INVALID-RECORD VALUE 'N'. 05 WS-PROCESSING-FLAG PIC X VALUE 'A'. 88 PROCESSING-ACTIVE VALUE 'A'. 88 PROCESSING-COMPLETE VALUE 'C'. 88 PROCESSING-ERROR VALUE 'E'. *> ======================================== *> ACCUMULATORS *> ======================================== 01 WS-ACCUMULATORS. 05 WS-TOTAL-BALANCE PIC S9(9)V99 VALUE 0. 05 WS-TOTAL-INTEREST PIC S9(9)V99 VALUE 0. 05 WS-AVERAGE-BALANCE PIC 9(7)V99. *> ======================================== *> CURRENT RECORD DATA *> ======================================== 01 WS-CURRENT-CUSTOMER. 05 WS-CUSTOMER-ID PIC 9(8). 05 WS-CUSTOMER-NAME PIC X(50). 05 WS-CUSTOMER-BALANCE PIC S9(9)V99. 05 WS-CUSTOMER-STATUS PIC X(1). 88 CUSTOMER-ACTIVE VALUE 'A'. 88 CUSTOMER-INACTIVE VALUE 'I'. *> ======================================== *> WORK AREAS *> ======================================== 01 WS-WORK-AREAS. 05 WS-CALC-AMOUNT PIC S9(9)V99. 05 WS-CALC-INTEREST PIC S9(9)V99. 05 WS-TEMP-NAME PIC X(50). *> ======================================== *> FORMATTED OUTPUT *> ======================================== 01 WS-OUTPUT-AREAS. 05 WS-FORMATTED-BALANCE PIC X(15). 05 WS-FORMATTED-DATE PIC X(10). 05 WS-REPORT-LINE PIC X(132). 05 WS-ERROR-MESSAGE PIC X(100). PROCEDURE DIVISION. MAIN-LOGIC. DISPLAY 'Starting customer processing' DISPLAY 'Company: ' C-COMPANY-NAME DISPLAY 'Max Customers: ' C-MAX-CUSTOMERS *> Initialize processing SET PROCESSING-ACTIVE TO TRUE SET NOT-END-OF-FILE TO TRUE *> Process customers (simulated) PERFORM UNTIL END-OF-FILE PERFORM READ-CUSTOMER-RECORD IF NOT END-OF-FILE ADD 1 TO WS-CUSTOMER-COUNT PERFORM VALIDATE-CUSTOMER IF VALID-RECORD ADD 1 TO WS-VALID-COUNT PERFORM PROCESS-CUSTOMER ELSE ADD 1 TO WS-ERROR-COUNT PERFORM HANDLE-ERROR END-IF END-IF END-PERFORM *> Display summary PERFORM DISPLAY-SUMMARY SET PROCESSING-COMPLETE TO TRUE STOP RUN. READ-CUSTOMER-RECORD. *> Simulated record read *> In real program, this would READ from a file MOVE 12345678 TO WS-CUSTOMER-ID MOVE 'JOHN SMITH' TO WS-CUSTOMER-NAME MOVE 1000.00 TO WS-CUSTOMER-BALANCE MOVE 'A' TO WS-CUSTOMER-STATUS *> Simulate end of file after some records IF WS-CUSTOMER-COUNT > 5 SET END-OF-FILE TO TRUE END-IF. VALIDATE-CUSTOMER. SET VALID-RECORD TO TRUE IF WS-CUSTOMER-ID = ZERO SET INVALID-RECORD TO TRUE MOVE 'Invalid customer ID' TO WS-ERROR-MESSAGE END-IF IF WS-CUSTOMER-BALANCE < 0 SET INVALID-RECORD TO TRUE MOVE 'Negative balance not allowed' TO WS-ERROR-MESSAGE END-IF. PROCESS-CUSTOMER. *> Add to totals ADD WS-CUSTOMER-BALANCE TO WS-TOTAL-BALANCE *> Calculate interest COMPUTE WS-CALC-INTEREST = WS-CUSTOMER-BALANCE * C-TAX-RATE ADD WS-CALC-INTEREST TO WS-TOTAL-INTEREST ADD 1 TO WS-PROCESSED-COUNT. HANDLE-ERROR. DISPLAY 'Error processing customer: ' WS-CUSTOMER-ID DISPLAY 'Error: ' WS-ERROR-MESSAGE. DISPLAY-SUMMARY. DISPLAY '=== Processing Summary ===' DISPLAY 'Total Customers: ' WS-CUSTOMER-COUNT DISPLAY 'Valid Records: ' WS-VALID-COUNT DISPLAY 'Error Records: ' WS-ERROR-COUNT DISPLAY 'Processed: ' WS-PROCESSED-COUNT DISPLAY 'Total Balance: $' WS-TOTAL-BALANCE DISPLAY 'Total Interest: $' WS-TOTAL-INTEREST IF WS-CUSTOMER-COUNT > 0 COMPUTE WS-AVERAGE-BALANCE = WS-TOTAL-BALANCE / WS-CUSTOMER-COUNT DISPLAY 'Average Balance: $' WS-AVERAGE-BALANCE END-IF.

This example demonstrates:

  • Well-organized WORKING-STORAGE: Constants, counters, flags, accumulators, current data, work areas, and output areas are clearly separated.
  • Proper initialization: All items that need initial values have VALUE clauses.
  • Condition names: Flags use 88-level condition names for readable code.
  • Group items: Related data is organized into logical groups.
  • Realistic usage: Shows how WORKING-STORAGE items are used throughout the program for processing, validation, and output.

Best Practices for WORKING-STORAGE

Follow these best practices to write professional, maintainable WORKING-STORAGE sections:

1. Always Initialize Important Variables

Use VALUE clauses to initialize counters, accumulators, flags, and any variable that needs a known starting value. Uninitialized variables can cause unpredictable behavior and bugs that are hard to find.

2. Use Meaningful Names

Choose names that clearly describe what the data represents. Use consistent prefixes (WS- for working storage, C- for constants) to make the purpose obvious. Avoid abbreviations that aren't clear.

3. Organize Logically

Group related items together. Put constants first, then counters, flags, accumulators, work areas, and output areas. Use comments to mark sections. This makes it easy to find what you need.

4. Use Condition Names for Flags

Instead of testing "IF WS-FLAG = 'Y'", use condition names: "IF SOME-CONDITION". This makes code self-documenting and easier to understand.

5. Size Fields Appropriately

Make fields large enough for expected data but not excessively large. Too small causes truncation; too large wastes memory. Consider maximum expected values when sizing numeric fields.

6. Use Group Items for Related Data

Group related fields together. This makes it easier to move entire structures, improves readability, and shows relationships between data items.

7. Document Complex Structures

Add comments explaining the purpose of complex group items, unusual data formats, or business rules that affect how data is used.

Common Mistakes to Avoid

Understanding common mistakes helps you write better code:

  • Forgetting to initialize: Always initialize counters, accumulators, and flags. Uninitialized variables can contain garbage values.
  • Incorrect field sizes: Make sure fields are large enough. A 5-digit field can't hold a 6-digit number.
  • Poor organization: Don't scatter related items throughout WORKING-STORAGE. Group them together.
  • Unclear names: Avoid names like X1, TEMP, DATA. Use descriptive names that explain purpose.
  • Not using condition names: Condition names make code much more readable. Use them for flags and status fields.

Summary

The WORKING-STORAGE SECTION is where you define all the internal data your COBOL program needs. It's private to your program, persists throughout execution, and can be initialized with known values. By organizing it well, using meaningful names, initializing properly, and leveraging group items and condition names, you create WORKING-STORAGE sections that are professional, maintainable, and easy to understand.

Remember: WORKING-STORAGE is for internal use. Use FILE SECTION for file records, LINKAGE SECTION for parameters, and WORKING-STORAGE for everything else your program needs to do its work. Good WORKING-STORAGE organization is a hallmark of well-written COBOL programs.

Test Your Knowledge

1. What is the primary purpose of WORKING-STORAGE SECTION?

  • To define file records
  • To define parameters from calling programs
  • To define internal program variables and work areas
  • To define screen layouts

2. How do you initialize a data item in WORKING-STORAGE?

  • Using INITIALIZE statement
  • Using the VALUE clause in the data definition
  • Using MOVE statement in PROCEDURE DIVISION
  • Data items are automatically initialized to zero

3. Can other programs access WORKING-STORAGE items?

  • Yes, if they know the program name
  • No, WORKING-STORAGE is private to the program
  • Yes, using special syntax
  • Only if explicitly shared

4. What are condition names (88-level items) used for?

  • To define constants
  • To create meaningful names for specific values
  • To define group items
  • To initialize data

5. How long does data in WORKING-STORAGE persist?

  • Only during the current procedure
  • For the entire program execution
  • Until the next MOVE statement
  • Only until the program is called again

6. What is a group item in WORKING-STORAGE?

  • A collection of programs
  • A data structure containing multiple fields
  • A type of file
  • A procedure name

7. What is the difference between WORKING-STORAGE and LINKAGE SECTION?

  • There is no difference
  • WORKING-STORAGE is private, LINKAGE is for parameters
  • WORKING-STORAGE is for files, LINKAGE is for variables
  • WORKING-STORAGE is temporary, LINKAGE is permanent

8. How should you organize data in WORKING-STORAGE?

  • Alphabetically by name
  • By grouping related items together
  • In order of use
  • Randomly

Related Pages