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 to sequential file open in i-o mode

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: writing to sequential file open in i-o mode
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: 1452
Location: Chicago, IL

PostPosted: Thu Jan 19, 2006 5:09 pm    Post subject: Re: writing to sequential file open in i-o mode
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    Post subject:
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    Post subject: Re: writing to sequential file open in i-o mode
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    Post subject:
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: 1452
Location: Chicago, IL

PostPosted: Thu Jan 19, 2006 5:41 pm    Post subject: Re: writing to sequential file open in i-o mode
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    Post subject:
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    Post subject:
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    Post subject:
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: 680
Location: NJ

PostPosted: Thu Jan 19, 2006 5:52 pm    Post subject: Re: writing to sequential file open in i-o mode
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    Post subject:
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    Post subject: Solve error code 46
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    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 File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am
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