View previous topic :: View next topic |
Author |
Message |
sridevi Beginner
Joined: 10 May 2003 Posts: 6 Topics: 3
|
Posted: Wed May 21, 2003 11:43 pm Post subject: Is is possible to switch b/w input and output mode -file |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Thu May 22, 2003 5:41 am Post subject: |
|
|
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 |
|
 |
|
|