How to prevent dropping of leading zeros in JCL with DE and Z-os agent

Document ID : KB000071689
Last Modified Date : 22/02/2018
Show Technical Document Details
Issue:
When a DATE (or any numeric) variable is defined in DE and passed to a JCL, the JCL on the z/OS side may drop leading zeros.
E.g.
DATE = %(APPL.NWMM)%(APPL.NWDD)%(APPL.NWYY)

The value is passed to the z/OS job: 
....
// DCB=(SNY1.DSCB),UNIT=DISK,SPACE=(TRK,(1)) 
//SYSIN DD * 
%DATE 

Resolves as
.....
// DCB=(SNY1.DSCB),UNIT=DISK,SPACE=(TRK,(1)) 
//SYSIN DD * 
21518 

The date should be 021518.  The leading zero gets dropped.
Environment:
CA Workload Automation DE R12
CA WA Agent for z/OS
Cause:
The JCL treats the variable as numeric, which causes the zero to be dropped.
Resolution:
When defining variables in DE, set it as string variable.  By adding the quotes around the value, it will change from integer to string.
E.g.
%(APPL.NWMM)%(APPL.NWDD)%(APPL.NWYY) 
TO 
"%(APPL.NWMM)%(APPL.NWDD)%(APPL.NWYY)
Additional Information: