MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Is is possible to switch b/w input and output mode -file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
sridevi
Beginner


Joined: 10 May 2003
Posts: 6
Topics: 3

PostPosted: Wed May 21, 2003 11:43 pm    Post subject: Is is possible to switch b/w input and output mode -file Reply with quote

I have a generic doubt in PL/1 . Can you please help to resolve that .

The requirement is :
We need to open a file , and if the file is empty write header data and the details to file . If the file is not empty we need to write the details only . We need to know the equivalent of I/O mode of cobol in PL/I . If we are decalring the file in update mode it allows to read and rewrite . It is not supporting writing of data to file . ( this is specific requirement for handling restart)

Is there any way to swtich between the modes within the program foe eg. Open the file in input mode , then followed by reading and close it . Later open the file in output mode and do the write .

Thanks,
Sridevi
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu May 22, 2003 5:41 am    Post subject: Reply with quote

Sridevi,

why not pass a parameter to the program which will differentiate between between initial read and restart.

You can pass parms via linkage section or define a parm file.

Code:


  IF PARM-VALUE = 'R'
       OPEN OUTPUT IN EXTEND MODE
  ELSE
      OPEN OUTPUT
  END-IF



Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group