ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Run the job if the file in cobol program has current date

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Run the job if the file in cobol program has current date

    I Have a requirement.
    There is a scheduled job running everyday.
    I have to run the job PCCBNNNN only if the input file BGPTTU in this cobol has a current date. My CL program calling the cobol program.
    How to get the date from file ?
    Thanks

  • #2
    You need to read the file with a high-level language program or optionally you could read it within the CL program:

    Code:
    /* Declare the file                                                  */
    
                 DCLF       FILE(MYFILE)                                    
    
    /* Read the file...if an error occurs...get outa' here               */
    
                 RCVF       RCDFMT(MYRCDFMT)                                  
                 MONMSG     MSGID(CPF0864) EXEC(DO)                        
                 RETURN
                 ENDDO                                                     
    
    /* Send message                                                      */
    
                 SNDPGMMSG  MSG(&MYFLDNAM)

    Comment


    • #3
      The RTVOBJD command may give you the info you require. I allows you to retrieve various dates from an object - create date, change date etc.

      Comment


      • #4
        "if the input file BGPTTU in this cobol has a current date"

        It is not clear what this date is. Are you talking about a date stored within one of the records in the file? or are you talking about the created date/last changed of the *FILE object?

        Comment

        Working...
        X