View previous topic :: View next topic
|
Author |
Message |
obner
New User
Joined: 18 Jan 2006 Posts: 11
|
|
|
|
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 |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
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 |
|
|
obner
New User
Joined: 18 Jan 2006 Posts: 11
|
|
|
|
file status code is 48 after issuing write statement... |
|
Back to top |
|
|
mad_566
New User
Joined: 02 Dec 2005 Posts: 3
|
|
|
|
what cobol are you using?
pc cobol? |
|
Back to top |
|
|
obner
New User
Joined: 18 Jan 2006 Posts: 11
|
|
|
|
yap... it can b posible? |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
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 |
|
|
obner
New User
Joined: 18 Jan 2006 Posts: 11
|
|
|
|
'ive tried the REWRITE but the return status code is 43.
thanks! |
|
Back to top |
|
|
mad_566
New User
Joined: 02 Dec 2005 Posts: 3
|
|
|
|
You must Read the record before rewriting or deleting it in sequential mode |
|
Back to top |
|
|
obner
New User
Joined: 18 Jan 2006 Posts: 11
|
|
|
|
ok... ill try. thanks a lot.
regards, |
|
Back to top |
|
|
khamarutheen
Active Member
Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
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 |
|
|
mad_566
New User
Joined: 02 Dec 2005 Posts: 3
|
|
|
|
by any chance are you using micro focus? |
|
Back to top |
|
|
shashank2361
New User
Joined: 31 May 2005 Posts: 2
|
|
|
|
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 |
|
|
|