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

Writing a records in KSDS using COBOL program.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vikrampc16

New User


Joined: 10 Sep 2009
Posts: 2
Location: india

PostPosted: Thu Sep 10, 2009 8:39 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Sep 10, 2009 9:11 pm
Reply with quote

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
View user's profile Send private message
ridgewalker58

New User


Joined: 26 Sep 2008
Posts: 51
Location: New York

PostPosted: Thu Sep 10, 2009 10:41 pm
Reply with quote

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
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 4
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
Search our Forums:

Back to Top