IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Accept an array from SYSIN DD *


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kiran

New User


Joined: 08 Apr 2004
Posts: 25
Location: hyd

PostPosted: Fri May 14, 2004 3:27 pm
Reply with quote

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
View user's profile Send private message
imvs

New User


Joined: 12 May 2004
Posts: 33

PostPosted: Fri May 14, 2004 10:26 pm
Reply with quote

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
View user's profile Send private message
imvs

New User


Joined: 12 May 2004
Posts: 33

PostPosted: Fri May 14, 2004 10:28 pm
Reply with quote

Kiran
In cobol subscripts must not contain value as zero.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts COBOL Ascending and descending sort n... COBOL Programming 5
No new posts Generate output lines (SYSIN card for... DFSORT/ICETOOL 4
No new posts To find an array of words (sys-symbol... JCL & VSAM 9
No new posts How to move values from single dimens... COBOL Programming 1
No new posts array indexing PL/I & Assembler 4
Search our Forums:

Back to Top