View previous topic :: View next topic
|
Author |
Message |
kiran
New User
Joined: 08 Apr 2004 Posts: 25 Location: hyd
|
|
|
|
Hi pls see the following code,
working-storage section.
01 group.
10 elements pic x(2) occurs 4 times.
77 I pic x(2) value 0.
procedure division.
main-para.
perform para1 until I < 4 times.
para1.
Accept elements(I).
Display elements(I).
I = I + 1.
stop run.
and i'm passing the values from jcl through SYSIN DD * as :
//SYSIN DD *
2
3
4
5
/*
My doubt is whether the Accept elements(I) accepts the elements that are passing from the jcl.
pls clarify the doubt. |
|
Back to top |
|
|
imvs
New User
Joined: 12 May 2004 Posts: 33
|
|
|
|
Kiran
Have you really tested the code.
First it will give you compile errors beacause of
Code: |
perform para1 until I < 4 times. |
.
Second your logic is wrong it should be
Code: |
perform para1 until I > 4 |
Using ACCEPT stmt you can accept sysin(instream) data. |
|
Back to top |
|
|
imvs
New User
Joined: 12 May 2004 Posts: 33
|
|
|
|
Kiran
In cobol subscripts must not contain value as zero. |
|
Back to top |
|
|
|