IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Opening an empty KSDS


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts DB2 for z/OS and LUW Admin Job Opening Mainframe Jobs 0
No new posts Insert trailer for non empty file only DFSORT/ICETOOL 6
No new posts Looking For a PDS Member Without Open... PL/I & Assembler 10
No new posts EMPTY file check scenario JCL & VSAM 6
Search our Forums:

Back to Top