Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Renaming files

Status
Not open for further replies.

Guadanaka

Programmer
Joined
Oct 19, 2001
Messages
1
Location
BE
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top