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
 

 

Opening an empty KSDS

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

New User


Joined: 25 Jun 2006
Posts: 14
Location: US

PostPosted: Thu Nov 30, 2006 4:23 pm    Post subject: Opening an empty KSDS
Reply with quote

Hi all,

i have a ksds which is empty. i want to open it through a cobol program and have to search for a particular record in that empty file, if the searched record is not found in the ksds(which would be so for the first time), i have to access a database and have to get the record from database and have to write that record to the ksds file.

In which mode i should open the ksds, which allows me to first check for a particular record in the empty ksds an
Back to top
View user's profile Send private message

jon_s_rice

Active User


Joined: 24 Mar 2005
Posts: 102
Location: Douglasville, GA USA

PostPosted: Thu Nov 30, 2006 4:29 pm    Post subject:
Reply with quote

The file will need to be openned I-O. You may have to put a dummy record in the file.
Back to top
View user's profile Send private message
imain
Warnings : 1

New User


Joined: 25 Jun 2006
Posts: 14
Location: US

PostPosted: Thu Nov 30, 2006 5:26 pm    Post subject:
Reply with quote

jon_s_rice wrote:
The file will need to be openned I-O. You may have to put a dummy record in the file.



Is there any other way than inserting a dummy record.
Back to top
View user's profile Send private message
sankar_MF

New User


Joined: 19 Sep 2006
Posts: 29

PostPosted: Thu Nov 30, 2006 5:51 pm    Post subject:
Reply with quote

Hi,
Normally the dummy Record can be inserted through JCL.

But in your case, no need to insert dummy record. You already know that the File is Empty.
So Open the File in I-O mode and read the File. The Status Code will be 23(Empty File Status Code), in this case you can acccess the Database, fetch the record and insert the corresponding record in the KSDS File.

I think you will be clear.. Please let me know if you have any concerns

Thanks
Sankar
Back to top
View user's profile Send private message
imain
Warnings : 1

New User


Joined: 25 Jun 2006
Posts: 14
Location: US

PostPosted: Fri Dec 01, 2006 10:39 am    Post subject:
Reply with quote

sankar_MF wrote:
Hi,
Normally the dummy Record can be inserted through JCL.

But in your case, no need to insert dummy record. You already know that the File is Empty.
So Open the File in I-O mode and read the File. The Status Code will be 23(Empty File Status Code), in this case you can acccess the Database, fetch the record and insert the corresponding record in the KSDS File.

I think you will be clear.. Please let me know if you have any concerns

Thanks
Sankar



hi sankar,

is that file status 23 for record not found?
Back to top
View user's profile Send private message
sankar_MF

New User


Joined: 19 Sep 2006
Posts: 29

PostPosted: Fri Dec 01, 2006 12:45 pm    Post subject:
Reply with quote

Hi,
Yes, you are correct.
File Status 23 is for Record not found.
So in your case, if File Status is 23, you can fetch the record from
Database and write in the VSAM File.

Thanks
Sankar
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
This topic is locked: you cannot edit posts or make replies. Natural ADABAS Opening with CTS enikhilk Mainframe Jobs 0 Wed Nov 30, 2016 5:37 pm
This topic is locked: you cannot edit posts or make replies. Job Opening for 3 to 10 yrs exp. in I... princeaggarwal Mainframe Jobs 0 Sat Aug 20, 2016 3:17 pm
No new posts PL/I: opening file w/ dynamically det... Sam Dodgers PL/I & Assembler 6 Wed Jul 27, 2016 4:05 pm
No new posts Opening in infosys for mainframe prof... jitu852 Mainframe Jobs 0 Thu Jul 07, 2016 11:40 pm
No new posts Several errors during building altern... Andi1982 JCL & VSAM 11 Wed Jul 06, 2016 7:39 pm


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