variable declaration in COBOL

Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

variable declaration in COBOL

Postby Nireesha234 » Thu Mar 25, 2010 10:51 am

I've variables WS-PLAN-NO1, WS-PLAN-NO2, WS-PLAN-NO3, WS-PLAN-NO4.......till WS-PLAN-NO150.
In the program I will be having just one loop and the last byte will be automatically incremented.
I'm not sure how to do it in program.

My program will look like this:

Perform till EOF
Move spaces to WS-TEMP
Add 1 to N

Can anyone help me with this?
Posts: 10
Joined: Tue Mar 23, 2010 11:25 am
Has thanked: 0 time
Been thanked: 0 time

Re: variable declaration in COBOL

Postby Robert Sample » Thu Mar 25, 2010 5:23 pm

Use an array. Find the COBOL Language Reference and Programming Guide manuals and read up on arrays. What you are proposing to do cannot be done in COBOL as you've written it.
Robert Sample
Global moderator
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: variable declaration in COBOL

Postby dick scherrer » Fri Mar 26, 2010 1:05 am


Here is a link to the Enterprise COBOL Language Reference: ... 0/CONTENTS

And the Programming Guide: ... 0/CONTENTS

Suggest you bookmark and download these manuals. . .
Hope this helps,
User avatar
dick scherrer
Global moderator
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Return to IBM Cobol


  • Related topics
    Last post