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
 

 

Overwritten Problem

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
sakthisiga
Warnings : 1

New User


Joined: 11 Jun 2009
Posts: 60
Location: Chennai

PostPosted: Tue Sep 01, 2009 6:19 pm    Post subject: Overwritten Problem
Reply with quote

Hi all,

I try to write a record in a PS file...

first time its working properly,

When i try to write it again, it is overwritten with previous record,


I'll post my file description below:

Code:

FILE-CONTROL.                               
         SELECT REP-FILE ASSIGN TO REPFILE 
         ORGANIZATION IS SEQUENTIAL         
         ACCESS IS SEQUENTIAL               
         FILE STATUS IS W04-RP-STATUS.     





Can anyone tell me what i have to change to write records one by one?
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Tue Sep 01, 2009 6:24 pm    Post subject:
Reply with quote

Are you closing the file then reopening it? What does the DD statement look like for REPFILE? And what do you mean "write records one by one" -- the system only writes one record at a time anyway (logically at least -- physically one block at a time)?
Back to top
View user's profile Send private message
sakthisiga
Warnings : 1

New User


Joined: 11 Jun 2009
Posts: 60
Location: Chennai

PostPosted: Tue Sep 01, 2009 6:27 pm    Post subject:
Reply with quote

1. For first time opened file in OUPUT mode, then close it properly. Again i open it in I-O mode then REWRITE it and Close it properly.
2. In DD statment i used disp=old.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Tue Sep 01, 2009 6:46 pm    Post subject:
Reply with quote

Quote:
For first time opened file in OUPUT mode, then close it properly. Again i open it in I-O mode then REWRITE it and Close it properly.
Do you not READ the record, then REWRITE it? If so, then there's only one record in the file -- the one you wrote before the close, then rewrote after the close and reopen. When you open the file I-O, the file position is set back to the first record, so if you want to write another record to it you'll have to read past the first record, then do a WRITE.
Back to top
View user's profile Send private message
sakthisiga
Warnings : 1

New User


Joined: 11 Jun 2009
Posts: 60
Location: Chennai

PostPosted: Wed Sep 02, 2009 11:17 am    Post subject:
Reply with quote

Please find code in the first post in this topic.


Is the same select clause is used for ESDS or not?


But it shows error, while running job.

Error :




Code:

********************************* TOP OF DATA **********************************
 IGZ0200W A file attribute mismatch was detected. File REP-FILE in program SAMPL
          file and the file specified in the ASSIGN clause was a VSAM data set.
 CEE3204S The system detected a protection exception (System Completion Code=0C4
          From compile unit SAMPLE at entry point SAMPLE at compile unit offset
          address 09300E26.                                                     



Here some error description is missing..
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Wed Sep 02, 2009 11:20 am    Post subject: Reply to: Overwritten Problem
Reply with quote

nothing is missing...
You are trying to process a VSAM file with the FD of plain PS
what else are You looking for ???
Back to top
View user's profile Send private message
sakthisiga
Warnings : 1

New User


Joined: 11 Jun 2009
Posts: 60
Location: Chennai

PostPosted: Wed Sep 02, 2009 11:28 am    Post subject:
Reply with quote

In FD for ESDS file, what should we code to process?

Here i used
Code:

 FD REP-FILE                               
          LABEL RECORDS ARE STANDARD       
          BLOCK CONTAINS 0 CHARACTERS       
          RECORD CONTAINS 80 CHARACTERS     
          RECORDING MODE IS F               
          DATA RECORD IS REP-REC.           
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Wed Sep 02, 2009 3:02 pm    Post subject:
Reply with quote

From the original post ...
Quote:
I try to write a record in a PS file...
Please go away long enough to learn the terminology before posting again. PS is a physical sequential file. This type of file cannot, by the very definition of the term, be VSAM -- ever. VSAM files are VSAM files and sequential files are not.

And if the file is a VSAM ESDS, your COBOL SELECT statement must -- not should be, not could be, but must -- be in the form
Code:
ASSIGN TO <comment>-AS-<ddname>
So if your ASSIGN clause -- which you did not post I note -- does not have AS- on the front of the DD name, you need to add that and try again.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Strings with double quotes having pro... raja Arumugam All Other Mainframe Topics 11 Thu Mar 30, 2017 10:34 am
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7:47 am
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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