EZACT003 error occurred. (For calling a C subprogram dynamically from a Easytrieve program)
search cancel

EZACT003 error occurred. (For calling a C subprogram dynamically from a Easytrieve program)

book

Article ID: 144414

calendar_today

Updated On:

Products

PanAudit Plus Easytrieve Report Generator PAN/SQL

Issue/Introduction

For calling C subprogram RCNMSG_OUT dynamically from Easytrieve/Linux program EANTSTJ, the C program was compiled and a shared library for the C program was created. And the Easytreve program EANTSTJ tried to call the shared library dynamically by using symbolic link file RCNMSG_OUT, but the C subprogram wasn't able to be called with the following error messages.   

RENSV341% EANTSTJ

EZABX000 An error has occurred in program EANTSTJ.

         The following messages provide diagnostic information.  Please
         contact the person or persons responsible for maintaining this
         application.  They may want to see this information.
         ####################### Diagnostic Information #######################
         The error occurred at 14:23:08 on 01/21/20.
         The terminal user identifier is renkhn01.
EZACT003 Program RCNMSG_OUT was not found.
EZABX008 The error occurred at program statement number 34.
EZABX016 The program executed the following statements most recently:
         34    
EZABX020 The program referred to the following files:
File Name                          State Length  Count  Status
                           STDERR   Open 000132 000000  Normal
                           STDOUT   Open 000132 000000  Normal

 

Environment

Release : 11.6

Component : CA EASYTRIEVE REPORT GENERATOR FOR FOR LINUX PC

Cause

The shared library was created with 64 bit mode. The shared library of the subprogram should be created with 32 bit mode because the current Easytrieve/Linux is 32 bit mode application. Therefore, the shared library was created with 32 bit mode and the problem was gone.  (The subprogram was able to be called dynamically from the Easytrieve program.)   

Resolution

For calling a C subprogram dynamically from a Easytrieve/Linux program;
1. A C subprogram should be compiled exactly and “the program name”, without “.so” extension, should be in a directory which is defined in their paths – PATH and LD_LIBRARY_PATH. 
See below example, please.
The C program “T1SUB” without extension exists in "/usr/local/lib”.  
“/usr/local/lib” is set in the PATH and LD_LIBRARY_PATH.

2. The subprogram should be compiled with 32 bit mode because the current Easytrieve/Linux is 32 bit mode application. (The shared library of the subprogram should be created with 32 bit mode.)

3. If a symbolic link file is used to call the shared library of the subprogram, the name of the symbolic link file should be the same as the name of the subprogram without extension. (For example, if the subprogram name is the “T1SUB”, the name of the symbolic link file should be the  “T1SUB” without extension.

============================================================================
Easytrieve calling C program on Linux dynamically
 
■Test folder before compile and run ->
...

(--  holder image ....... )
...

■T1SUB.c ->
...
#include <stdio.h>
#include <stdlib.h>
 
int T1SUB()
{
    printf("Hello, from shared library - T1SUB\n");
    return 0;
}
...
 
■ezt2c.ezt ->
...
DECLARE T1SUB PROGRAM DYNAMIC
 
JOB INPUT NULL
 
  DISPLAY 'Start ezt2c.ezt ...'
  DISPLAY 'CALL T1SUB now ...'
 
  CALL T1SUB
  
  DISPLAY 'Back in ezt2c.ezt ...'
 
STOP
...
 
■Compile, link, copy and run (via shell script)
 
cd /opt/CA/ezt/eztpgms/C/dynTest01
./clr 
 
"clr" is the following script file:
 
# -------------------------------------------------------------------- >>>
# setting current directory and program names
 
export MyComp_Path=/opt/CA/ezt/eztpgms/C/dynTest01
export PGMmain=ezt2c
export PGMsub=T1SUB
 
# -------------------------------------------------------------------- >>>
# compile library source code into position-independent code (PIC) 
 
gcc -c -Wall -m32 -fpic $PGMsub.c
 
# -------------------------------------------------------------------- >>>
# Creating a shared library from an object file 
 
gcc -shared -m32 -o $PGMsub $PGMsub.o 
 
# -------------------------------------------------------------------- >>>
# Making the library available at runtime 
 
cp $MyComp_Path/$PGMsub /usr/local/lib
chmod 0755 /usr/local/lib/$PGMsub
 
# -------------------------------------------------------------------- >>>
# Easytrieve Compile and linking 
 
ezt $PGMmain.ezt -o $PGMmain.out -L > $PGMmain.CMPLST.txt
 
# -------------------------------------------------------------------- >>>
# Run 
 
./$PGMmain.out
 
■The message from C is displayed on the terminal ->
(-- message image ---- )
 
■The messages from Easytrieve are in SYSPRINT (in this sample) ->

(--  SYSPRINT image  -------)

 
The folder after compile and run ->
 
(--  folder image ----)