Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How can i acess Instream Data through cobol

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How can i acess Instream Data through cobol
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    Post subject: Re: interview question on Instream Data
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: 2180
Location: @my desk

PostPosted: Thu Nov 23, 2006 4:34 pm    Post subject:
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    Post subject: Re: interview question on Instream Data
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    Post subject:
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    Post subject: Re: How can i acess Instream Data through cobol
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    Post subject: INSTREAM DATA THROUGH COBOL
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

Active User


Joined: 12 Jul 2006
Posts: 153
Location: USA

PostPosted: Mon Feb 26, 2007 4:02 am    Post subject:
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

Site Director


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

PostPosted: Mon Feb 26, 2007 5:54 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
No new posts COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us