Hi, i want to rename a file depending on his existence or not.
In facts, i want to whange the name of the file when it already exist.(must be in declaratives but it doesn't work with my method)
ie:
*Definition of the output.
select F-sortie assign to nomsortie
lock mode is exclusive
file status is file-stat.
...
FD F-sortie.
01 ligne-sortie pic x(80).
...
01 file-stat.
02 statut1 pic x.
02 statut2 pic x.
02 statut2-bin redefines statut2 pic 9(2) comp-x.
...
***errors with output
locking-sortie-activ SECTION.
use after standard error procedure on F-sortie.
L-TEST-SORTIE-ACTIV.
if statut2=036
then perform L-RENAME-OUT-ACTIV
else perform L-ERREUR.
*
L-RENAME-OUT-ACTIV.
add 1 to nb-occurences.
open output F-sortie.
This is how i use it.
The prog create the file, and i want it to change the filename (with the incrementation of nb-occurence).
but he doesn't enter in the declarative !!!!
The program simply overwrite the old file. maybe you could help me ?
Thanks.
Seb
In facts, i want to whange the name of the file when it already exist.(must be in declaratives but it doesn't work with my method)
ie:
*Definition of the output.
select F-sortie assign to nomsortie
lock mode is exclusive
file status is file-stat.
...
FD F-sortie.
01 ligne-sortie pic x(80).
...
01 file-stat.
02 statut1 pic x.
02 statut2 pic x.
02 statut2-bin redefines statut2 pic 9(2) comp-x.
...
***errors with output
locking-sortie-activ SECTION.
use after standard error procedure on F-sortie.
L-TEST-SORTIE-ACTIV.
if statut2=036
then perform L-RENAME-OUT-ACTIV
else perform L-ERREUR.
*
L-RENAME-OUT-ACTIV.
add 1 to nb-occurences.
open output F-sortie.
This is how i use it.
The prog create the file, and i want it to change the filename (with the incrementation of nb-occurence).
but he doesn't enter in the declarative !!!!
The program simply overwrite the old file. maybe you could help me ?
Thanks.
Seb