Appendix G. WAIT Parameter for IF/THEN/ELSE/ENDIF
Using Platform Server
WAIT parameter in conjunction with IBM IF/THEN/ELSE/ENDIF statement construct, you can conditionally execute additional job steps based on the outcome of the Platform Server file transfer.
You can choose one of the following two ways to use IF/THEN/ELSE logic when performing Platform Server transfers:
- Using the REXX interface described in the REXX interface chapter of TIBCO® Managed File Transfer Platform Server for z/OS User's Guide.
- Using the batch interface described in the batch interface chapter of TIBCO® Managed File Transfer Platform Server for z/OS User's Guide along with the JCL IF/THEN/ELSE parameters.
The following sample illustrates the syntax that can be used:
//SYSIN DD *
PROCESS,IFTHEN,TRANSFER,RECEIVE
.
.
// [name] IF [(]relational-expression[)] THEN .
. action when expression is
true
.
// [name] ELSE
.
. action when relation-
expression
.
//[name] ENDIF By using the previous syntax, you can execute job steps within a job based on certain conditions of the outcome of the Platform Server transfer.
The IF statement is always followed by a relation-expression followed by a THEN clause. These three things are required when using the IF/THEN/ELSE/ENDIF statement construct. The THEN clause specifies those steps that the system processes upon the confirmation that the relational-expression, which is evaluated at startup time, is a true condition.
If the relational expression is a false condition, the ENDIF statement will follow. The ENDIF statement indicates the end of the IF/THEN/ELSE/ENDIF statement construct. It is mandatory that ENDIF be coded at the end of every construct. However, before the ENDIF statement, the user can specify the ELSE clause. This ELSE clause specifies those steps that the system processes if the relational expression is false. This optional statement is followed by the ENDIF statement.
See the following example of how to use IF/THEN/ELSE/ENDIF within the Platform Server batch JCL. For more information on how to use Modal Logic, see the JCL reference manual.
//IFTHEN JOB 555,'IF THEN JCL',MSGCLASS=X,MSGLEVEL=1, 00001004
// REGION=4000K,TIME=(2),NOTIFY=&USERID 00002004
//*************************************************************** 00030000
//STEP1 EXEC PGM=OSIUB000,PARM='SERVER=FUSION' 00030104
//STEPLIB DD DISP=SHR,DSN=FUSION.LOADLIB 00030203
//SYSUDUMP DD SYSOUT=* 00030303
//SYSPRINT DD SYSOUT=* 00030403
//SYSIN DD * 00030503
PROCESS,TEST1,TRANSFER,RECEIVE 00030603
DSN=INPUT.DATATSET.NAME 00030703
REMOTE_FILE=C:\TEMP\TEST.TXT 00030803
NODE=NODE1 00030903
TYPE=TEXT 00031003
CRLF=YES 00031103
EFFECT=CR 00031203
HOLD=NO 00031303
REMOTE_USER=USER1 00031403
RPASS=USER1 00031503
NOTIFY=USER1 00031603
NOTIFY_TYPE=TSO 00031703
WAIT=YES 00031804
RETRY=2 00031904
//NZERO IF (RC>5) THEN 00032003
//STEP2 EXEC PGM=IEBGENER 00033004
//SYSPRINT DD SYSOUT=X 00040000
//SYSUT1 DD DISP=SHR,DSN=FUSION.SAMPLIB(MEMBER1) 00050000
//SYSUT2 DD SYSOUT=X 00060000
//SYSIN DD DUMMY 00070000
// ELSE 00081003
//STEP3 EXEC PGM=IEBGENER 00090000
//SYSPRINT DD SYSOUT=X 00100000
//SYSUT1 DD DISP=SHR,DSN=FUSION.SAMPLIB(MEMBER2) 00110000
//SYSUT2 DD SYSOUT=X 00120000
//SYSIN DD DUMMY 00130000
//ENDSTEP ENDIF 00420001
/* 00430001