@@ -86,6 +86,19 @@ export class BundleDeployer {
86
86
return this . submitJCL ( jcl , session ) ;
87
87
}
88
88
89
+ private wrapLongLineForJCL ( lineOfText : string ) : string {
90
+ const MAX_LINE_LEN = 71 ;
91
+
92
+ let tempVal = lineOfText ;
93
+ let returnVal = "" ;
94
+ while ( tempVal . length > MAX_LINE_LEN ) {
95
+ returnVal = returnVal + tempVal . substring ( 0 , MAX_LINE_LEN ) + "\n" ;
96
+ tempVal = " " + tempVal . substring ( MAX_LINE_LEN ) ;
97
+ }
98
+ returnVal = returnVal + tempVal ;
99
+ return returnVal ;
100
+ }
101
+
89
102
/**
90
103
* Construct the DFHDPLOY DEPLOY BUNDLE JCL.
91
104
* @returns {string }
@@ -101,19 +114,19 @@ export class BundleDeployer {
101
114
jcl = jcl + "*\n" ;
102
115
103
116
// Now generate the deploy statement.
104
- jcl = jcl + "DEPLOY BUNDLE(" + this . params . arguments . name + ")\n" +
105
- " BUNDLEDIR(" + this . params . arguments . bundledir + ")\n" +
106
- " SCOPE(" + this . params . arguments . scope + ")\n" +
107
- " STATE(AVAILABLE)\n" ;
117
+ jcl = jcl + this . wrapLongLineForJCL ( "DEPLOY BUNDLE(" + this . params . arguments . name + ")\n" ) +
118
+ this . wrapLongLineForJCL ( " BUNDLEDIR(" + this . params . arguments . bundledir + ")\n" ) +
119
+ this . wrapLongLineForJCL ( " SCOPE(" + this . params . arguments . scope + ")\n" ) +
120
+ this . wrapLongLineForJCL ( " STATE(AVAILABLE)\n" ) ;
108
121
109
122
if ( this . params . arguments . timeout !== undefined ) {
110
- jcl = jcl + " TIMEOUT(" + this . params . arguments . timeout + ")\n" ;
123
+ jcl = jcl + this . wrapLongLineForJCL ( " TIMEOUT(" + this . params . arguments . timeout + ")\n" ) ;
111
124
}
112
125
if ( this . params . arguments . csdgroup !== undefined ) {
113
- jcl = jcl + " CSDGROUP(" + this . params . arguments . csdgroup + ");\n" ;
126
+ jcl = jcl + this . wrapLongLineForJCL ( " CSDGROUP(" + this . params . arguments . csdgroup + ");\n" ) ;
114
127
}
115
128
if ( this . params . arguments . resgroup !== undefined ) {
116
- jcl = jcl + " RESGROUP(" + this . params . arguments . resgroup + ");\n" ;
129
+ jcl = jcl + this . wrapLongLineForJCL ( " RESGROUP(" + this . params . arguments . resgroup + ");\n" ) ;
117
130
}
118
131
119
132
// finally add a terminator
@@ -147,20 +160,20 @@ export class BundleDeployer {
147
160
"//SYSTSPRT DD SYSOUT=*\n" +
148
161
"//SYSIN DD *\n" +
149
162
"*\n" +
150
- "SET CICSPLEX(" + this . params . arguments . cicsplex + ");\n" +
151
- "*\n" +
152
- "UNDEPLOY BUNDLE(" + this . params . arguments . name + ")\n" +
153
- " SCOPE(" + this . params . arguments . scope + ")\n" +
154
- " STATE(DISCARDED)\n" ;
163
+ this . wrapLongLineForJCL ( "SET CICSPLEX(" + this . params . arguments . cicsplex + ");\n" ) +
164
+ this . wrapLongLineForJCL ( "*\n" ) +
165
+ this . wrapLongLineForJCL ( "UNDEPLOY BUNDLE(" + this . params . arguments . name + ")\n" ) +
166
+ this . wrapLongLineForJCL ( " SCOPE(" + this . params . arguments . scope + ")\n" ) +
167
+ this . wrapLongLineForJCL ( " STATE(DISCARDED)\n" ) ;
155
168
156
169
if ( this . params . arguments . timeout !== undefined ) {
157
- jcl = jcl + " TIMEOUT(" + this . params . arguments . timeout + ")\n" ;
170
+ jcl = jcl + this . wrapLongLineForJCL ( " TIMEOUT(" + this . params . arguments . timeout + ")\n" ) ;
158
171
}
159
172
if ( this . params . arguments . csdgroup !== undefined ) {
160
- jcl = jcl + " CSDGROUP(" + this . params . arguments . csdgroup + ");\n" ;
173
+ jcl = jcl + this . wrapLongLineForJCL ( " CSDGROUP(" + this . params . arguments . csdgroup + ");\n" ) ;
161
174
}
162
175
if ( this . params . arguments . resgroup !== undefined ) {
163
- jcl = jcl + " RESGROUP(" + this . params . arguments . resgroup + ");\n" ;
176
+ jcl = jcl + this . wrapLongLineForJCL ( " RESGROUP(" + this . params . arguments . resgroup + ");\n" ) ;
164
177
}
165
178
166
179
return jcl ;
0 commit comments