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

How can i acess Instream Data through cobol


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
roshansawant
Warnings : 1

New User


Joined: 06 Nov 2006
Posts: 10

PostPosted: Thu Nov 23, 2006 4:19 pm
Reply with quote

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

Active User


Joined: 28 Aug 2006
Posts: 110

PostPosted: Thu Nov 23, 2006 4:33 pm
Reply with quote

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

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Nov 23, 2006 4:34 pm
Reply with quote

HI
You can use the ACCEPT verb in cobol to pass data from the dataset to to your program.
Thanks
Arun
Back to top
View user's profile Send private message
sihanature
Warnings : 1

New User


Joined: 01 Sep 2005
Posts: 33

PostPosted: Thu Nov 23, 2006 5:12 pm
Reply with quote

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
View user's profile Send private message
madhumr
Warnings : 1

New User


Joined: 18 Oct 2006
Posts: 7
Location: bangalore

PostPosted: Thu Nov 23, 2006 8:41 pm
Reply with quote

hi

can anybody show how to code it in the cobol program
Back to top
View user's profile Send private message
surya_pathaus

Active User


Joined: 28 Aug 2006
Posts: 110

PostPosted: Fri Nov 24, 2006 10:02 am
Reply with quote

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
View user's profile Send private message
madhumr
Warnings : 1

New User


Joined: 18 Oct 2006
Posts: 7
Location: bangalore

PostPosted: Mon Nov 27, 2006 7:27 am
Reply with quote

HI

ACCEPT WS-VAR1 FROM SYSIN

this is the syntax for that
Back to top
View user's profile Send private message
jasorn
Warnings : 1

Active User


Joined: 12 Jul 2006
Posts: 191
Location: USA

PostPosted: Mon Feb 26, 2007 4:02 am
Reply with quote

You can also use 'DATA'. Check JCL reference for DD DATA
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Feb 26, 2007 5:54 am
Reply with quote

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
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to save SYSLOG as text data via P... All Other Mainframe Topics 1
No new posts Store the data for fixed length COBOL Programming 1
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
Search our Forums:

Back to Top