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 to get SYSIN data into COBOL program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
tushar_study

New User


Joined: 01 Feb 2007
Posts: 30
Location: Mumbai

PostPosted: Tue Mar 04, 2008 10:59 pm    Post subject: How to get SYSIN data into COBOL program
Reply with quote

I have a scenario wherein I am required to read records from a SYSIN
file. The SYSIN file can have variable number of records. In my cobol
program I need to read these records and load them into a cobol table and do further processing.

How to read the SYSIN file in my cobol. (I can use ACCEPT verb in my cobol but what will be the terminating condition of the PERFORM i.e. how do I know that the End of SYSIN file has been reached).

I will be using an OCCURS ...DEPENDING ON clause in my COBOL.

Regards
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: Tue Mar 04, 2008 11:09 pm    Post subject:
Reply with quote

Hello,

Your process will work better if you use a SELECT, an FD, etc rather than ACCEPT. Many systems will not allow ACCEPT from SYSIN n production programs.

If you use an FD, eof of file is not an issue.
Back to top
View user's profile Send private message
tushar_study

New User


Joined: 01 Feb 2007
Posts: 30
Location: Mumbai

PostPosted: Tue Mar 04, 2008 11:16 pm    Post subject: Reply to: How to get SYSIN data into COBOL program
Reply with quote

I have been asked specifically to use a SYSIN card.

Regards
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Tue Mar 04, 2008 11:27 pm    Post subject: Reply to: How to get SYSIN data into COBOL program
Reply with quote

I believe that you have to control the end-of-data by creating your own delimiter. ACCEPT until you read the delimiter.

See this previous topic.
Back to top
View user's profile Send private message
tushar_study

New User


Joined: 01 Feb 2007
Posts: 30
Location: Mumbai

PostPosted: Tue Mar 04, 2008 11:47 pm    Post subject: Reply to: How to get SYSIN data into COBOL program
Reply with quote

Thanks Superk and the entire forum.



Regards,
Tushar
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: Wed Mar 05, 2008 1:43 am    Post subject:
Reply with quote

Hello,

Quote:
I have been asked specifically to use a SYSIN card.
Yes, and if you use an FD and assign the ddname to SYSIN, you will meet that requirement and not use the (at best) questionable process of trying to ACCEPT the input data and creating your own logical end-of-file value..

If you look at the topic referred to, you will also see the SELECT/FD alternative recommended there.

FWIW.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Mar 05, 2008 3:08 am    Post subject:
Reply with quote

dick scherrer wrote:
Quote:
I have been asked specifically to use a SYSIN card.
Yes, and if you use an FD and assign the ddname to SYSIN you will meet that requirement
Yes in my shop as well ACCEPT is not permitted. Talk to Your peers once.
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 Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm


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