Assembler Calling COBOL
Assembler CALL Macro
  Table of Contents  v-24.01.01 - asmcbl01.htm 
  Introduction
  Programming Objectives
  Programming Input and Output
  Programming Requirements
  Programming Overview
  The Job Scripts
  JCL, Assembler Calls COBOL
  CMD, Assembler Calls COBOL
  The Assembler Members
  Assembler Call to COBOL
  Assembler Link Deck
  The Called COBOL Routine
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Contact or Feedback
  Company Overview
The SimoTime Home Page 

Table of Contents Previous Section Next Section Introduction

This document will focus on the effort required to prepare an application that is currently running on an IBM Mainframe System with ZOS to run on a Microsoft Windows System with Micro Focus Enterprise Developer. To do this it will be necessary to correct application program behavior that uses proprietary features of a specific operating system or the underlying hardware.

This suite of programs provides an example of how a High Level Assembler (HLASM) program calls a COBOL program. The assembler program is written using an IBM Mainframe Assembler dialect (HLASM) and defaults to using an EBCDIC encoding schema. The HLASM program will compile using Assembler/H or HLASM. A JCL member is provided to run the job as a batch job on an IBM Mainframe System with ZOS or as a batch job on a Windows System with Micro Focus Enterprise Developer.

For this example, the COBOL program was compiled on a Windows System with Micro Focus using the CHARSET(ASCII) directive. Since the HLASM program is EBCDIC-oriented this example will show how to mix and manage EBCDIC and ASCII data strings. This was accomplished by inserting a "user-interface" program between the call from HLASM to COBOL. The HLASM program calls the user-interface program (ASMCBLC1) that does a selective conversion between EBCDIC and ASCII). The user interface program then calls the COBOL program (SIMOHEX1) using the proper encoding schema.

Note:  The user-interface program will be removed when all the HLASM has been replaced and the entire application has been enabled to run in an ASCII or EBCDIC environment.

This capability was used with a project that was modifying an application that is currently running on a Mainframe System to run on a Windows System with Micro Focus Enterprise Developer. The COBOL program (SIMOHEX1) is part of the SIMOMODS Utility Programs that are included in the SIMOTIME Enterprise License. It could be copied, compiled and executed on an IBM Mainframe System.


We have made a significant effort to ensure the documents and software technologies are correct and accurate. We reserve the right to make changes without notice at any time. The function delivered in this version is based upon the enhancement requests from a specific group of users. The intent is to provide changes as the need arises and in a timeframe that is dependent upon the availability of resources.

Copyright © 1987-2025
SimoTime Technologies and Services
All Rights Reserved

Table of Contents Previous Section Next Section Programming Objectives

The following is a list of the functions provided in this suite of programs.

1. Execute an Assembler (HLASM) on a Windows System using Micro Focus Enterprise Developer.
2. Describe and demonstrate how to call a COBOL Program from an Assembler program.
3. Describe and demonstrate how to produce a HEX-Dump of the memory used by the Assembler program.
4. Describe how to process EBCDIC and ASCII data in a mixed Assembler and COBOL environment.

 

Table of Contents Previous Section Next Section Programming Input and Output

The input for this suite of programs is the memory area occupied by the Assembler program and its associated data. The output is this memory area written to the SYSOUT device in a HEX-dump format. The following shows the HEX-dump information that is written to SYSOUT.

* ASMCBLC1 EBC/ASC User Interface to HEX-Dump v11.11.03 http://www.simotime.com
* ASMCBLC1 Copyright 1987-2017      SimoTime Technologies   All Rights Reserved
* SIMOHEX1 COBOL Hexadecimal Dump Routine     v16.06.15 http://www.simotime.com
* SIMOHEX1 Copyright 1987-2017    SimoTime Technologies     All Rights Reserved
* SIMOHEX1 ADDR is 0000000074C5BD02
* SIMOHEX1 Starting, SIMOHEX1-ID is ASMCBLA1, Dump Buffer size is 0124
   Offset Hex..... ........ ........ ........ ebcdic.......... ascii...........
 00000000 5C40C1E2 D4C3C2D3 C1F14097 81998194 * ASMCBLA1 param \@........@.....
 00000010 85A38599 40F0F240 00000000 80017B0A eter 02 ......#. ....@..@......{.
 00000020 00000000 00000000 C6D6E4D9 00000000 ........FOUR.... ................
 00000030 00000000 00000000 00000000 00000000 ................ ................
 00000040 00000000 00000000 80017AC6 00017C78 ..........:F..@. ..........z....x
 00000050 80000840 00000000 00000520 00000000 ... ............ ...@....... ....
 00000060 0000000F 5C40C1E2 D4C3C2D3 C1F140C5 ....* ASMCBLA1 E ....\@........@.
 00000070 958440D7 99968799 81944040 xxxxxxxx nd Program  .... ..@.......@@....
* ASMCBLC1 Thank you for using this program provided from SimoTime Technologies
* ASMCBLC1 Please send all inquires or suggestions to the helpdesk@simotime.com
* ASMCBLC1 EBC/ASC User Interface to HEX-Dump v11.11.03 http://www.simotime.com
* ASMCBLC1 Copyright 1987-2017      SimoTime Technologies   All Rights Reserved
* SIMOHEX1 ADDR is 00000000D0C0BD02
* SIMOHEX1 Starting, SIMOHEX1-ID is ASMCBLA1, Dump Buffer size is 1312
   Offset Hex..... ........ ........ ........ ebcdic.......... ascii...........
 00000000 90ECD00C 05C050D0 C1BA4510 C03E0036 ..}..{&}A[..{... ......P...E..>.6
 00000010 00005C40 C1E2D4C3 C2D3C1F1 4089A240 ..* ASMCBLA1 is  ..\@........@..@
 00000020 A2A38199 A3899587 6B40C1A2 A2859482 starting, Assemb ........k@......
 00000030 93859940 83819393 89958740 C3D6C2D6 ler calling COBO ...@.......@....
 00000040 D34B4B4B 0A234510 C0680024 00005C40 L.......{.....*  .KKK.#E..h.$..\@
 00000050 C1E2D4C3 C2D3C1F1 40C38193 93A240A3 ASMCBLA1 Calls t ........@.....@.
 00000060 964040C1 E2D4C3C2 D3C3F14B 4B4B0A23 o  ASMCBLC1..... .@@........KKK.#
 00000070 41D0C1B2 5840C51A 900FC4B6 1B114110 .}A.. E...D..... A...X@........A.
 00000080 C0820700 47F0C08A 00017CC0 00017F64 {b...0{...@{..". ....G..........d
 00000090 41000002 45F0C096 00017FE8 58FF0000 .....0{o.."Y.... A...E.......X...
 000000A0 05EF4510 C0C60026 00005C40 C1E2D4C3 ....{F....* ASMC ..E....&..\@....
 000000B0 C2D3C1F1 40D985A3 A4999540 86999694 BLA1 Return from ....@......@....
 000000C0 40F1E2E3 40C38193 934B4B4B 0A235850  1ST Call......& @...@....KKK.#XP
 000000D0 C4F64E50 C4FAF367 C494C4FA 96F0C49A D6+&D.3.DmD.o0D. ..NP...g........
 000000E0 900FC4B6 1B114110 C0EA0700 47F0C0F2 ..D.....{....0{2 ......A.....G...
 000000F0 00017CC0 00017AC0 41000002 45F0C0FE ..@{..:{.....0{. ......z.A...E...
 00000100 00017FE8 58FF0000 05EF4510 C12E0026 .."Y........A... ....X.....E....&
 00000110 00005C40 C1E2D4C3 C2D3C1F1 40D985A3 ..* ASMCBLA1 Ret ..\@........@...
 00000120 A4999540 86999694 40F2D5C4 40C38193 urn from 2ND Cal ...@....@...@...
 00000130 934B4B4B 0A234510 C16A0036 00005C40 l.......A|....*  .KKK.#E..j.6..\@
 00000140 C1E2D4C3 C2D3C1F1 4089A240 83969497 ASMCBLA1 is comp ........@..@....
 00000150 9385A385 6B40C1A2 A2859482 93859940 lete, Assembler  ....k@.........@
 00000160 83819393 89958740 C3D6C2D6 D34B4B4B calling COBOL... .......@.....KKK
 00000170 0A2358D0 C1BA98EC D00C41F0 000007FE ...}A[q.}..0.... .#X.......A.....
 00000180 4510C1A2 00240000 5C40C1E2 D4C3C2D3 ..As....* ASMCBL E....$..\@......
 00000190 C1F14089 A2408182 85958489 95874B4B A1 is abending.. ..@..@........KK
 000001A0 4BD9C37E F0F0F0F8 0A2358D0 C1BA98EC .RC=0008...}A[q. K..~.....#X.....
 000001B0 D00C41F0 000807FE 00000000 00000000 }..0............ ..A.............
 000001C0 00002858 00000000 00000000 00000000 ................ ..(X............
 000001D0 00000000 00000000 00000000 00000000 ................ ................
 000001E0 00000000 00000000 00000000 00000000 ................ ................
 000001F0 00000000 00000000 00000000 00000000 ................ ................
 00000200 44554D50 30303030 41534D43 424C4131 ..(&......(..<.. DUMP0000ASMCBLA1
 00000210 4F505231 20202020 30382030 30303030 |&.............. OPR1    08 00000
 00000220 30303020 39304543 44303043 20303543 ................ 000 90ECD00C 05C
 00000230 30353044 30204331 42413435 31302043 ................ 050D0 C1BA4510 C
 00000240 30334530 30333620 2E2E7D2E 2E7B267D ..........'..#.' 03E0036 ..}..{&}
 00000250 415B2E2E 7B2E2E2E 202E2E2E 2E2E2E50 .$..#..........& A[..{... ......P
 00000260 2E2E2E45 2E2E3E2E 36202030 30303030 ................ ...E..>.6  00000
 00000270 30313020 30303030 35433430 20433145 ................ 010 00005C40 C1E
 00000280 32443443 33204332 44334331 46312034 ................ 2D4C3 C2D3C1F1 4
 00000290 30383941 32343020 2E2E2A20 41534D43 ..............(. 089A240 ..* ASMC
 000002A0 424C4131 20697320 202E2E5C 402E2E2E .<.........* ... BLA1 is  ..\@...
 000002B0 2E2E2E2E 2E402E2E 40202030 30303030 ..... .. ....... .....@..@  00000
 000002C0 30323020 41324133 38313939 20413338 ................ 020 A2A38199 A38
 000002D0 39393538 37203642 34304331 41322041 ................ 99587 6B40C1A2 A
 000002E0 32383539 34383220 73746172 74696E67 ........../...>. 2859482 starting
 000002F0 2C204173 73656D62 202E2E2E 2E2E2E2E ......_......... , Assemb .......
 00000300 2E6B402E 2E2E2E2E 2E202030 30303030 ., ............. .k@......  00000
 00000310 30333020 39333835 39393430 20383338 ................ 030 93859940 838
 00000320 31393339 33203839 39353837 34302043 ................ 19393 89958740 C
 00000330 33443643 32443620 6C657220 63616C6C ........%..../%% 3D6C2D6 ler call
 00000340 696E6720 434F424F 202E2E2E 402E2E2E .>...|.|.... ... ing COBO ...@...
 00000350 2E2E2E2E 402E2E2E 2E202030 30303030 .... ........... ....@....  00000
 00000360 30343020 44333442 34423442 20304132 ................ 040 D34B4B4B 0A2
 00000370 33343531 30204330 36383030 32342030 ................ 34510 C0680024 0
 00000380 30303035 43343020 4C2E2E2E 2E2E2E2E ........<....... 0005C40 L.......
 00000390 7B2E2E2E 2E2E2A20 202E4B4B 4B2E2345 #............... {.....*  .KKK.#E
 000003A0 2E2E682E 242E2E5C 40202030 30303030 .......* ....... ..h.$..\@  00000
 000003B0 30353020 43314532 44344333 20433244 ................ 050 C1E2D4C3 C2D
 000003C0 33433146 31203430 43333831 39332039 ................ 3C1F1 40C38193 9
 000003D0 33413234 30413320 41534D43 424C4131 ..........(..<.. 3A240A3 ASMCBLA1
 000003E0 2043616C 6C732074 202E2E2E 2E2E2E2E ../%%...........  Calls t .......
 000003F0 2E402E2E 2E2E2E40 2E202030 30303030 . ..... ........ .@.....@.  00000
 00000400 30363020 39363430 34304331 20453244 ................ 060 964040C1 E2D
 00000410 34433343 32204433 43334631 34422034 ................ 4C3C2 D3C3F14B 4
 00000420 42344230 41323320 6F202041 534D4342 ........?....(.. B4B0A23 o  ASMCB
 00000430 4C43312E 2E2E2E2E 202E4040 2E2E2E2E <.........  .... LC1..... .@@....
 00000440 2E2E2E2E 4B4B4B2E 23202030 30303030 ................ ....KKK.#  00000
 00000450 30373020 34314430 43314232 20353834 ................ 070 41D0C1B2 584
 00000460 30433531 41203930 30464334 42362031 ................ 0C51A 900FC4B6 1
 00000470 42313134 31313020 2E7D412E 2E20452E .........'...... B114110 .}A.. E.
 00000480 2E2E442E 2E2E2E2E 20412E2E 2E58402E .............. . ..D..... A...X@.
 00000490 2E2E2E2E 2E2E2E41 2E203030 30313331 ................ .......A. 000131
 000004A0 32400000 5C40C1E2 D4C3C2D3 C1F14097 . ..* ASMCBLA1 p 2@..\@........@.
 000004B0 81998194 85A38599 40F0F240 00000002 arameter 02 .... ........@..@....
 000004C0 80017B66 00000000 00000000 C6D6E4D9 ..#.........FOUR ..{f............
 000004D0 00000520 00000000 00000000 00000000 ................ ... ............
 000004E0 00000000 00000000 00000000 80017AC6 ..............:F ..............z.
 000004F0 00017C78 80017B62 00000000 00000520 ..@...#......... ...x..{b.......
 00000500 00000000 0001312C 5C40C1E2 D4C3C2D3 ........* ASMCBL ......1,\@......
 00000510 C1F140C5 958440D7 99968799 81944040 A1 End Program   ..@...@.......@@
* ASMCBLC1 Thank you for using this program provided from SimoTime Technologies
* ASMCBLC1 Please send all inquires or suggestions to the helpdesk@simotime.com

Table of Contents Previous Section Next Section Programming Requirements

This suite of samples programs will run on the following platforms.

1. Executes on Windows/XP, Windows/7 and/or Windows Server using Micro Focus technologies and the CMD files provided.
2. May be ported to run on the Linux and UNIX platforms supported by Micro Focus COBOL.
3. Executes on an IBM Mainframe with ZOS or Windows, Linux or UNIX using Micro Focus technologies and the JCL members provided.

 

Table of Contents Previous Section Next Section Programming Overview

This suite of programs will start with an EBCDIC-encoded Assembler (ASMCBLA1) program that will call an ASCII-encoded COBOL program (ASMCBLC1). The ASMCBLC1 program will convert the control information between EBCDIC and ASCII and call the Memory dump program (SIMOHEX1). The following diagram is an overview of the program flow.

           
Entry Point
ZOS
Entry Point
Windows
   
   
ASMCBLJ1
jcl
ASMCBLW1
cmd
Job Scripts for ZOS or Windows
   
   
Prepare
environment
Prepare
environment
Prepare the Environment then Execute
   
   
 
 
   
   
 
 
   
   
   
   
   
   
   
ASMCBLA1
mlcl
Assembler calling COBOL
   
   
   
if EOJ
 
 
 
 
Yes
 
 
   
   
   
No
   
   
ASMCBLC1
cbl
 
 
SYSOUT
rseq
   
Convert CNTL info between EBCDIC and ASCII
   
   
   
   
SIMOHEX1
cbl
 
 
SYSOUT
rseq
   
HEX-Dump to SYSOUT
   
   
   
   
   
   
   
 
 
 
 
   
   
EOJ
End-Of-Job
 
Memory Dump, Assembler calling COBOL

Table of Contents Previous Section Next Section The Job Scripts

There are two job scripts in this example. The 1st script is a JCL Member that will execute as a batch job on an IBM Mainframe System with ZOS or a Windows System with Micro Focus Enterprise Developer. This job will require a Micro Focus Server Instance to be configured and started.

The 2nd script is a Windows Command File that will execute as a batch job on a Windows System with Micro Focus Enterprise Developer. When properly installed this job may be executed from a Windows Command prompt or by simply double-clicking on the item from Windows Explorer. This job does not require a Micro Focus Server Instance to be configured and started.

The following JOB scripts may need to be modified for a specific user environments.

Table of Contents Previous Section Next Section JCL, Assembler Calls COBOL

The following is the mainframe JCL (ASMCBLJ1.jcl) required to run the mainline program that demonstrates the use of the CALL macro. The JOB statement will need to be modified for specific mainframe environments. This requires a Windows System with Micro Focus Enterprise Developer.

//ASMCBLJ1 JOB SIMOTIME,ACCOUNT,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*       ASMCBLJ1.JCL - a JCL Member for Batch Job Processing        *
//*       This JCL Member is provided by SimoTime Technologies        *
//*           (C) Copyright 1987-2019 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text   - Assembler calling COBOL using CALL Macro
//* Author - SimoTime Technologies
//* Date   - January 01, 1989
//*
//* An EBCDIC-oriented Assembler program will call a COBOL program
//* that is compiled with CHARSET(ASCII)..
//*
//* This set of programs will run on a Windows System with Micro Focus
//* Enterprise Developer.
//*
//*   ************
//*   * ASMCBLJ1 *
//*   ********jcl*
//*        *
//*        *
//*   ************     ************
//*   * ASMCBLA1 *-----*  SYSCON  *
//*   ********mlc*  *  ************
//*        *        *
//*        *        *--call--*
//*        *                 *
//*   ************     ************     ************
//*   *   EOJ    *     * SIMOHEX1 *-----*  SYSOUT  *
//*   ************     ************     ************
//*
//* *******************************************************************
//* Step 1 of 1, This is a single step job.
//*
//ASMCBLS1 EXEC PGM=ASMCBLA1
//STEPLIB  DD  DSN=SIMOTIME.DEMO.LOADLIB1,DISP=SHR
//SYSOUT   DD  SYSOUT=*
//*

Table of Contents Previous Section Next Section CMD, Assembler Calls COBOL

The following is the Windows Command file (ASMCBLW1.cmd) that executes the HLASM program and demonstrates the use of the CALL macro. The JOB statement will need to be modified for specific environments. This requires a Windows System with Micro Focus Enterprise Developer.

@echo OFF
rem  * *******************************************************************
rem  *               ASMCBLW1.cmd - a Windows Command File               *
rem  *         This program is provided by SimoTime Technologies         *
rem  *           (C) Copyright 1987-2019 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  *
rem  * Text    - ASMCBLW1, Assembler calling COBOL using CALL Macro
rem  * Author  - SimoTime Technologies
rem  * Date    - November 11, 2003
rem  * Version - 06.07.16
rem  *
rem  * An EBCDIC-oriented Assembler program will call a COBOL program
rem  * that is compiled with CHARSET(ASCII)..
rem  *
rem  * This set of programs will run on a Windows System with Micro Focus
rem  * Enterprise Developer.
rem  *
rem  * ********************************************************************
rem  * Step   1 of 2  Set the global environment variables...
rem  *
     call ..\ENV1BASE
     if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG
     set CmdName=ASMCBLW1
rem  *
     call SimoNOTE "*******************************************************%CmdName%"
     call SimoNOTE "Starting CmdName %CmdName%"
rem  * ********************************************************************
rem  * Step   2 of 2  Execute the sample program...
rem  *
     run ASMCBLA1
     if not "%ERRORLEVEL%" == "0" set JobStatus=0010
     if not "%JobStatus%" == "0000" goto :EojNOK
:EojAOK
     call SimoNOTE "Finished CmdName %CmdName%, Job Status is %JobStatus%"
     goto :End
:EojNOK
     call SimoNOTE "ABENDING CmdName %CmdName%, Job Status is %JobStatus%"
     echo %DATE% - %TIME% Starting User ABEND Processing...>>%SYSLOG%
     set >>%SYSLOG%
     echo %DATE% - %TIME% Complete User ABEND Processing...>>%SYSLOG%
     goto :End
:End
     call SimoNOTE "Conclude SysOut is %SYSOUT%"
     if not "%1" == "nopause" pause
     exit /B %JobStatus%

Table of Contents Previous Section Next Section The Assembler Members

These HLASM program members are provided as examples and were written to be used as part of a project that modified a mainframe application to run on a Windows System.

Table of Contents Previous Section Next Section Assembler Call to COBOL

This program (ASMCBLA1.mlc) uses the CALL macro to pass parameters to another assembler member (ASMASMAA.MLC) for processing. The CALL macro will generate the code required to build a parameter list and pass control to the called member.

ASMCBLA1 CSECT
***********************************************************************
*             ASMCBLA1.MLC - This is an HLASM Program                 *
*                 Provided by SimoTime Technologies                   *
*           (C) Copyright 1987-2019 All Rights Reserved               *
*              Web Site URL:   http://www.simotime.com                *
*                    e-mail:   helpdesk@simotime.com                  *
***********************************************************************
*                                                                     *
* Created: 1988/06/01, Simmons                                        *
* Changed: 2016/09/15, Simmons, migrate to Micro Focus                *
*                                                                     *
***********************************************************************
*                                                                     *
* This program will run on an IBM Mainframe System with ZOS or a      *
* Windows System with Micro Focus Enterprise Developer.               *
*                                                                     *
* This program provides an example of an Assembler program using the  *
* call macro to pass control to a COBOL program.            *
*                                                                     *
* Using the Micro Focus Animation you can immediately see the results *
* of each instruction execution. This is a very effective way to      *
* become familiar with how these techniques work.                     *
*                                                                     *
***********************************************************************
* This program provides an example of the CALL macro.                 *
***********************************************************************
*
         AMODE 31
         SAVE  (14,12)
         BALR  12,0              PREPARE A BASE REGISTER
         USING *,12              ESTABLISH BASE REGISTER
         ST    R13,SAVREG13
*
         WTO   '* ASMCBLA1 is starting, Assembler calling COBOL...'
*
*---------------------------------------------------------------------*
* The following is an example of calling a COBOL program using the
* CALL macro. The CALL macro will generate the code to pass control to
* the CALLed program. The CALLed program should return to the next line
* of code in this program.
*
         WTO   '* ASMCBLA1 Calls to  ASMCBLC1...'
         LA    R13,SAVEAREA
         L     R4,=CL4'FOUR'           * Eye catcher to locate REG-4
         STM   R0,R15,MYSPACE          * Store all the Registers
         SR    R1,R1
         CALL  ASMCBLC1,(PHX1CNTL,PASSDATA)
         WTO   '* ASMCBLA1 Return from 1ST Call...'
*
         L     R5,BINARY04             * Length of Member, COMP format
         CVD   R5,PACKED08             * Convert to Packed Decimal
         UNPK  PHX1SIZE(7),PACKED08(8) * Unpack to USAGE IS DISPLAY
         OI    PHX1SIZE+6,X'F0'        * Units position to unsigned
         STM   R0,R15,MYSPACE          * Store all the Registers
         SR    R1,R1
         CALL  ASMCBLC1,(PHX1CNTL,ASMCBLA1)
         WTO   '* ASMCBLA1 Return from 2ND Call...'
*
*---------------------------------------------------------------------*
EOJAOK   EQU   *
         WTO   '* ASMCBLA1 is complete, Assembler calling COBOL...'
         L     R13,SAVREG13
         RETURN (14,12),RC=0
*
***********************************************************************
* ABENDING WITH RETURN-CODE OF 8
* RETURN to the CALLING PROGRAM OR OPERATING SYSTEM
*
ABEND08  EQU   *
         WTO   '* ASMCBLA1 is abending...RC=0008'
         L     R13,SAVREG13
         RETURN (14,12),RC=8
*
***********************************************************************
* Define Constants and EQUates
*
         DS    0F            + Force alignment
*
SAVEAREA EQU   *
         DC    A(0)
         DC    A(0)
SAVREG13 DC    A(0)
         DC    15A(0)        * Used by SAVE/RETURN functions
*
***********************************************************************
* Pass Area for calling SIMOHEX1. The PASSDATA may contains a string
* of bytes from x'00' to x'FF'.
*
PHX1CNTL DS    0F
PHX1REQ  DC    CL04'DUMP'              * DUMP Request
PHX1RESP DC    CL04'0000'              * 0000 Respond
PHX1ID   DC    CL08'ASMCBLA1'          * ASMCBLA1 Dump-ID
PHX1SIZE DC    CL7'0000124'            * 0112     Length of Buffer
         DC    CL1' '
         DS    0F
PASSDATA DC    CL24'* ASMCBLA1 parameter 02 '
*
MYSPACE  DC    16F(0)                  * Save Register content
*
BINARY04 EQU   *
         DC    XL2'0000'
         DC    S(CODESIZE)
PACKED08 DC    XL8'000000000000000F'
*
         DC    CL24'* ASMCBLA1 End Program  '
CODESIZE EQU   *-ASMCBLA1
*
* Register EQUates
*
R0       EQU   0
R1       EQU   1
R2       EQU   2
R3       EQU   3
R4       EQU   4
R5       EQU   5
R6       EQU   6
R7       EQU   7
R8       EQU   8
R9       EQU   9
R10      EQU   10
R11      EQU   11
R12      EQU   12
R13      EQU   13
R14      EQU   14
R15      EQU   15
*
         END

Table of Contents Previous Section Next Section Assembler Link Deck

The following (ASMCBLA1.lin) is the Link Deck (or file) that is used when compiling and linking the HLASM program. This Link Deck is used for the Micro Focus Enterprise Developer Environment.

 INCLUDE SYSLIB(ASMCBLA1)
 INCLUDE SYSLIB(ASMCBLC1,TYPE=CBL)
 ENTRY ASMCBLA1
 NAME ASMCBLA1(R)

Table of Contents Previous Section Next Section The Called COBOL Routine

The COBOL program (ASMCBLC1.cbl) is a very simple program that does conversion between EBCDIC and ASCII encoding schemas.

The following (ASMCBLC1.cbl) the source code for the EBC/ASC User Interface program that is used between the EBCDIC-encoded HLASM program and the ASCII-encoded SIMOHEX1 utility program.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    ASMCBLC1.
       AUTHOR.        SIMOTIME TECHNOLOGIES.
      *****************************************************************
      * Copyright (C) 1987-2019 SimoTime Technologies.                *
      *                                                               *
      * All rights reserved.  Unpublished, all rights reserved under  *
      * copyright law and international treaty.  Use of a copyright   *
      * notice is precautionary only and does not imply publication   *
      * or disclosure.                                                *
      *                                                               *
      * Permission to use, copy, modify and distribute this software  *
      * for any non-commercial purpose and without fee is hereby      *
      * granted, provided the SimoTime copyright notice appear on all *
      * copies of the software. The SimoTime name or Logo may not be  *
      * used in any advertising or publicity pertaining to the use    *
      * of the software without the written permission of SimoTime    *
      * Technologies.                                                 *
      *                                                               *
      * Permission to use, copy, modify and distribute this software  *
      * for any commercial purpose requires a fee to be paid to       *
      * SimoTime Technologies. Once the fee is received by SimoTime   *
      * the latest version of the software will be delivered and a    *
      * license will be granted for use within an enterprise,         *
      * provided the SimoTime copyright notice appear on all copies   *
      * of the software. The SimoTime name or Logo may not be used    *
      * in any advertising or publicity pertaining to the use of the  *
      * software without the written permission of SimoTime           *
      * Technologies.                                                 *
      *                                                               *
      * SimoTime Technologies makes no warranty or representations    *
      * about the suitability of the software for any purpose. It is  *
      * provided "AS IS" without any expressed or implied warranty,   *
      * including the implied warranties of merchantability, fitness  *
      * for a particular purpose and non-infringement. SimoTime       *
      * Technologies shall not be liable for any direct, indirect,    *
      * special or consequential damages resulting from the loss of   *
      * use, data or projects, whether in an action of contract or    *
      * tort, arising out of or in connection with the use or         *
      * performance of this software                                  *
      *                                                               *
      * SimoTime Technologies                                         *
      * 15 Carnoustie Drive                                           *
      * Novato, CA 94949-5849                                         *
      * 415.883.6565                                                  *
      *                                                               *
      * RESTRICTED RIGHTS LEGEND                                      *
      * Use, duplication, or disclosure by the Government is subject  *
      * to restrictions as set forth in subparagraph (c)(1)(ii) of    *
      * the Rights in Technical Data and Computer Software clause at  *
      * DFARS 52.227-7013 or subparagraphs (c)(1) and (2) of          *
      * Commercial  Computer Software - Restricted Rights  at 48      *
      * CFR 52.227-19, as applicable.  Contact SimoTime Technologies, *
      * 15 Carnoustie Drive, Novato, CA 94949-5849.                   *
      *                                                               *
      *****************************************************************
      *      This program is provided by SimoTime Technologies        *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *****************************************************************
      *
      *****************************************************************
      * Source Member: ASMCBLC1.cbl
      * Copy Files     PASSDUMP.cpy
      *                AE0437B1.cpy
      * Calls to:      SIMOHEX1 may call SIMOLOGS
      *****************************************************************
      *
      * ASMCBLC1 - Before and After a call to SIMOHEX1 convert the
      *            Paass Area for Control information between EBCDIC
      *            and ASCII.
      *
      * CALLING PROTOCOL
      * ----------------
      * Use standard procedure to EXECUTE, RUN or ANIMATE.
      *
      * DESCRIPTION
      * -----------
      * This is a demonstration program to show how to call the
      * COBOL Hexadecimal Dump Routine.
      *
      *          ************
      *          * ASMCBLJ1 *
      *          ********jcl*
      *               *
      *               *
      *          ************     ************     ************
      *          * ASMCBLC1 ******* ASMCBLC1 *******  SYSOUT  *
      *          ********cbl*     ********cbl*     ************
      *               *                *
      *               *                *
      *               *           ************     ************
      *               *           * SIMOHEX1 *******  SYSOUT  *
      *               *           ********cbl*     *******file*
      *               *
      *          ************
      *          *   EOJ    *
      *          ************
      *
      *****************************************************************
      *
      * MAINTENANCE
      * -----------
      * 1989/02/27 Simmons, Created program.
      * 1997/03/17 Simmons, Updated for COBOL/2.
      *
      *****************************************************************
      *
       ENVIRONMENT DIVISION.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
      *****************************************************************
      *    Data-structure for Title and Copyright...
      *    ------------------------------------------------------------
       01  SIM-TITLE.
           05  T1 pic X(11) value '* ASMCBLC1 '.
           05  T2 pic X(34) value 'EBC/ASC User Interface to HEX-Dump'.
           05  T3 pic X(10) value ' v11.11.03'.
           05  T4 pic X(24) value ' http://www.simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* ASMCBLC1 '.
           05  C2 pic X(20) value 'Copyright 1987-2019 '.
           05  C3 pic X(28) value '     SimoTime Technologies  '.
           05  C4 pic X(20) value ' All Rights Reserved'.

       01  SIM-THANKS-01.
           05  C1 pic X(11) value '* ASMCBLC1 '.
           05  C2 pic X(32) value 'Thank you for using this program'.
           05  C3 pic X(32) value ' provided from SimoTime Technolo'.
           05  C4 pic X(04) value 'gies'.

       01  SIM-THANKS-02.
           05  C1 pic X(11) value '* ASMCBLC1 '.
           05  C2 pic X(32) value 'Please send all inquires or sugg'.
           05  C3 pic X(32) value 'estions to the helpdesk@simotime'.
           05  C4 pic X(04) value '.com'.

      *****************************************************************
      *    Buffer used for posting messages to the console.
      *    ------------------------------------------------------------
       01  MESSAGE-BUFFER.
           05  MESSAGE-HEADER      pic X(11)   value '* ASMCBLC1 '.
           05  MESSAGE-TEXT.
               10  MESSAGE-TEXT-1  pic X(68).
               10  MESSAGE-TEXT-2  pic X(41).

       COPY AE0437B1.

      *****************************************************************
       LINKAGE SECTION.
       COPY PASSHEX1.

      *****************************************************************
       PROCEDURE DIVISION using SIMOHEX1-PASS-AREA, SIMOHEX1-BUFFER.
           perform Z-POST-COPYRIGHT.
           inspect SIMOHEX1-PASS-AREA converting E-INFO to A-INFO
           perform POST-CNTL-ITEMS
           call 'SIMOHEX1' using SIMOHEX1-PASS-AREA, SIMOHEX1-BUFFER
           perform POST-CNTL-ITEMS
           inspect SIMOHEX1-PASS-AREA converting A-INFO to E-INFO
           perform Z-THANK-YOU.
           GOBACK.


      *****************************************************************
       POST-CNTL-ITEMS.
           display 'SIMOHEX1-REQUEST is ' SIMOHEX1-REQUEST
           ', Response is ' SIMOHEX1-RESULT
           ', Dump-ID is '  SIMOHEX1-DUMP-ID
           ', Length is '   SIMOHEX1-LENGTH
                   upon console
           exit.

      *****************************************************************
      * The following Z-Routines perform administrative tasks         *
      * for this program.                                             *
      *****************************************************************
       Z-POST-COPYRIGHT.
           display SIM-TITLE
           display SIM-COPYRIGHT
           exit.

      *****************************************************************
       Z-POST-MESSAGE.
           if  MESSAGE-TEXT-2 = SPACES
               display MESSAGE-BUFFER(1:79)
           else
               display MESSAGE-BUFFER
           end-if
           move SPACES to MESSAGE-TEXT
           exit.

      *****************************************************************
       Z-THANK-YOU.
           display SIM-THANKS-01
           display SIM-THANKS-02
           exit.
      *****************************************************************
      *      This example is provided by SimoTime Technologies        *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************

The COBOL program (SIMOHEX1) is part of the SIMOMODS Utility Programs that are included in the SIMOTIME Enterprise License. More information about this program can be found on the SIMOTIME Web Site.

Link to Internet   Link to Server   Explore a callable routine that will convert a data string into a hexadecimal dump string. The dump information includes the hex values, the possible EBCDIC translation and the possible ASCII translation. The dump information will be written to the SYSOUT device.

The following (PASSHEX1.cpy) defines the PASS Area for calling the SIMOHEX1 program.

      *****************************************************************
      *                PASSHEX1 is a COBOL Copy File                  *
      *     Data Structure or Pass Area used for calling SIMOHEX1.    *
      *         Copyright (C) 1987-2019 SimoTime Technologies         *
      *                     All Rights Reserved                       *
      *****************************************************************
      *              Provided by SimoTime Technologies                *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************
      * Values for SIMOHEX1-REQUEST
      * DUMP   Dump the Buffer in Hexadecimal format
      * NOTE   Display or Write the text to the screen or log file
      *
      *    One format for calling SIMOHEX1 uses the data buffer
      *    defined within this COBOL Copy file.
      *
      *    move 'DUMP'           to SIMOHEX1-REQUEST
      *    move 'MYDUMPID'       to SIMOHEX1-DUMP-ID
      *    move SPACES           to SIMOHEX1-BUFFER
      *    move 'Text String '   to SIMOHEX1-BUFFER
      *    add 12 to ZERO    giving SIMOHEX1-LENGTH
      *    call 'SIMOHEX1'    using SIMOHEX1-PASS-AREA
      *                             SIMOHEX1-BUFFER
      *
      *    An alternate call passes a user-defined data structure.
      *
      *    move 'DUMP'           to SIMOHEX1-REQUEST
      *    move 'NBRITEMS'       to SIMOHEX1-DUMP-ID
      *    add length of NUMERIC-BUFFER-01 to ZERO
      *                      giving SIMOHEX1-LENGTH
      *    call 'SIMOHEX1'    using SIMOHEX1-PASS-AREA
      *                             NUMERIC-BUFFER-01
      *
      *****************************************************************
       01  SIMOHEX1-PASS-AREA.
      *    Initial information is provided by the calling program,
      *    The SIMOHEX1-REQUEST field will be modified to "DUMP" if it
      *    does not contain a valid entry.
           05  SIMOHEX1-REQUEST        PIC X(4).
           05  SIMOHEX1-RESULT         PIC 9999.
           05  SIMOHEX1-DUMP-ID        PIC X(8).
           05  SIMOHEX1-LENGTH         PIC 9(7).
       01  SIMOHEX1-BUFFER             PIC X(128).
      *
      ***  PASSHEX1 - End-of-Copy File - - - - - - - - - - - PASSHEX1 *
      *****************************************************************
      *

Table of Contents Previous Section Next Section Summary

This suite of programs provides an example of how a High Level Assembler (HLASM) program calls a COBOL program. This document may be used to assist as a tutorial for new assembler programmers or as a quick reference for experienced programmers. As always, it is the programmer's responsibility to thoroughly test all programs.

In the world of programming there are many ways to solve a problem. This documentation and software were developed and tested on systems that are configured for a SIMOTIME environment based on the hardware, operating systems, user requirements and security requirements. Therefore, adjustments may be needed to execute the jobs and programs when transferred to a system of a different architecture or configuration.

SIMOTIME Services has experience in moving or sharing data or application processing across a variety of systems. For additional information about SIMOTIME Services or Technologies please contact us using the information in the  Contact or Feedback  section of this document.

Table of Contents Previous Section Next Section Software Agreement and Disclaimer

Permission to use, copy, modify and distribute this software, documentation or training material for any purpose requires a fee to be paid to SimoTime Technologies. Once the fee is received by SimoTime the latest version of the software, documentation or training material will be delivered and a license will be granted for use within an enterprise, provided the SimoTime copyright notice appear on all copies of the software. The SimoTime name or Logo may not be used in any advertising or publicity pertaining to the use of the software without the written permission of SimoTime Technologies.

SimoTime Technologies makes no warranty or representations about the suitability of the software, documentation or learning material for any purpose. It is provided "AS IS" without any expressed or implied warranty, including the implied warranties of merchantability, fitness for a particular purpose and non-infringement. SimoTime Technologies shall not be liable for any direct, indirect, special or consequential damages resulting from the loss of use, data or projects, whether in an action of contract or tort, arising out of or in connection with the use or performance of this software, documentation or training material.

Table of Contents Previous Section Next Section Downloads and Links

This section includes links to documents with additional information that are beyond the scope and purpose of this document. The first group of documents may be available from a local system or via an internet connection, the second group of documents will require an internet connection.

Note: A SimoTime License is required for the items to be made available on a local system or server.

Table of Contents Previous Section Next Section Current Server or Internet Access

The following links may be to the current server or to the Internet.

Link to Internet   Link to Server   Explore the Assembler Connection for more examples of mainframe Assembler programming techniques and sample code.

Link to Internet   Link to Server   Explore The ASCII and EBCDIC Translation Tables. These tables are provided for individuals that need to better understand the bit structures and differences of the encoding formats.

Link to Internet   Link to Server   Explore how to convert a memory-resident data string of one-byte items to a text string of two-byte items using hexadecimal notation. The hexadecimal notation string is then posted to the SYSOUT device. This test case executes a COBOL program that calls a COBOL program to write the HEX-Dump information to the SYSOUT device.

Table of Contents Previous Section Next Section Internet Access Required

The following links will require an internet connect.

This suite of programs and documentation is available for download. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

A good place to start is The SimoTime Home Page for access to white papers, program examples and product information. This link requires an Internet Connection

Explore The Micro Focus Web Site for more information about products (including Micro Focus COBOL) and services available from Micro Focus. This link requires an Internet Connection.

Table of Contents Previous Section Next Section Glossary of Terms

Link to Internet   Link to Server   Explore the Glossary of Terms for a list of terms and definitions used in this suite of documents and white papers.

Table of Contents Previous Section Next Section Contact or Feedback

This document was created and is maintained by SimoTime Technologies. If you have any questions, suggestions, comments or feedback please use the following contact information.

1. Send an e-mail to our helpdesk.
1.1. helpdesk@simotime.com.
2. Our telephone numbers are as follows.
2.1. 1 415 763-9430 office-helpdesk
2.2. 1 415 827-7045 mobile

 

We appreciate hearing from you.

Table of Contents Previous Section Next Section Company Overview

SimoTime Technologies was founded in 1987 and is a privately owned company. We specialize in the creation and deployment of business applications using new or existing technologies and services. We have a team of individuals that understand the broad range of technologies being used in today's environments. Our customers include small businesses using Internet technologies to corporations using very large mainframe systems.

Quite often, to reach larger markets or provide a higher level of service to existing customers it requires the newer Internet technologies to work in a complementary manner with existing corporate mainframe systems. We specialize in preparing applications and the associated data that are currently residing on a single platform to be distributed across a variety of platforms.

Preparing the application programs will require the transfer of source members that will be compiled and deployed on the target platform. The data will need to be transferred between the systems and may need to be converted and validated at various stages within the process. SimoTime has the technology, services and experience to assist in the application and data management tasks involved with doing business in a multi-system environment.

Whether you want to use the Internet to expand into new market segments or as a delivery vehicle for existing business functions simply give us a call or check the web site at http://www.simotime.com


Return-to-Top
Assembler to COBOL
Copyright © 1987-2025
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com