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
 

 

Writing a records in KSDS using COBOL program.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Writing a records in KSDS using COBOL program.
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: 8117
Location: East Dubuque, Illinois, USA

PostPosted: Thu Sep 10, 2009 9:11 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm


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