Posted Thu, 27 Aug 2015 13:00:51 GMT by Portal Admin

What happens if a user tries to run a QSH (or STRQSH) command in a Skybot Job.  By default if the QSH interpreter was able to start and try to execute the program the command will end normally even if the actual command run in QSH has failed.  To configure it so that the command fails in Skybot an environment variable has to be set in the Job’s commands before the QSH command is called.  Here is an example:

ADDENVVAR ENVVAR (QIBM_QSH_CMD_ESCAPE_MSG) VALUE(Y)

strqsh cmd ('ls -l /')

strqsh cmd ('ls -l /fdsasdfsdf') 

If Command #1 is not run then both commands 2 & 3 will be considered successful and the Job will end Completed:

 

QSH0005    Completion              00   07/17/14  11:03:48.349225  QZSHRUNC     QSHELL      *STMT    SKY6371     SKYAGENT    *STMT

                                     From module . . . . . . . . :   QZSHRUNC

                                     From procedure  . . . . . . :   main

                                     Statement . . . . . . . . . :   149

                                     To module . . . . . . . . . :   SKY6371

                                     To procedure  . . . . . . . :   SKY6371

                                     Statement . . . . . . . . . :   5700

                                     Message . . . . :   Command ended normally with exit status 1.

 

 

With Command #1 running then command #3 will now fail (item does not exist) and cause the Job to end Failed status:

 

QSH0005    Escape                  00   07/17/14  11:04:12.107894  QZSHRUNC     QSHELL      *STMT    SKY6371     SKYAGENT    *STMT

                                     From module . . . . . . . . :   QZSHRUNC

                                     From procedure  . . . . . . :   main

                                     Statement . . . . . . . . . :   149

                                     To module . . . . . . . . . :   SKY6371

                                     To procedure  . . . . . . . :   SKY6371

                                     Statement . . . . . . . . . :   5700

                                     Message . . . . :   Command ended normally with exit status 1.

 

You must be signed in to post in this forum.