GITIFSCHK - Check for IFS File Existence

<< Click to Display Table of Contents >>

Navigation:  Utility Commands >

GITIFSCHK - Check for IFS File Existence

Description

This CL general utility command is used to check for the existence of IFS files and directories. 

 

The command throws a CPF9898 exception if file is not found.

The command throws a CPF9897 exception if file is found.

 

Both of these message are always thrown so they should be monitored to determine appropriate actions to take if a file is found or does not exist.

 

Example CL code to check for file

/*---------------------------------------------------------------------

/* Make sure file exists */                                  

/*---------------------------------------------------------------------

            GITIFSCHK  FILNAM('/tmp/sampledata.txt')                            

            /* FILE EXISTS, DO NOTHING SPECIAL */                          

            MONMSG     MSGID(CPF9897) EXEC(DO)                        

            ENDDO                                                    

                                                                     

            /* DOES NOT EXIST. BAIL OUT */                            

            MONMSG     MSGID(CPF9898) EXEC(DO)                        

            SNDPGMMSG  MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('IFS +    

                         file does not exist') MSGTYPE(*ESCAPE)                    

            ENDDO                                                    

 

 

Command Example to run directory list of the /tmp directory

GITIFSCHK FILNAM('/tmp/sampledata.txt')

 

Parameters

 

FILNAM - Path to IFS file or directory to check for.