Hello,
I have the following TRANREPT.groovy script with implemented modifications as described in the L3 Workshop:
// Import
import com.netfective.bluage.gapwalk.rt.provider.ScriptRegistry
import com.netfective.bluage.gapwalk.rt.call.MainProgramRunner
import com.netfective.bluage.gapwalk.io.support.FileConfigurationUtils
import com.netfective.bluage.gapwalk.rt.job.support.DefaultJobContext
import com.netfective.bluage.gapwalk.rt.utils.GroovyUtils
import com.netfective.bluage.gapwalk.rt.io.support.FileConfiguration
import com.netfective.bluage.gapwalk.rt.shared.AbendException
import com.netfective.bluage.gapwalk.rt.call.exception.GroovyExecutionException
// Variables
mpr = applicationContext.getBean("com.netfective.bluage.gapwalk.rt.call.ExecutionController", MainProgramRunner.class)
TreeMap mapTransfo = [:]
Map params = ["MapTransfo":mapTransfo]
// Execute job with utility functions
Binding binding = new Binding()
binding.setVariable("jobContext", jobContext)
//binding.setVariable("fcmap", fcmap)
def shell = new GroovyShell(binding).parse(ScriptRegistry.getScript("functions"))
//println 'Start date: [' + startDate + ']'
//println 'End date: [' + endDate + ']'
//*********************************************************************
//* PROC *
//*********************************************************************
shell.with {
def jobName = "TRANREPT"
mpr.setJobContext(jobContext)
//def jobName = "" + jobContext.getJobName() + "-" + procName
displayStartJob(jobName)
mpr.withSchenv(jobContext.getSchenv())
def lastProgramResult
//*****************************************************************
// Copyright Amazon.com, Inc. or its affiliates.
// All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License").
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
// either express or implied. See the License for the specific
// language governing permissions and limitations under the License
//*****************************************************************
// *******************************************************************
// Unload the processed transaction file
// *******************************************************************
Map programResults = [:]
stepSTEP01R(shell, jobName, params, programResults)
// *******************************************************************
// Filter the transactions for a the parm date and sort by card num
// *******************************************************************
lastProgramResult = stepSTEP05R(shell, params, programResults)
// *******************************************************************
// Produce a formatted report for processed transactions
// *******************************************************************
lastProgramResult = stepSTEP10R(shell, params, programResults)
displayEndJob(jobName)
return programResults
}
//*********************************************************************
//* STEPS *
//*********************************************************************
// STEP STEP01R - PROC - REPROC***************************************************
def stepSTEP01R(Object shell, String jobName, Map params, Map programResults) {
shell.with{
if (checkValidProgramResults(programResults)) {
def stepName = 'STEP01R'
execStepSimple(stepName, programResults, {
def procName = 'REPROC'
TreeMap mapTransfo = params["MapTransfo"]
mapTransfo['CNTLLIB'] = 'AWS.M2.CARDDEMO.CNTL'
Map<String,FileConfiguration> fcmap = new FileConfigurationUtils()
.withJobContext(jobContext)
.bluesam("PRC001.FILEIN")
.dataset("AWS.M2.CARDDEMO.TRANSACT.VSAM.KSDS")
.disposition("SHR")
.build()
.gdgSupport("PRC001.FILEOUT")
.name("AWS.M2.CARDDEMO.TRANSACT.BKUP").ownerPath(".").relativeGeneration(1).storageProvider("filesystem").recordSize(350)
.disposition("NEW")
.normalTermination("CATLG")
.abnormalTermination("DELETE")
.build()
.getFileConfigurations();
File procFile = ScriptRegistry.getScript(procName);
File resolvedProcFile = buildResolvedFile(jobName,stepName,procName)
GroovyUtils.processGroovyParams(procFile, resolvedProcFile, mapTransfo, programResults)
return execGroovy(applicationContext, mapTransfo, resolvedProcFile, jobContext, fcmap)
})
}
}
}
// STEP STEP05R - PGM - SORT******************************************************
def stepSTEP05R(Object shell, Map params, Map programResults){
shell.with {
if (checkValidProgramResults(programResults)) {
return execStep("STEP05R", "SORT", programResults, {
mpr
.withFileConfigurations(new FileConfigurationUtils()
.withJobContext(jobContext)
.gdgSupport("SORTIN")
.name("AWS.M2.CARDDEMO.TRANSACT.BKUP").ownerPath(".").relativeGeneration(1).storageProvider("filesystem")
.disposition("SHR")
.build()
.fileSystem("SYMNAMES")
.stream(
"""TRAN-CARD-NUM,263,16,ZD
TRAN-PROC-DT,305,10,CH
PARM-START-DATE,C'${startDate}' //Date
PARM-END-DATE,C'${endDate}' //Date """, getEncoding())
.build()
.fileSystem("SYSIN")
.stream(
""" SORT FIELDS=(TRAN-CARD-NUM,A)
INCLUDE COND=(TRAN-PROC-DT,GE,PARM-START-DATE,AND,
TRAN-PROC-DT,LE,PARM-END-DATE) """, getEncoding())
.build()
.systemOut("SYSOUT")
.output("*")
.build()
.gdgSupport("SORTOUT")
.name("AWS.M2.CARDDEMO.TRANSACT.DALY").ownerPath(".").relativeGeneration(1).storageProvider("filesystem")
.disposition("NEW")
.normalTermination("CATLG")
.abnormalTermination("DELETE")
.dcbParameters("*.SORTIN")
.build()
.getFileConfigurations())
.withParameters(params)
.runProgram("SORT")
})
}
}
}
// STEP STEP10R - PGM - CBTRN03C**************************************************
def stepSTEP10R(Object shell, Map params, Map programResults){
shell.with {
if (checkValidProgramResults(programResults)) {
return execStep("STEP10R", "CBTRN03C", programResults, {
mpr
.withFileConfigurations(new FileConfigurationUtils()
.withJobContext(jobContext)
.bluesam("STEPLIB")
.dataset("AWS.M2.CARDDEMO.LOADLIB")
.disposition("SHR")
.build()
.systemOut("SYSOUT")
.output("*")
.build()
.systemOut("SYSPRINT")
.output("*")
.build()
.gdgSupport("TRANFILE")
.name("AWS.M2.CARDDEMO.TRANSACT.DALY").ownerPath(".").relativeGeneration(1).storageProvider("filesystem")
.disposition("SHR")
.build()
.bluesam("CARDXREF")
.dataset("AWS.M2.CARDDEMO.CARDXREF.VSAM.KSDS")
.disposition("SHR")
.build()
.bluesam("TRANTYPE")
.dataset("AWS.M2.CARDDEMO.TRANTYPE.VSAM.KSDS")
.disposition("SHR")
.build()
.bluesam("TRANCATG")
.dataset("AWS.M2.CARDDEMO.TRANCATG.VSAM.KSDS")
.disposition("SHR")
.build()
.fileSystem("DATEPARM")
.stream(startDate + " " + endDate, getEncoding())
.disposition("SHR")
.build()
.gdgSupport("TRANREPT")
.name("AWS.M2.CARDDEMO.TRANREPT").ownerPath(".").relativeGeneration(1).storageProvider("filesystem").recordSize(133)
.disposition("NEW")
.normalTermination("CATLG")
.abnormalTermination("DELETE")
.build()
.getFileConfigurations())
.withParameters(params)
.runProgram("CBTRN03C")
})
}
}
}
When I try to generate transaction report in the AppStream using online application with a date range option selected or current month/year, everything is fine and I get a report like the following (including correctly generated AWS.M2.CARDDEMO.TRANSACT.DALY and AWS.M2.CARDDEMO.TRANSACT.BKUP):
DALYREPT Daily Transaction Report Date Range: 2002-01-01 to 2026-01-01
Transaction ID Account ID Transaction Type Tran Category Tran Source Amount
-------------------------------------------------------------------------------------------------------------------------------------
0000000058866561 00000000050 01-Purchase 0001-Regular Sales Draft POS TERM 183.88
And in the logs I can see my date range:
2025-04-24T18:48:59.230Z INFO 8928 --- [ Thread-29] c.n.b.g.i.i.AbstractSequentialFile : Trying to open sequential file [2002-01-01 2026-01-01]
2025-04-24T18:48:59.230Z INFO 8928 --- [ Thread-29] c.n.b.g.i.i.AbstractSequentialFile : Sequential file [2002-01-01 2026-01-01] successfully opened
2025-04-24T18:48:59.231Z INFO 8928 --- [ Thread-29] a.b.l.w.c.s.impl.Cbtrn03cProcessImpl : Reporting from 2002-01-01 to 2026-01-01
But in the AWS Mainframe Modernization (environment BluAge 4.2.0) after selecting a date range I see problems related to missing program CEEDAYS:
2025-04-24T19:13:34.609Z
2025-04-24T19:13:33.713Z INFO ??? --- [ taskExecutor-2] a.b.l.w.c.s.impl.Corpt00cProcessImpl : PROCESS ENTER KEY
2025-04-24T19:13:34.609Z
2025-04-24T19:13:33.715Z WARN ??? --- [ taskExecutor-2] c.n.b.g.rt.provider.ScriptRegistry : No registered script for the name :[CEEDAYS]
2025-04-24T19:13:34.609Z
2025-04-24T19:13:33.715Z ERROR ??? --- [ taskExecutor-2] c.n.bluage.gapwalk.rt.jics.internal.a : Unexpected exception: Program not found : CEEDAYS !
2025-04-24T19:13:34.609Z java.lang.RuntimeException: Program not found : CEEDAYS !
2025-04-24T19:13:34.609Z at com.netfective.bluage.gapwalk.rt.call.internal.ExecutionControllerImpl.xaa(Unknown Source)
2025-04-24T19:13:34.609Z at com.netfective.bluage.gapwalk.rt.call.internal.ExecutionControllerImpl.lambda$callSubProgram$0(Unknown Source)
2025-04-24T19:13:34.609Z at com.netfective.bluage.gapwalk.rt.call.internal.ExecutionControllerImpl.xaa(Unknown Source)
2025-04-24T19:13:34.609Z at com.netfective.bluage.gapwalk.rt.call.internal.ExecutionControllerImpl.callSubProgram(Unknown Source)
2025-04-24T19:13:34.609Z at com.netfective.bluage.gapwalk.rt.call.internal.ExecutionControllerImpl.callSubProgram(Unknown Source)
2025-04-24T19:13:34.609Z at aws.bluage.l3.workshop.csutldtc.service.impl.CsutldtcProcessImpl.a000Main(CsutldtcProcessImpl.java:92)
2025-04-24T19:13:34.609Z at aws.bluage.l3.workshop.csutldtc.service.impl.CsutldtcProcessImpl.procedureDivision(CsutldtcProcessImpl.java:61)
2025-04-24T19:13:34.609Z at aws.bluage.l3.workshop.program.Csutldtc.run(Csutldtc.java:110)
2025-04-24T19:13:34.609Z at com.netfective.bluage.gapwalk.rt.call.internal.ExecutionControllerImpl.xaa(Unknown Source)
...
In the AWS Mainframe Modernization environment (BluAge 4.2.0), after selecting the current month/year option, I get a "no such property: fcmap" error:
2025-04-24T19:28:31.557Z INFO ??? --- [ taskExecutor-2] a.b.l.w.c.s.impl.Corpt00cProcessImpl : PROCESS ENTER KEY
2025-04-24T19:28:31.564Z INFO ??? --- [ taskExecutor-2] c.n.b.g.rt.provider.CheckpointRegistry : Remove checkpoint TRANREPT
2025-04-24T19:28:31.564Z INFO ??? --- [ taskExecutor-2] c.n.b.g.rt.script.BatchWebController : --> executing script TRANREPT
2025-04-24T19:28:31.564Z INFO ??? --- [ taskExecutor-2] c.n.b.g.rt.script.BatchWebController : Bound jobContext 1055595218 - GDGEventsQueueHandler :2134102772
2025-04-24T19:28:31.564Z INFO ??? --- [ taskExecutor-2] c.n.b.g.rt.script.ScriptControlTower : Added jobExecutor [a3f120f9-f3da-4dbc-a3dd-3877d040cf3c] to Script Control Tower.
2025-04-24T19:28:31.565Z INFO ??? --- [ taskExecutor-2] c.n.b.g.r.j.support.AbstractJobExecutor : a3f120f9-f3da-4dbc-a3dd-3877d040cf3c - worker :Thread-106 [1995910741]
2025-04-24T19:28:31.565Z INFO ??? --- [ taskExecutor-2] c.n.b.g.rt.script.ScriptLauncherJobImpl : Asynchronous script execution. Triggered script TRANREPT [a3f120f9-f3da-4dbc-a3dd-3877d040cf3c] @ 04-24-2025 19:28:31
2025-04-24T19:28:31.565Z INFO ??? --- [ taskExecutor-2] c.n.bluage.gapwalk.rt.jics.internal.a : Task executed; transaction: CR00, execution result: com.netfective.bluage.gapwalk.rt.jics.control.ReturnInfo@31781f2
2025-04-24T19:28:31.565Z INFO ??? --- [ taskExecutor-2] c.n.bluage.gapwalk.rt.jics.internal.a : Running Task Registry : removed [com.netfective.bluage.gapwalk.rt.jics.internal.TaskContext@251e8af3 / 27] - [CR00]
2025-04-24T19:28:31.844Z 24-Apr-2025 19:28:31.573 INFO [http-nio-8194-exec-12] org.apache.catalina.core.StandardWrapperValve.invoke 2025-04-24T19:28:31.526Z WARN ??? --- [io-8194-exec-12] c.a.icatch.imp.TransactionServiceImp : Attempt to create a transaction with a timeout that exceeds maximum - truncating to: 300000
2025-04-24T19:28:31.574Z INFO ??? --- [ Thread-106] c.n.b.g.r.job.support.GroovyJobExecutor : Triggered script: TRANREPT - [a3f120f9-f3da-4dbc-a3dd-3877d040cf3c] - jobContext [1055595218]
2025-04-24T19:28:31.584Z ERROR ??? --- [ Thread-106] c.n.b.g.r.job.support.GroovyJobExecutor : Unable to execute the groovy script "TRANREPT".
2025-04-24T19:28:31.844Z groovy.lang.MissingPropertyException: No such property: fcmap for class: TRANREPT
2025-04-24T19:28:31.844Z at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:67)
2025-04-24T19:28:31.844Z at org.codehaus.groovy.vmplugin.v8.IndyGuardsFiltersAndSignatures.unwrap(IndyGuardsFiltersAndSignatures.java:163)
2025-04-24T19:28:31.844Z at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
2025-04-24T19:28:31.844Z at TRANREPT.run(TRANREPT.groovy:17)
Do you have any idea why it works fine in AppStream but not in the AWS Mainframe Modernization environment?
Thanks in advance and best regards,
Dawid