-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustom_jcl_replacing.jcl.j2
52 lines (52 loc) · 1.42 KB
/
custom_jcl_replacing.jcl.j2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//CUSTJCL JOB 'WD-CJCL',MSGLEVEL=(1,1),MSGCLASS=R,NOTIFY=&SYSUID
//*ROUTE PRINT @JCLPRINT@
//*JOBLIB DD DISP=SHR,
//* DSN=TODO.SDSNEXIT
//* DD DISP=SHR,
//* DSN=TODO.SDSNLOAD
//*******************************************
//*
//* Notes:
//*
//* This Jinja2 templates iterate over the step.artifacts and allows
//* to put together a custom JCL for the package contents, that are
//* referenced in this deployment step.
//*
//* This template is processed once for all associated types. It does
//* not submit a JCL per member (the submit_job building block is not
//* artifact "sensitive")
//*
//* In this sample we are printing everything to the instream dd for
//* IEFBR14
//*
//* Author DBEHM
//*******************************************
//* CUSTOMIZATION JOB
//*******************************************
//**BEGIN
//JCLCUST EXEC PGM=IEFBR14,DYNAMNBR=20,COND=(4,LT)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSIN DD DUMMY
//SYSIN DD *
{# PRINT STEP ARTIFACT #}
{% for artifact in step.artifacts -%}
//{{ artifact['name'] }} DD *
Element name: {{ artifact['name'] }}
Element properties:
{% for prop in artifact['properties'] %}
{# Only get the path #}
{% if prop['key'] == 'path' %}
path: {{ prop['value'] }}
{% endif %}
{% endfor %}
Element hash: {{ artifact['hash'] }}
{# --- #}
{# you can also define variables #}
{% set itemName = artifact['name'] %}
{# --- #}
end {{ itemName }}
//*
{% endfor %}
//*