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
 

 

Reading a sequential file in program with INPUT DD name

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
indraraghav

New User


Joined: 06 Jun 2005
Posts: 4
Location: chennai

PostPosted: Tue Jan 16, 2007 3:47 pm    Post subject: Reading a sequential file in program with INPUT DD name
Reply with quote

Hi,

Can we read a sequential file in the COBOL program without defining the DD name for the file in JCL.
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Jan 16, 2007 4:09 pm    Post subject:
Reply with quote

Something has to point to the dataset, what more specificly is your need?
Back to top
View user's profile Send private message
indraraghav

New User


Joined: 06 Jun 2005
Posts: 4
Location: chennai

PostPosted: Tue Jan 16, 2007 4:16 pm    Post subject: Re: Reading a sequential file in program with INPUT DD name
Reply with quote

Yes, Bill.

But for the below condition, I think, it error out with 'FILE NOT FOUND'. Please let me know ur views.

1. Program tries to open the file.
1. DD card of JCL is commented out.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Jan 16, 2007 4:22 pm    Post subject:
Reply with quote

Could be, but I thought it was more like a u4038......
Back to top
View user's profile Send private message
adarsha

New User


Joined: 28 Dec 2006
Posts: 8
Location: Noida,Delhi

PostPosted: Tue Jan 16, 2007 7:49 pm    Post subject:
Reply with quote

This can be done by coding OPTIONAL command in the application program in the Enironment Division.

Ex
:
:
:
:
ENIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT OPTIONAL (file-name> ASSIGN TO <assigning-name>.
.......

after this you need not to give the DD name....
the system automatically understand the file is irtual and executes with RC=0.

But this is not for IBM mainframes... its an enhanced parameter for HP-Systems only!!!
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Jan 16, 2007 8:10 pm    Post subject:
Reply with quote

adarsha wrote:
SELECT OPTIONAL (file-name> ASSIGN TO <assigning-name>.
.......
But this is not for IBM mainframes... its an enhanced parameter for HP-Systems only!!!
Quoth the Fine Language Reference:
Quote:
SELECT OPTIONAL
Can be specified only for files opened in the input, I-O, or extend mode. You must specify SELECT OPTIONAL for those input files that are not necessarily present each time the object program is executed. For more information, see the Enterprise COBOL Programming Guide.
file-name-1
Must be identified by an FD or SD entry in the data division. A file-name must conform to the rules for a COBOL user-defined name, must contain at least one alphabetic character, and must be unique within this program.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 3 Mon May 29, 2017 8:10 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 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 Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm


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