Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 2285
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: 154
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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us