Page 1 of 1

variable declaration in COBOL

PostPosted: Thu Mar 25, 2010 10:51 am
by Nireesha234
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
MOVE WS-PLAN-NO"N" TO WS-TEMP
...
...

Can anyone help me with this?

Re: variable declaration in COBOL

PostPosted: Thu Mar 25, 2010 5:23 pm
by Robert Sample
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.

Re: variable declaration in COBOL

PostPosted: Fri Mar 26, 2010 1:05 am
by dick scherrer
Hello,

Here is a link to the Enterprise COBOL Language Reference:
http://publibz.boulder.ibm.com/cgi-bin/ ... 0/CONTENTS

And the Programming Guide:
http://publibz.boulder.ibm.com/cgi-bin/ ... 0/CONTENTS

Suggest you bookmark and download these manuals. . .