AWS BluAge L3 - problems with transaction report generation on AWS Mainframe Modernization environment (BluAge 4.2.0)

0

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

3 Answers
1

The issues you're experiencing in the AWS Mainframe Modernization environment (BluAge 4.2.0) compared to the AppStream environment are likely due to differences in configuration and available components between the two environments. Let's address each problem:

  1. Missing CEEDAYS program: The error "Program not found : CEEDAYS !" indicates that the CEEDAYS program, which is typically part of IBM's Language Environment, is not available in the AWS Mainframe Modernization environment. This program is used for date conversions. To resolve this, you may need to implement a custom date conversion function or use a Java-based alternative in your modernized application.

  2. "No such property: fcmap" error: This error occurs because the 'fcmap' variable is not defined in the scope where it's being used. In your TRANREPT.groovy script, you're trying to use 'fcmap' in the binding, but it's not defined. To fix this, you need to create and populate the 'fcmap' before using it. You can do this by moving the FileConfiguration creation inside the script's main execution block.

To resolve these issues:

  1. For the CEEDAYS problem, implement a Java-based date conversion function to replace the CEEDAYS functionality.

  2. For the 'fcmap' error, modify your TRANREPT.groovy script to create the 'fcmap' before using it. Move the FileConfiguration creation code from the step functions into the main script body.

  3. Review your script for any other environment-specific dependencies that might not be available in the AWS Mainframe Modernization environment.

  4. Ensure that all necessary libraries and dependencies are properly configured in the AWS Mainframe Modernization environment.

  5. Double-check that the file paths and dataset names are correct and accessible in the AWS Mainframe Modernization environment.

These differences highlight the importance of thoroughly testing and adapting your modernized application for the target environment. You may need to make additional adjustments to ensure compatibility with the AWS Mainframe Modernization platform.
Sources
AWS Blu Age L3 Workshop: Unable to execute the groovy script "TRANREPT" | AWS re:Post
AWS Blu Age L3 Certification - Test - Batch Execution Fails at step 5. Execute COMBTRAN job | AWS re:Post
AWS Blu Age, bluesam datasets ACCTDATA, TCATBALF, TRANSACT are not updated after executing batch | AWS re:Post
Error while generating transaction report | AWS re:Post

profile picture
answered 19 days ago
profile picture
EXPERT
reviewed 19 days ago
0

Based upon the details you have shared, I can see two distinct issues when running the script in AWS Mainframe Modernization versus AppStream:

Error1 : CEEDAYS Missing Program

WARN --- [ taskExecutor-2] c.n.b.g.rt.provider.ScriptRegistry : No registered script for the name :[CEEDAYS]
ERROR --- [ taskExecutor-2] c.n.bluage.gapwalk.rt.jics.internal.a : Unexpected exception: Program not found : CEEDAYS !

Root Cause: [+]. This error indicates that the Language Environment (LE) runtime routine CEEDAYS is not available in the AWS Mainframe Modernization environment. Mainly CEEDAYS service is used for date conversions in mainframe applications and error occurs when the application tries to use date conversion functionality that was dependent on CEEDAYS.

Fix : You can try implementing from any of the 3 below mentioned options : Option 1: Implement a Java-based date conversion utility Option 2: Update the application to use native Java date handling Option 3: Configure the LE runtime support in AWS M2

Error2 : fcmap Property Missing

ERROR --- [ Thread-106] c.n.b.g.r.job.support.GroovyJobExecutor : Unable to execute the groovy script "TRANREPT".
groovy.lang.MissingPropertyException: No such property: fcmap for class: TRANREPT

Root cause : [+]. As per the error it seems script is trying to access a variable fcmap that hasn't been properly initialized or bound to the script context because the line binding.setVariable("fcmap", fcmap) is commented out in your code

Fix : You can make changes in your script with below suggestions and test :

// At the beginning of your script
Map<String,FileConfiguration> fcmap = [:]

// Ensure this line is not commented out
binding.setVariable("fcmap", fcmap)

// Initialize fcmap before use
fcmap = new FileConfigurationUtils()
    .withJobContext(jobContext)
    // ... rest of the configurations

Moreover, you can also add some error handling in your code :

try {
    // Your existing code
} catch (MissingPropertyException e) {
    log.error "Configuration error: ${e.message}"
    throw new RuntimeException("Missing required configuration: ${e.message}")
} catch (Exception e) {
    log.error "Execution error: ${e.message}"
    throw new RuntimeException("Error during execution: ${e.message}")
}
AWS
answered 18 days ago
0

Hello,

Thank you for the explanation. Now I understand the problem better and I know how solve it in the future.

Best regards, Dawid

answered 8 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions