View previous topic :: View next topic
|
Author |
Message |
imain Warnings : 1 New User
Joined: 25 Jun 2006 Posts: 14 Location: US
|
|
|
|
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 |
|
|
jon_s_rice
Active User
Joined: 24 Mar 2005 Posts: 102 Location: Douglasville, GA USA
|
|
|
|
The file will need to be openned I-O. You may have to put a dummy record in the file. |
|
Back to top |
|
|
imain Warnings : 1 New User
Joined: 25 Jun 2006 Posts: 14 Location: US
|
|
|
|
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 |
|
|
sankar_MF
New User
Joined: 19 Sep 2006 Posts: 29
|
|
|
|
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 |
|
|
imain Warnings : 1 New User
Joined: 25 Jun 2006 Posts: 14 Location: US
|
|
|
|
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 |
|
|
sankar_MF
New User
Joined: 19 Sep 2006 Posts: 29
|
|
|
|
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 |
|
|
|