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

Overwritten Problem


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Sep 01, 2009 6:24 pm
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Sep 01, 2009 6:46 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Sep 02, 2009 11:20 am
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Sep 02, 2009 3:02 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts z/vm installation problem All Other Mainframe Topics 0
No new posts Job scheduling problem. JCL & VSAM 9
No new posts Problem with IFTHEN=(WHEN=GROUP,BEGIN... DFSORT/ICETOOL 5
No new posts Need to add field to copybook, proble... COBOL Programming 14
Search our Forums:

Back to Top