Janice,
Chuck has provided a good example.
Here is my version of the same thing. I use 2 different files to separate
the logicals and phyical file names. This version will work on V5R4 - but I
have not compiled or tested it, mostly done from memory.
----- Start Code -----
START: PGM
/* This program Delete all Logicals in the library then deletes */
/* all the physical files. */
/* */
/* To set up this program for compile, run the DPSFD from a command */
/* line for each file type */
/* */
Field:
DCL VAR(&LibName) TYPE(*CHAR) LEN(10) Value('LibName')
FILE:
/* Files for this CL program */
DCLF FILE(&LibName/P_FILES) OPNID(Phy)
DCLF FILE(&LibName/L_FILES) OPNID(Lgl)
/* Create a Data base of physical files to be handled */
DSPFD FILE(&LibName/*ALL) TYPE(*BASATR) OUTPUT(*OUTFILE) +
FILEATR(*PF) OUTFILE(PULL/P_FILES)
/* Create a Data base of logical files to be handled */
DSPFD FILE(&LibName/*ALL) TYPE(*BASATR) OUTPUT(*OUTFILE) +
FILEATR(*PF) OUTFILE(PULL/P_FILES)
/* ----------------------------------------------------------------- */
/* -------------- LOGICAL FILES ---------------------------------- */
/* ----------------------------------------------------------------- */
LOOP1:
RCVF DEV(*FILE) OPNID(Lgl)
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(LOOP2))
/* Delete the file in the library in the file */
DLTF FILE(&LibName/&Lgl_ATFILE)
/* Go back and get the next file to be deleted */
GOTO CMDLBL(LOOP1)
/* ----------------------------------------------------------------- */
/* -------------- PHYSICAL FILES ---------------------------------- */
/* ----------------------------------------------------------------- */
LOOP2:
RCVF DEV(*FILE) OPNID(Phy)
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END))
/* Delete the file in the specified library */
DLTF FILE(&LibName/&Phy_ATFILE)
/* Go back and get the next file to be saved */
GOTO CMDLBL(LOOP2)
END: ENDPGM
START: PGM
/* This program Delete all Logicals in the library then deletes */
/* all the physical files. */
/* */
/* To set up this program for compile, run the DPSFD from a command */
/* line for each file type */
/* */
Field:
DCL VAR(&LibName) TYPE(*CHAR) LEN(10) Value('LibName')
FILE:
/* Files for this CL program */
DCLF FILE(&LibName/P_FILES) OPNID(Phy)
DCLF FILE(&LibName/L_FILES) OPNID(Lgl)
/* Create a Data base of physical files to be handled */
DSPFD FILE(&LibName/*ALL) TYPE(*BASATR) OUTPUT(*OUTFILE) +
FILEATR(*PF) OUTFILE(PULL/P_FILES)
/* Create a Data base of logical files to be handled */
DSPFD FILE(&LibName/*ALL) TYPE(*BASATR) OUTPUT(*OUTFILE) +
FILEATR(*PF) OUTFILE(PULL/P_FILES)
/* ----------------------------------------------------------------- */
/* -------------- LOGICAL FILES ---------------------------------- */
/* ----------------------------------------------------------------- */
LOOP1:
RCVF DEV(*FILE) OPNID(Lgl)
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(LOOP2))
/* Delete the file in the library in the file */
DLTF FILE(&LibName/&Lgl_ATFILE)
/* Go back and get the next file to be deleted */
GOTO CMDLBL(LOOP1)
/* ----------------------------------------------------------------- */
/* -------------- PHYSICAL FILES ---------------------------------- */
/* ----------------------------------------------------------------- */
LOOP2:
RCVF DEV(*FILE) OPNID(Phy)
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END))
/* Delete the file in the specified library */
DLTF FILE(&LibName/&Phy_ATFILE)
/* Go back and get the next file to be saved */
GOTO CMDLBL(LOOP2)
END: ENDPGM START: PGM
/* This program Delete all Logicals in the library then deletes */
/* all the physical files. */
/* */
/* To set up this program for compile, run the DPSFD from a command */
/* line for each file type */
/* */
Field:
DCL VAR(&LibName) TYPE(*CHAR) LEN(10) Value('LibName')
FILE:
/* Files for this CL program */
DCLF FILE(&LibName/P_FILES) OPNID(Phy)
DCLF FILE(&LibName/L_FILES) OPNID(Lgl)
/* Create a Data base of physical files to be handled */
DSPFD FILE(&LibName/*ALL) TYPE(*BASATR) OUTPUT(*OUTFILE) +
FILEATR(*PF) OUTFILE(PULL/P_FILES)
/* Create a Data base of logical files to be handled */
DSPFD FILE(&LibName/*ALL) TYPE(*BASATR) OUTPUT(*OUTFILE) +
FILEATR(*PF) OUTFILE(PULL/P_FILES)
/* ----------------------------------------------------------------- */
/* -------------- LOGICAL FILES ---------------------------------- */
/* ----------------------------------------------------------------- */
LOOP1:
RCVF DEV(*FILE) OPNID(Lgl)
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(LOOP2))
/* Delete the file in the library in the file */
DLTF FILE(&LibName/&Lgl_ATFILE)
/* Go back and get the next file to be deleted */
GOTO CMDLBL(LOOP1)
/* ----------------------------------------------------------------- */
/* -------------- PHYSICAL FILES ---------------------------------- */
/* ----------------------------------------------------------------- */
LOOP2:
RCVF DEV(*FILE) OPNID(Phy)
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END))
/* Delete the file in the specified library */
DLTF FILE(&LibName/&Phy_ATFILE)
/* Go back and get the next file to be saved */
GOTO CMDLBL(LOOP2)
END: ENDPGM
START: PGM
/* This program Delete all Logicals in the library then deletes */
/* all the physical files. */
/* */
/* To set up this program for compile, run the DPSFD from a command */
/* line for each file type */
/* */
Field:
DCL VAR(&LibName) TYPE(*CHAR) LEN(10) Value('LibName')
FILE:
/* Files for this CL program */
DCLF FILE(&LibName/P_FILES) OPNID(Phy)
DCLF FILE(&LibName/L_FILES) OPNID(Lgl)
/* Create a Data base of physical files to be handled */
DSPFD FILE(&LibName/*ALL) TYPE(*BASATR) OUTPUT(*OUTFILE) +
FILEATR(*PF) OUTFILE(PULL/P_FILES)
/* Create a Data base of logical files to be handled */
DSPFD FILE(&LibName/*ALL) TYPE(*BASATR) OUTPUT(*OUTFILE) +
FILEATR(*PF) OUTFILE(PULL/P_FILES)
/* ----------------------------------------------------------------- */
/* -------------- LOGICAL FILES ---------------------------------- */
/* ----------------------------------------------------------------- */
LOOP1:
RCVF DEV(*FILE) OPNID(Lgl)
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(LOOP2))
/* Delete the file in the library in the file */
DLTF FILE(&LibName/&Lgl_ATFILE)
/* Go back and get the next file to be deleted */
GOTO CMDLBL(LOOP1)
/* ----------------------------------------------------------------- */
/* -------------- PHYSICAL FILES ---------------------------------- */
/* ----------------------------------------------------------------- */
LOOP2:
RCVF DEV(*FILE) OPNID(Phy)
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END))
/* Delete the file in the specified library */
DLTF FILE(&LibName/&Phy_ATFILE)
/* Go back and get the next file to be saved */
GOTO CMDLBL(LOOP2)
END: ENDPGM
------- END CODE --------
On Mon, Aug 4, 2008 at 7:38 PM, Janice Chester <janice@xxxxxxxxxxxxx> wrote:
Jim,
Would you email me your sample code?
Thanks,
Janice
Janice Chester
Tefron USA, Inc.
IT Director
P.O. Box 100
720 Main Street
Valdese, NC 28690
janicechester@xxxxxxxxxxxxx
Phone: (828) 879-6518
As an Amazon Associate we earn from qualifying purchases.