Advanced Job Scheduler

30 pts.
Tags:
Advanced Job Scheduler
AS/400
IFS
Does anyone have a working example of scheduling a job dependant on a file existing on the IFS drive?

Software/Hardware used:
iseries
ASKED: July 25, 2013  3:31 PM

Answer Wiki

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

So, if you use the CHKOBJIFS command, you would put that in a CLLE program that executes the command if OK to process, it runs.

Then you do a DLYJOB for xxx amount of time and loop back to check it again.

This would be a NEP. Never ending program and not be on the scheduler.

Discuss This Question: 2  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
  • WaltZ400
    Use the following link to go to an iProDeloper artice that displays code for a CHKIFSOBJ command. If it finds an error such as the file does not exist, etc it sends the job the cooresponding CPF message that can be monitored to control your job execution.http://iprodeveloper.com/database/chkobj-style-command-ifs
    655 pointsBadges:
    report
  • TomLiotta
    If you only need to check existence, the access() API is all that's needed. Here is a trivial example usage:
    pgm
    
       dcl   &fname       *char  512
       dcl   &amode       *int
    
       dcl   &F_OK        *int           value( 0 )
       dcl   &x00         *char    1     value( x'00' )
    
       dcl   &rc          *int     4     value( 0 )
    
       chgvar      &amode               &F_OK
       chgvar      &fname             ( +
                                        '/home/tst/my.txt'   *cat  +
                                        &x00                       +
                                      )
    
       callprc     'access'           ( +
                                        &fname       +
                                      ( &amode   *byval ) +
                                      ) +
                                rtnval( &rc )
    
       if ( &rc *ne 0 )  do
          sndpgmmsg  msgid( CPF9898 ) msgf( QCPFMSG )  +
                       msgdta( +
                               'Not found'             +
                             ) +
                       msgtype( *COMP )
       enddo
    
    /* dmpclpgm */
    
       return
    
    endpgm
    That program tests to see if "/home/tst/my.txt" exists. Any ILE program can call the API.   A x'00' is concatenated to the end of the name since access() expects a null-terminated string, so CL needs to create it that way. The &F_OK value is zero and is passed to the API through the &amode parm to test for existence. The API return variable will be zero for success or -1 for failure.   Tom
    125,585 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