Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 8195
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 The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 1 Wed Dec 06, 2017 1:50 am
This topic is locked: you cannot edit posts or make replies. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm
No new posts Calling IKJEFT01 program from Rexx upendrasri CLIST & REXX 8 Wed Nov 15, 2017 4:27 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us