Jobs goes into Message Wait after reaching End Of File.

215 pts.
Tags:
CL programming
iseries v5r4
I am using the below programs to Delete Temporary Files from Specific Libraries on monthly basis after taking a Entire System Backup. [strong]The File and Library Names are stored in a Output File called MNTHDELE in QGPL and the Column Names are &ODLBNM for File Name and &ODOBNM for Library Name[/strong]. It is observed that the Job goes into Message Wait whenever End Of File is detected.

******************************* *************************

PGM

DCLF FILE(QGPL/MNTHDELE)

LOOP: RCVF

MONMSG MSGID(CPF0864) CMPDTA(THEN) EXEC(GOTO CMDLBL(END))

DLTF FILE(&ODLBNM/&ODOBNM)

GOTO CMDLBL(LOOP)

END: ENDPGM

*********************************************************

Please help since we are using the same program to Start Journaling and End Journaling on Multiple Files.



Software/Hardware used:
iSeries V5R4

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi Haaiderali,

Can you be more specific on the MSGW you’re getting?

If you display the message with F1 what does it say?

Do you have the option to respond e.g. (999999) in order to continue processing?

Regards,
Roy

———————
This looks wrong:
MONMSG MSGID(CPF0864) CMPDTA(THEN) EXEC(GOTO CMDLBL(END)

Should be:
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END)

Phil
——————————-
CL programs don’t typically write to files.
I would create a small RPG pgoram to write to the log file and call it from the CL passing it the necessary parameters.

Phil

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Haaiderali
    Thanks Phil, the above suggestion really worked. Also let me know if i include a log file in this program. Which means after deletion of each file, mentioned in QGPL/MNTHDELE, a record will be written to a log file mentioning the file name which was deleted along with a library name and the timestamp. This is required to keep a track on the Files Deleted using this program.
    215 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following