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
 
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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
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

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