View previous topic :: View next topic
|
Author |
Message |
roshansawant Warnings : 1 New User
Joined: 06 Nov 2006 Posts: 10
|
|
|
|
Hi Guys,
Q) I have a dataset
//sysin DD DSN=ABC.DEF,Disp=Shr
How can i acess this data through cobol?
Means what will be the syntax to accept that data which is there in sysin DD Dsn=ABC.DEF... |
|
Back to top |
|
|
surya_pathaus
Active User
Joined: 28 Aug 2006 Posts: 110
|
|
|
|
Hi,
You have to use ACCEPT in cobol.
ACCEPT variable-name from sysin.
Variable-name length should be dataset length * no. of records. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
HI
You can use the ACCEPT verb in cobol to pass data from the dataset to to your program.
Thanks
Arun |
|
Back to top |
|
|
sihanature Warnings : 1 New User
Joined: 01 Sep 2005 Posts: 33
|
|
|
|
Hi
Yes, It's gind of 'Parameter Passing' to the source program.
In oder to access the In-Stream data or Data from In_Stream dataset's
we need to use the verb 'ACCEPT' in Correposding COBOL Program.
Thanks. |
|
Back to top |
|
|
madhumr Warnings : 1 New User
Joined: 18 Oct 2006 Posts: 7 Location: bangalore
|
|
|
|
hi
can anybody show how to code it in the cobol program |
|
Back to top |
|
|
surya_pathaus
Active User
Joined: 28 Aug 2006 Posts: 110
|
|
|
|
Hi,
Already I have given in my previous post.
ACCEPT ws-variable FROM SYSIN.
Where WS-VARIABLE length should be dataset length * no. of records. |
|
Back to top |
|
|
madhumr Warnings : 1 New User
Joined: 18 Oct 2006 Posts: 7 Location: bangalore
|
|
|
|
HI
ACCEPT WS-VAR1 FROM SYSIN
this is the syntax for that |
|
Back to top |
|
|
jasorn Warnings : 1 Active User
Joined: 12 Jul 2006 Posts: 191 Location: USA
|
|
|
|
You can also use 'DATA'. Check JCL reference for DD DATA |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If your instream data is one record you could use accept.
Given that you have data in a dataset
Code: |
//sysin DD DSN=ABC.DEF,Disp=Shr
|
you could also put in a SELECT myfile ASSIGN TO UT-D-SYSIN, an FD, and read through the data as though it was any other sequential file.
If the number of sysin parm records changes, you will not want to use accept.
Something that may or may not be a concern for you is that many sites do not allow either accept or display in production programs. |
|
Back to top |
|
|
|