ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

How can I validate if today is Saturday then skip to the next step in CL code?

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

  • How can I validate if today is Saturday then skip to the next step in CL code?

    Is it possible to skip a command in CL if the date is Saturday?

    PGM

    /* For example I would like to skip Step1 if today is Saturday*/

    STEP1: QSH CMD(&CMD)

    MONMSG MSGID(QSH0005 QSH0006 QSH0007) EXEC(DO)

    SNDSMTPEMM RCP((blah@blah.com *PRI)) SUBJECT(' FTP download +
    ') NOTE('<p>Dear Support, <br /> <br />The files from FTP has +
    been downloaded.<br/><br/><br/>Please do not reply.<br/> This is an +
    automated messageing system </p>') CONTENT(*HTML)
    ENDDO


    ENDPGM

    I appreciate any help,
    thanks in advance

  • #2
    Just make an if then statement using the value from rtvsysval command for system value QDAYOFWEEK.

    Jim

    Comment


    • #3
      Code:
                   PGM                                                      
                   DCL        VAR(&DOW) TYPE(*CHAR) LEN(4)                  
                   RTVSYSVAL  SYSVAL(QDAYOFWEEK) RTNVAR(&DOW)               
                   IF         COND(&DOW *NE '*SAT') THEN(DO)                
                      SNDSMTPEMM RCP((BLAH@BLAH.COM *PRI)) SUBJECT(' FTP +  
                                download ') NOTE('<p>Dear Support, <br /> + 
                                <br />The files from FTP has been +         
                                downloaded.<br/><br/><br/>Please do not +   
                                reply.<br/> This is an automated +          
                                messageing system </p>') CONTENT(*HTML)     
                   ENDDO                                                    
                   ENDPGM

      Comment

      Working...
      X