View previous topic :: View next topic
|
Author |
Message |
vikrampc16
New User
Joined: 10 Sep 2009 Posts: 2 Location: india
|
|
|
|
I tried to write records in KSDS using COBOL program but unable to write records through COBOL program.I am accepting values through RUN JCL and after writing the records in COBOL pgm, I am reading the file and displaying the records which is showing in SYSOUT but not available in KSDS after opening KSDS file.Can any one tell me how to write a records in a KSDS file using COBOL program? what is abc.dat file use and extension. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Use the WRITE command.
You need to provide more information:
which version of COBOL (you can find this at the top of any page of the compile listing)?
what is the file status code for the open of the KSDS?
what is the file status code for the write?
what does the SELECT and OPEN statements look like?
what does the JCL DD statement for your KSDS file look like?
Post this data (using BBcode to make it readable) so we can see what's going on.
Quote: |
what is abc.dat file use and extension. |
What does this mean? Mainframe files do not have extensions. |
|
Back to top |
|
|
ridgewalker58
New User
Joined: 26 Sep 2008 Posts: 51 Location: New York
|
|
|
|
When you use the IDCAMS utility to DEFINE the VSAM file with a KSDS organization, there are two parts to the VSAM file that are created. The first holds the data and the next holds the index that is used to point to different parts of the DATA portion. Some installations create files with a .DAT and a .IDX node. These are parts of the name and not EXTENSIONS as you know them from WINDOWS files.
If you try to write records to a KSDS VSAM file and the file has just been created with IDCAMS and has no records in the file, you MUST use the OPEN OUTPUT file statement. If the file has existing records in it, then you must open the file with the OPEN I-O file statement. |
|
Back to top |
|
|
|