Monitoring VRYCFG

45 pts.
Tags:
Application development
AS/400
CLP
DataCenter
RPG
RPG ILE
RPGLE
Hello, Well, I need some advice because I'm one more time a little bit lost in my learning of AS/400 programming. Here is what I'm trying to do: Everytime that the AS/400 receives a VARY OFF on 1 specific device, I would like to execute a program after the VARY OFF is complete. I was thinking of different possibilites: 1- using the Validity checking program of VRYCFG cmd, but it'll execute my program before the real VRYCFG. Not good. 2- I was thinking of a Break Message Handler Program, but the CPC2606 Vary Off complete arrived in the History Log wherein I cannot use BMH as this is not a MSGQ. 3- Changing the OS/400 command VRYCFG by a new one, and this new one will execute the old VRYCFG and then execute my program... This is the only solution that I found... but is it acceptable ? Do you have any other great ideas ? Thnaks in advance, Pierre.
ASKED: October 3, 2006  9:16 AM
UPDATED: October 5, 2006  11:24 AM

Answer Wiki

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

Hi Pierre

Does the program have to be executed automatically as soon as the device has varied off, or do you just need to make sure the device is varied off before running the program?

If the former is true then your best option would be to either:

1) Create your own command for varying off devices. This should have the same parameters as the IBM VRYCFG command and the CPP should call the VRYCFG command and then check the device name to see if it needs to run the program which it can then execute.

2) Write a NEP (Never Ending Program) that sits in a subsystem and checks the device status at predetermined intervals. If the status changes from online to offline then it can execute your program.

If the latter is true and you only need to ensure the device is offline before executing the program then you could either add a test in the program you want to execute to check the device is offline, or vary off the device from within the program.

All the best

Jonathan

Discuss This Question: 6  Replies

 
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
  • PierreLG
    Thanks Jonathan for your support... Yes, I have to execute my program as soon as the device is vary off... So, I'll try your 2 solutions... modify the vrycfg and the NED program. Any other ideas ?
    45 pointsBadges:
    report
  • PierreLG
    Thanks Jonathan for your support... Yes, I have to execute my program as soon as the device is vary off... So, I'll try your 2 solutions... modify the vrycfg and the NED program. Any other ideas ? Pierre
    45 pointsBadges:
    report
  • AlainDriesen
    Hi, You could also use RTVCFGSTS command in NEP program. Based on Return code you ca ntake appropriate action. See command help for a detailed explanation of return codes. Regards, Alain
    0 pointsBadges:
    report
  • Skipper67
    Greetings. In our BRMS backup processing, we want to make sure the tape drive is varied on before we actually issue the BRMS command. We have not modified the vary command. As mentioned in a previous response, we use the RTVCFGSTS command to be sure the drive is varied on. Here is the code we use. DCL VAR(&TAPEDRIVE) TYPE(*CHAR) LEN( 10) DCL VAR(&TAPESTATUS) TYPE(*DEC) LEN( 5 0) RTVCFGSTS CFGD(&TAPEDRIVE) CFGTYPE(*DEV) + STSCDE(&TAPESTATUS) IF COND(&TAPESTATUS *NE 30) THEN(DO) CHGVAR VAR(&ERRMSG) VALUE('Daily Backup will NOT be + run - Tape drive' |> &TAPEDRIVE |
    0 pointsBadges:
    report
  • astradyne
    The RTVCFGSTS code for offline is 0 (zero). You can get a full list of available codes by prompting the command with F4, moving the cursor to the "CL Variable" parameter and pressing F1. For tape drives I've always tended to use CHKTAP to see if a tape drive is online or not. This has the added benefit of being able to identify if a tape was loaded or not. All the best Jonathan
    370 pointsBadges:
    report
  • Ricksmith
    Yes, CHKTAP is what we have used for years and it will do it all for you.
    0 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