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

writing to sequential file open in i-o mode


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

New User


Joined: 18 Jan 2006
Posts: 11

PostPosted: Thu Jan 19, 2006 5:01 pm
Reply with quote

hi guys,

how can i write to a sequential file open in I-O MODE?
i've got an error 148, wrong open mode or access mode for write...

thanks!
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Thu Jan 19, 2006 5:09 pm
Reply with quote

Quote:
i've got an error 148, wrong open mode or access mode for write...

148 doesn't seem a valid File Status Code... provide some more meaningful error message.

Regards,

Priyesh.
Back to top
View user's profile Send private message
obner

New User


Joined: 18 Jan 2006
Posts: 11

PostPosted: Thu Jan 19, 2006 5:24 pm
Reply with quote

file status code is 48 after issuing write statement...
Back to top
View user's profile Send private message
mad_566

New User


Joined: 02 Dec 2005
Posts: 3

PostPosted: Thu Jan 19, 2006 5:36 pm
Reply with quote

what cobol are you using?

pc cobol?
Back to top
View user's profile Send private message
obner

New User


Joined: 18 Jan 2006
Posts: 11

PostPosted: Thu Jan 19, 2006 5:41 pm
Reply with quote

yap... it can b posible?
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Thu Jan 19, 2006 5:41 pm
Reply with quote

My apologies.... for misguiding earlier....

You need to REWRITE the file opened in I-O mode, rather than WRITE.

status code 48 indicates error ocuured during writing of a file opened in I-O mode.

Regards,

Priyesh.
Back to top
View user's profile Send private message
obner

New User


Joined: 18 Jan 2006
Posts: 11

PostPosted: Thu Jan 19, 2006 5:46 pm
Reply with quote

'ive tried the REWRITE but the return status code is 43.

thanks!
Back to top
View user's profile Send private message
mad_566

New User


Joined: 02 Dec 2005
Posts: 3

PostPosted: Thu Jan 19, 2006 5:48 pm
Reply with quote

You must Read the record before rewriting or deleting it in sequential mode
Back to top
View user's profile Send private message
obner

New User


Joined: 18 Jan 2006
Posts: 11

PostPosted: Thu Jan 19, 2006 5:50 pm
Reply with quote

ok... ill try. thanks a lot.

regards,
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Thu Jan 19, 2006 5:52 pm
Reply with quote

Error 43 shows : A READ DID NOT PRECEDE EXECUTION OF CURRENT REWRITE COMMAND

Bcz:
For a mass storage file in the sequential access mode, the last input-output statement executed for the associated file prior to the execution of a REWRITE statement was not a successfully executed READ statement. For relative and indexed files in the sequential access mode, the last input-output statement executed for the file prior to the execution of a DELETE or REWRITE statement was not a successfully executed READ statement.

So as per MAD says just perform read b4 rewrite...
Back to top
View user's profile Send private message
mad_566

New User


Joined: 02 Dec 2005
Posts: 3

PostPosted: Thu Jan 19, 2006 6:03 pm
Reply with quote

by any chance are you using micro focus?
Back to top
View user's profile Send private message
shashank2361

New User


Joined: 31 May 2005
Posts: 2

PostPosted: Fri Feb 24, 2006 7:43 pm
Reply with quote

Hi
I am getting return code 46 i am not getting the reason for that. is the file should be in sorted form .
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts HILITE on Browse mode? TSO/ISPF 2
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top