× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.