Thread: COBOL

What does VALUE mean on a data item?

Started by Sam • user2 replies176 viewsLast activity 2 weeks ago
Post #1
0 votes
Sam
Reputation
5
Posts: 28
Joined: Jul 1, 2026, 2:30 PM
Posted: Aug 1, 2026, 8:25 AM

01 WS-FLAG PIC X VALUE 'N'.

Is VALUE just the starting value when the program begins? Does it reset every PERFORM?

Post #2
1 votes
Marty
Reputation
412
Posts: 58
Joined: Aug 12, 2024, 9:14 AM
Posted: Aug 1, 2026, 10:25 AM

VALUE sets the initial value at program start (WORKING-STORAGE). It does not reapply each PERFORM.

If you need it reset, MOVE the value again yourself, or use INITIALIZE carefully.

You must be signed in to reply to this thread