|
|
The
SimoMODS Series Called Routines & Driver Programs http://www.simotime.com |
| When technology complements business | Copyright © 1987-2010 SimoTime Enterprises All Rights Reserved |
The SimoMODS are a collection of shared modules that perform common tasks or repeatable processes for many different users. The SimoMODS are divided into two categories, callable modules and driver programs. The SimoMODS that are written in COBOL have been compiled with Micro Focus Net Express to create executable members. The executable members are intended for use in an ASCII-encoded environment and may be used with Net Express, Application Server or Enterprise Server running on a Microsoft Windows system.
Detailes information about each of the common or shared modules along with links for downloading may be found in the Downloads and Links to Similar Pages section of this document.
To quickly install and use the SimoMODS shared modules the following procedure is recommended.
| Step | Description |
| Step 1 | Create a new directory and make the new directory the current
directory using the following statements.c:\> MD SimoLIBR c:\> CD SimoLIBR c:\SimoLIBR> |
| Step 2 | Create three sub-directories under the SimoLIBR directory using
the following statements.c:\SimoLIBR> MD DataWrk1 c:\SimoLIBR> MD HTML c:\SimoLIBR> MD LOGS |
| Step 3 | Download the zPack for the executable members using the
following URL. http://www.simotime.com/sim4dzip.htm#COBOLRoutineDriversExec. |
| Step 4 | Unzip the contents of the execmods.zip file into the c: \SimoLIBR directory. |
| Step 5 | Add the SimoLIBR directory to the Windows PATH. |
After completing the preceding steps the SimoLIBR directory should contain the three sub-directories, the executable members, the COBOL copy files and a couple of command files(additional members may be in the SimoLIBR directory if other technologies have been downloaded from the SimoTime web site). To validate the proper installation execute the Ivp4NOTE.CMD file. This may be done from a command line window or by simply clicking on the item from a Windows Explorer display.
Note: Many of the examples and technologies available from SimoTime use the services provided by the SimoMODS drivers and callable routines.
A source code listing for MFCATXPT is available for viewing at http://www.simotime.com/mfcatxpt.htm. To download the Simoxxxx members or sample programs that use this callable member refer to the Downloads and Links to Similar Pages section of this document.
MFCATXPT is written and tested using the Micro Focus COBOL dialect. MFCATXPT may be compiled and executed on a Windows System using Micro Focus (refer to http://www.microfocus.com ).
A source code listing for MFENVARS is available for viewing at http://www.simotime.com/mfenvars.htm. To download the Simoxxxx members or sample programs that use this callable member refer to the Downloads and Links to Similar Pages section of this document.
MFENVARS is written and tested using the Micro Focus COBOL dialect. MFENVARS may be compiled and executed on a Windows System using Micro Focus (refer to http://www.microfocus.com ).
A source code listing for MFEVENTS is available for viewing at http://www.simotime.com/mfevents.htm. To download the Simoxxxx members or sample programs that use this callable member refer to the Downloads and Links to Similar Pages section of this document.
MFEVENTS is written and tested using the Micro Focus COBOL dialect. MFEVENTS may be compiled and executed on a Windows System using Micro Focus (refer to http://www.microfocus.com ).
A source code listing for MFJESLOG is available for viewing at http://www.simotime.com/mfjeslog.htm. To download the Simoxxxx members or sample programs that use this callable member refer to the Downloads and Links to Similar Pages section of this document.
MFJESLOG is written and tested using the Micro Focus COBOL dialect. MFJESLOG may be compiled and executed on a Windows System using Micro Focus (refer to http://www.microfocus.com ).
The SimoABN0 routine (or callable program) is for use in a Micro Focus environment. The routine will call MFEVENTS.CBL to display the call stack and then issue a STOP RUN to terminiate processing.. A suite of sample programs that illustrate the use of the SimoABN0 routine is provided on the SimoTime Web Site. SimoABN0 may be compiled and executed on a Linux, UNIX or Windows system using Micro Focus technology.
The SimoABN0 routine (or callable program) is for use in a Micro Focus environment. The routine will call MFEVENTS.CBL to display the call stack and then issue a STOP RUN to terminiate processing.
* ABTESTC1 Example of a driver program for ABEND example V10.06.08, ABTESTC1 * ABTESTC1 program is STARTING ABTESTC1 * ABSUBRC1 Example of a called program for ABEND example V10.06.08, ABSUBRC1 * ABSUBRC1 program is STARTING ABSUBRC1 * ABSUBRC2 Example of a called program calling ABEND member V10.06.08, ABSUBRC2 * ABSUBRC2 program is STARTING ABSUBRC2 * SIMOABN0 ABENDING, display the call stack. v08.01.24 http://www.simotime.com * SIMOABN0 Copyright 1987-2010 SimoTime Enterprises, LLC All Rights Reserved * MFEVENTS ABENDING, display the call stack. v10.06.08 http://www.simotime.com * MFEVENTS Copyright 1987-2010 SimoTime Enterprises, LLC All Rights Reserved * MFEVENTS SIMOABN0 * MFEVENTS ABSUBRC2 * MFEVENTS ABSUBRC1 * MFEVENTS ABTESTC1 * SIMOABN0 Processing is being Terminated...
The following will call the ABEND routine. Parameters are not required. If parameters are specified they will be ignored. A programmer may display messages prior to calling the ABEND routine.
CALL 'SIMOABN0'
A source code listing for SimoABN0 is available for viewing at http://www.simotime.com/simoabn0.htm. To download the Simoxxxx members or sample programs that use this callable member refer to the Downloads and Links to Similar Pages section of this document.
SimoBITS is written and tested using the VS COBOL II dialect. Also, SimoBITS will work with COBOL for MVS and COBOL/370. A suite of sample programs that illustrate the use of the SimoBITS routine is provided on the SimoTime Web Site. SimoBITS may be compiled and executed on an IBM mainframe or as a project with Micro Focus Mainframe Express (MFE) or Net Express running on a PC with Windows (refer to http://www.microfocus.com ).
Determining and changing the setting of a bit within a byte is possible using COBOL. An assembler routine or the use of a language extension is not required. The called COBOL routine (SIMOBITS) in this example provides two functions.
The SimoBITS routine (or callable program) will convert the bit information in a single byte to or from an eight-byte field of COBOL accessible zeroes and ones.
The following will explain the two functions performed by the SimoBITS routine.
1. How to expand a single byte into eight bytes of 0's or 1's based on
the bit settings within the one byte field.
2. How to compress eight bytes
of 0's and 1's into a single byte of eight bits.
For each bit that is ON (1) in the BTS-PASS-BITS field the correspondong byte in the BTS-PASS-BYTES field is set to a value of one. For each bit that is OFF (0) in the BTS-PASS-BITS field the correspondong byte in the BTS-PASS-BYTES field is set to a value of zero.
| Input | BTS-PASS-BITS, a one byte field (8-bits) | |
| Output | BTS-PASS-BYTES, an eight byte field with zeroes and ones | |
| Example | if BTS-PASS-BITS = x'55' then BTS-PASS-BYTES will be '01010101' | |
For each byte that is a one in the BTS-PASS-BYTES field the correspondong bit in the BTS-PASS-BITS field is set to ON (1). For each byte that is zero in the BTS-PASS-BYTES field the correspondong bit in the BTS-PASS-BITS field is set to OFF (0).
| Input | BTS-PASS-BYTES, an eight byte field with zeroes and ones | |
| Output | BTS-PASS-BITS, a one byte field (8-bits) | |
| Example | if BTS-PASS-BYTES = '01010101' then BTS-PASS-BITS will be set to x'55' | |
The callable interface requires a data structure or pass area to be defined. A copy file (PASSBITS.CPY) is provided with the following source code.
*****************************************************************
* Data Structure or Pass Area used for calling SIMOBITS. *
*****************************************************************
* Copyright (C) 1987-2010 SimoTime Enterprises *
* All Rights Reserved *
*****************************************************************
* Provided by SimoTime Enterprises *
* Our e-mail address is: helpdesk@simotime.com *
* Also, visit our Web Site at http://www.simotime.com *
*****************************************************************
*
* When BTS-PASS-REQUEST is 'EXPAND ' then
* BTS-PASS-BITS (a 1-btye field of 8-bits) is analyzed
* and based on the bit settings a corresponding value of
* 0 or 1 is set in the BTS-PASS-BYTES (an 8-byte field
* of zeroes and ones).
*
* When BTS-PASS-REQUEST is 'COMPRESS' then
* BTS-PASS-BYTES (an 8-byte field of zeroes and ones) is
* analyzed and based on a value of 0 or 1 the corresponding
* bit in BTS-PASS-BITS (a 1-byte field of 8-bits) is
* switched ON or OFF.
*
01 BTS-PASS-AREA.
05 BTS-PASS-REQUEST PIC X(8).
05 BTS-PASS-RESULT PIC S9(9) COMP.
05 BTS-PASS-RECORD.
10 BTS-PASS-BITS PIC X.
10 BTS-PASS-BYTES.
15 BTS-PASS-BYTE-01 PIC X.
15 BTS-PASS-BYTE-02 PIC X.
15 BTS-PASS-BYTE-03 PIC X.
15 BTS-PASS-BYTE-04 PIC X.
15 BTS-PASS-BYTE-05 PIC X.
15 BTS-PASS-BYTE-06 PIC X.
15 BTS-PASS-BYTE-07 PIC X.
15 BTS-PASS-BYTE-08 PIC X.
*! PASSBITS - End-of-Copy File...
The following will translate an eight character field of 0's and 1's to a one byte field with the bits set to match to 0's and 1's of the eight character field. Please note: the content of the BTS-PASS-REQUEST field must be upper case and contain 'COMPRESS'
*****************************************************************
* The coding required to do the call to the Byte-Bit Routine *
* (translate an 8-byte field to a 1-byte field). *
*****************************************************************
MOVE '11111111' to BTS-PASS-BYTES
MOVE 'COMPRESS' to BTS-PASS-REQUEST
CALL 'SIMOBITS' using BTS-PASS-AREA
In the preceding example the contents of BTS-PASS-BITS will be X'FF' or high-value upon return from the call to SIMOBITS.
The following will set the individual bytes of an eight character field to 0's or 1's based on the bit settings of a one byte field. Please note: the content of the BTS-PASS-REQUEST field must be upper case and contain 'EXPAND' followed by two spaces
*****************************************************************
* The coding required to do the call to the Byte-Bit Routine *
* (translate a 1-byte field to an 8-byte field). *
*****************************************************************
MOVE X'55' to BTS-PASS-BITS
MOVE 'EXPAND ' to BTS-PASS-REQUEST
CALL 'SIMOBITS' using BTS-PASS-AREA
In the preceding example the contents of BTS-PASS-BYTES will be '01010101' upon return from the call to SIMOBITS.
A source code listing for SimoBITS is available for viewing at http://www.simotime.com/simobits.htm. To download the Simoxxxx members or sample programs that use this callable member refer to the Downloads and Links to Similar Pages section of this document.
SimoBSIO is a callable routine that uses the Micro Focus Byte-Stream I/O capability to access a file. This routine may access a single byte or multiple bytes of data at the specified offset into the file. SimoBSIO is written and tested using the Micro Focus COBOL dialect (it will only execute in a Micro Focus environment, it will not compile and run on a mainframe system). A suite of sample programs that illustrate the use of the SimoBSIO routine is provided on the SimoTime Web Site. SimoBSIO may be compiled and executed using Micro Focus Net Express running on a PC with Microsift Windows (refer to http://www.microfocus.com ).
The callable interface requires a data structure or pass area to be defined. A copy file (PASSBSIO.CPY) is provided with the following source code.
The following is the syntax for calling the byte-stream I/O routine (SIMOBSIO.CBL).
call 'SIMOBSIO' using PSIO-PASS-AREA
A source code listing for SimoBSIO is available for viewing at http://www.simotime.com/simobsio.htm. To download the Simoxxxx members or sample programs that use this callable member refer to the Downloads and Links to Similar Pages section of this document.
The SimoCARD Series is a suite of callable routines that use the standard access methods provided by the COBOL programming language. The routines that access sequential files with 80-byte, fixed length records are written and tested using a COBOL dialect that is OS/390 compliant. The SimoCARD source members may be compiled and executed using Micro Focus COBOL (Net Express) running on a PC with Microsoft Windows (refer to http://www.microfocus.com ). A suite of sample programs that illustrate the use of the SimoCARD routines is provided on the SimoTime Web Site.
The SimoCARD Series includes the following programs
| Program Name | Description. |
| SIMOGR80 | This member provides "Read-Only" access to a Record Sequential file of 80-byte, fixed length records. |
| SIMOGL80 | This member provides "Read-Only" access to a Line Sequential file of 80-byte, fixed length records. |
| SIMOPR80 | This member provides "Write-Only" access to a Record Sequential file of 80-byte, fixed length records. |
| SIMOPL80 | This member provides "Write-Only" access to a Line Sequential file of 80-byte, fixed length records. |
| SIMOXT80 | This member provides translation between EBCDIC and ASCII for a data buffer that is 80-bytes in length. |
The callable interface requires a data structure or pass area to be defined. A copy file is provided with the following source code.
The following is the syntax for calling a SimoCARD Series program.
call 'SIMOxxxx' using xxxx-PASS-AREA
where "xxxx" is GR80, GL80, PR80, PL80 or XT80.
A source code listing for SimoCARD is available for viewing at http://www.simotime.com/simocard.htm. To download the Simoxxxx members or sample programs that use this callable member refer to the Downloads and Links to Similar Pages section of this document.
This program provides an example of how to case conversion of a text string within a field. The example shows how to do the following.
| 0. | Convert a text string to lower case. | |
| 1. | Convert a text string to upper case. | |
| 2. | Capitalize each word in a text string. | |
| 3. | Edit specific words in a text string using pre-defined table values. |
The callable interface requires a data structure or pass area to be defined. A copy file (PASSCASE.CPY) is provided with the following source code.
*****************************************************************
* Data Structure or Pass Area used for calling SIMOCASE. *
*****************************************************************
* Copyright (C) 1987-2010 SimoTime Enterprises *
* All Rights Reserved *
*****************************************************************
* Provided by SimoTime Enterprises *
* Our e-mail address is: helpdesk@simotime.com *
* Also, visit our Web Site at http://www.simotime.com *
*****************************************************************
*
* When CASE-PASS-REQUEST is '1' then
* Do Upper to Lower case conversion
* When CASE-PASS-REQUEST is '2' then
* Do Lower to Upper case conversion
* When CASE-PASS-REQUEST is '3' then
* Do capitalization of each word
* When CASE-PASS-REQUEST is '4' then
* Edit key words from a table
*
01 CASE-PASS-AREA.
05 CASE-PASS-REQUEST PIC X.
05 CASE-PASS-RESULT PIC 9(4).
05 CASE-PASS-STRING-SIZE PIC 9(4).
05 CASE-PASS-BUFFER PIC X(256).
*! PASSCASE - End-of-Copy File...
A source code listing for SimoCASE is available for viewing at http://www.simotime.com/simocase.htm. To download the Simoxxxx members or sample programs that use this callable member refer to the Downloads and Links to Similar Pages section of this document.
This routine will edit the mm-dd-ccyy for reasonability of content and provide various date formats. The following is a list of the functions provided in this example.
| 1. | Accept Gregorian date as input. |
| 2. | Validate the month for 1-12 and create text string (i.e. month 7 is July). |
| 3. | Determine if the year is a leap year. |
| 4. | Vaildate the day for 1-30, 1-31, 1-28 or 1-29 based on month and leap year. |
| 5. | Create a text string for the date (i.e. 2002/01/01 is January 1, 2002) |
| 6. | Create a ccyyddd format for the date (i.e. 2002/04/01 is 2002092) |
| 7. | Calculate days remaining in the year. |
| 8. | Provide an edited Gregorian Date (I.e. 20020915 could be 2002-09-15) |
The callable interface requires a data structure or pass area to be defined. A copy file (PASSDATE.CPY) is provided with the following source code.
*****************************************************************
* Data Structure or Pass Area used for calling SIMODATE. *
*****************************************************************
* Copyright (C) 1987-2010 SimoTime Enterprises *
* All Rights Reserved *
*****************************************************************
* Provided by SimoTime Enterprises *
* Our e-mail address is: helpdesk@simotime.com *
* Also, visit our Web Site at http://www.simotime.com *
*****************************************************************
* STD-REQUEST - This is an eight character data string
* and should contain the following in
* upper case.
* EDITDATE, This keyword causes the date
* routine (SIMODATE) to validate the date
* and provide and edited text string plus
* a julian date and more.
* The calling program must provide the
* above as a request. Otherwise, a non-
* zero return code will be set in the
* following result field. This data string
* is not changed by the date routine.
*
* STD-RESPONSE - This is a four byte binary data string
* and is used by the conversion routine to
* pass a return code. If the date request
* is successful the value in this data
* string will be zero.
*
* STD-MESSAGE-TEXT - If a non-zero response occurs this field
* will contain a short message.
*
* STD-GREGORIAN-4-EDIT - This is the input date field in
* gregorian format that will be vaidated.
* If the gregorian date does not pass the
* editing process a message will be posted
* in the STD-MESSAGE-TEXT field and a
* non-zero value of 16 will be placed in
* the STD-RESPONSE field. SimoDATE is
* somewhat flexible in accepting and
* reformatting a gregorian date. For
* example, the following are acceptable
* and will be reformatted into the
* STD-GREGORIAN-4-EDIT field.
* ccyymmdd This is the preferred format.
* ccyy-mm-dd Special characters may be
* used as separators.
* ccyy-m-d Single digit month and day
* values are acceptable when
* delimiter are used.
* ccyy/m/dd A mixing of single digit
* usage is accepted.
*
* STD-DEBUG-INFO - This data string provides additional
* debugging capability. This may be
* helpful if changes are made to the date
* routine.
*
* STD-LEAP-YEAR-YN - This field is used to identify a leap
* year. A "Y" indicates the input date is
* a leap year. An "N" indicates the input
* year is not a leap year.
*
* STD-MONTH-VERBAGE - This field is used for the text of the
* input month. For example, 1=January,
* 2=February, etc.
*
* STD-MM-DAYS - This field is used for the number of
* days in the input month.
*
* STD-GREGORIAN-DATE - This field is used for the gregorian
* date in ccyymmdd format (all numeric
* values).
*
* STD-JULIAN-DATE - This field is used for the julian date
* in ccyyddd format.
*
* STD-DAYS-REMAINING - The number of days remaining in the
* year.
*
* STD-DATE-VERBAGE - This field is used for the date in text
* format. For example, 19991225 will
* produce a text string of
* December 25, 1999.
*
* STD-DATE-EDIT-BYTE - This field contains the character that
* will be used to edit and format the
* gregorian date. For example, this field
* may contain a space, a dash, a slash,
* etc... and will be used as the delimiter
* between the year, month and day.
*
* STD-DATE-EDITED - This field if for the edited date using
* the delimiter character from the
* preceding field. For example, 19991225
* will produce 1999/12/25 if the delimiter
* character is a slash.
*****************************************************************
*
01 STD-SIMODATE.
05 STD-REQUEST pic X(8).
05 STD-RESPONSE pic 9(4).
05 STD-MESSAGE-TEXT pic X(68).
05 STD-GREGORIAN-4-EDIT pic X(10).
05 STD-EDITED-INFO.
10 STD-DEBUG-INFO pic X(8).
10 STD-LEAP-YEAR-YN pic X.
10 STD-MONTH-VERBAGE pic X(10).
10 STD-MM-DAYS pic 99.
10 STD-GREGORIAN-DATE pic 9(8).
10 STD-JULIAN-DATE pic 9(7).
10 STD-JULIAN-VALUE redefines STD-JULIAN-DATE.
15 STD-JULIAN-CCYY pic 9(4).
15 STD-JULIAN-DAY pic 9(3).
10 STD-DAYS-REMAINING pic 9(3).
10 STD-DATE-VERBAGE pic X(18).
10 STD-DATE-EDIT-BYTE pic X.
10 STD-DATE-EDITED pic X(10).
*! PASSDATE - End-of-Copy File...
The following is the syntax for calling the date routine (SIMODATE.CBL).
call 'SIMODATE' using STD-SIMODATE
A source code listing for SimoDATE is available for viewing at http://www.simotime.com/simodate.htm. To download the Simoxxxx members or sample programs that use this callable member refer to the Downloads and Links to Similar Pages section of this document.
This routine will display the contents of a field in hexadecimal format with the EBCDIC and ASCII translation where possible. Also, the information may be written to a log file or simply passed back to the calling program. The format of the dump information is intended for use when dumping the contents of memory or WORKING-STORAGE. The format of the SimoHEX4 routine routine may be better suited for dumping data file records.
The following shows the format for the output of the SimoDUMP routine.
* SIMODUMP COBOL Hexadecimal Dump Routine v03.01.24 http://www.simotime.com * SIMODUMP Copyright 1987-2010 SimoTime Enterprises, LLC All Rights Reserved * DISPLAY1 Starting... Length = 0026 * Offset Hex..... ........ ........ ........ ebcdic.......... ascii........... * 1-016 C1C2C3C4 C5C6C7C8 C9D1D2D3 D4D5D6D7 ABCDEFGHIJKLMNOP ................ * 17-032 D8D9E2E3 E4E5E6E9 E8E9xxxx xxxxxxxx QRSTUVWZYZ...... ................ * DISPLAY1 Complete... Length = 0026
The callable interface requires a data structure or pass area to be defined. A copy file (PASSDUMP.CPY) is provided with the following source code.
*****************************************************************
* Data Structure or Pass Area used for calling SIMODUMP. *
*****************************************************************
* Copyright (C) 1987-2010 SimoTime Enterprises *
* All Rights Reserved *
*****************************************************************
* Provided by SimoTime Enterprises *
* Our e-mail address is: helpdesk@simotime.com *
* Also, visit our Web Site at http://www.simotime.com *
* *
*****************************************************************
* Values for SIMODUMP-REQUEST *
* DUMP Dump the Buffer in Heaxedecimal format *
* NOTE Display or Write the text to the screen or log file *
* *
* Values for SIMODUMP-SYSOUT *
* SHOW Display dump information on screen *
* FILE Write dump information to the log file (SYSLOG) *
* BOTH Display to screen and write to log file *
* NONE Do not output to screen or file, put dump info in *
* pass area table and return to caller. *
*****************************************************************
01 SIMODUMP-PASS-AREA.
* Initial information is provided by the calling program,
* The SIMODUMP-REQUEST field will be modified to "DUMP" if it
* does not contain a valid entry.
* The SIMODUMP-RESULT field may also be modified by the
* SimoDUMP routine.
05 SIMODUMP-REQUEST PIC X(4).
05 SIMODUMP-RESULT PIC 9999.
* The following are not modified by the SimoDUMP routine...
05 SIMODUMP-DUMP-ID PIC X(8).
05 SIMODUMP-SYSOUT PIC X(4).
05 SIMODUMP-COPYRIGHT PIC X(4).
05 SIMODUMP-LENGTH PIC 9999.
05 SIMODUMP-BUFFER PIC X(128).
* The following are modified by the SimoDUMP routine...
05 SIMODUMP-IDX PIC 99.
05 SIMODUMP-LINES PIC X(80) OCCURS 8 TIMES.
*! PASSDUMP - End-of-Copy File...
A source code listing for SimoDUMP is available for viewing at http://www.simotime.com/simodump.htm. To download this member or other Simoxxxx members or sample programs that use this callable member refer to the Downloads and Links to Similar Pages section of this document.
This is a driver program used with Micro Focus Net Express running on a Windows platform on a Personal Computer. Quite often the COBOL programs may be ported from an IBM Mainframe and were executed from a JCL (Job Control Language) script that passed a parameter. Also, the ability to write to a log file may be required as a replacement for the mainframe spool file function that shows the start, stop and status of the completed or abended job. The following is a sample of the logging or tracking information.
2004/01/20 16:08:32:13 *******************************************************StaMlrE2 2004/01/20 16:08:32:23 Starting JobName StaMlrE2 2004/01/20 16:08:32:33 Identify JobStep StaMlrS1, Set Globals, Delete Previous Files 2004/01/20 16:08:32:46 Identify JobStep StaMlrS2, Extract non-PO Boxes 2004/01/20 16:08:32:55 Starting Program STAMLRC1, parm=NOPOBOX 2004/01/20 16:08:32:74 Finished Program STAMLRC1, RC=0000 2004/01/20 16:08:32:84 Produced DataSet d:\simoNXE4\AN01\datawrk1\MAILTEMP.TXT 2004/01/20 16:08:32:94 Identify JobStep StaMlrS3, Sort by Postal Code 2004/01/20 16:08:33:03 Starting Program CblSrtC1 2004/01/20 16:08:33:12 Finished Program CblSrtC1, RC=0000 2004/01/20 16:08:33:21 Produced DataSet d:\simoNXE4\AN01\datawrk1\MAILSORT.TXT 2004/01/20 16:08:33:31 Identify JobStep StaMlrS4, Create four across labels 2004/01/20 16:08:33:42 Starting Program STAMLRC2 2004/01/20 16:08:33:48 Finished Program STAMLRC2, RC=0000 2004/01/20 16:08:33:58 Produced DataSet d:\SimoNXE4\AN01\DataWrk1\MAILTEXT.TXT 2004/01/20 16:08:33:68 Finished JobName StaMlrE2
The SimoEXEC program will access the command line and process the following requests.
| SIMOEXEC EXEC program-name |
| The preceding statement will
perform the following 1. Write the start-time information to the log file. 2. Call the specified program. 3. Write the stop-time and completion information to log file. |
| SIMOEXEC EXEC program-name PARM=parameter |
| The preceding statement will
perform the following 1. Write the start-time information to the log file. 2. Call the specified program and pass the parameter. 3. Write the stop-time and completion information to log file. Note: Two parameters are actually passed to the called program. This first parameter is a two-byte, binary value that is the length of the parameter. The second parameter is the parameter itself. This format maps to the format of the mainframe when a program is executed using the PARM= function of the EXEC statement of JCL (Job Control Language). |
| SIMOEXEC EXEC SORT |
| 1. Wrtie the start-time
information to the log file. 2. Perform the sort using MFSORT 3. Write the stop-time and completion information to log file. |
| SIMOEXEC NOTE message-text |
| Write the message-text preceded by a date and time stamp to the log file. |
Please note that programs with a STOP RUN will terminate the process without logging.
A source code listing for SimoEXEC is available for viewing at http://www.simotime.com/simoexec.htm. To download the Simoxxxx members or sample programs that use this driver program refer to the Downloads and Links to Similar Pages section of this document.
This routine will display the contents of a field in hexadecimal format with the EBCDIC and ASCII translation where possible. Also, the information may be written to a log file or simply passed back to the calling program. The format of the dump information is intended for use when dumping the contents of data file records. Tthe format of the SimoDUMP routine may be better suited for dumping memory or WORKING-STORAGE.
The following shows the format for the output of the SimoHEX4 routine that was executed in an ASCII environment..
....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 I am record 005 of TXTHEXT1.TXT - *.Tab01.Tab02.tab03 4266276667623332662555445532555222205663305663307663322222222222222222222222222 901D0253F2400050F6048485841E4840D0A94120194120294120300000000000000000000000000 ../_....?.......?..................../...../...../.............................
The following shows the format for the output of the SimoHEX4 routine that was executed in an EBCDIC environment..
* TXTHEXC1 HEX-Dump of TEXT Data Set v04.01.14 http://www.simotime.com * TXTHEXC1 Copyright 1987-2010 SimoTime Enterprises, LLC All Rights Reserved ....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 .@..@......@...@..@........K...@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ C48949889984FFF4984EEECCEEF4EEE444444444444444444444444444444444444444444444444 901409536940001066037385731B373000000000000000000000000000000000000000000000000 I am record 001 of TXTHEXT1.TXT
The callable interface requires a data structure or pass area to be defined. A copy file (PASSHEX4.CPY) is provided with the following source code.
*****************************************************************
* Data Structure or Pass Area used for calling SIMOHEX4. *
*****************************************************************
* Copyright (C) 1987-2010 SimoTime Enterprises *
* All Rights Reserved *
*****************************************************************
* Provided by SimoTime Enterprises *
* Our e-mail address is: helpdesk@simotime.com *
* Also, visit our Web Site at http://www.simotime.com *
*****************************************************************
* PASSHEX4-REQUEST - This must contain the following value. *
* DUMP, Dump Buffer in Hexadecimal format. *
* PASSHEX4-RESULT - Zero indicates a successful completion. *
* Non-Zero indicates a failure in processing *
* the request. *
* PASSHEX4-LENGTH - Specifies the length of the text strings *
* for the PASSHEX4-SOURCE. If the length
* exceeds 1024 then it will be reset to 128. *
* PASSHEX4-SOURCE - This is the input field for the SimoHEX4 *
* routine. This field will not be modified. *
* The contents will be translated into a *
* haxadecimal format and the results of the *
* translation will be placed in the *
* following fields. *
* PASSHEX4-ASCII - This is a translation of possible ASCII. *
* PASSHEX4-UPPER - This is leftmost (or high order) nibble. *
* PASSHEX4-LOWER - This is rightmost (or low order) nibble. *
* PASSHEX4-EBCDIC - This is a translation of possible EBCDIC. *
*****************************************************************
01 PASSHEX4-PASS-AREA.
* The following are provided by the calling program,
05 PASSHEX4-REQUEST PIC X(4).
* The PASSHEX4-RESULT may be modified by SimoHEX4...
05 PASSHEX4-RESULT PIC 9(4).
05 PASSHEX4-LENGTH PIC 9(5).
05 PASSHEX4-SOURCE PIC X(1024).
* The following are modified by SimoHEX4...
05 PASSHEX4-DUMP-INFO.
10 PASSHEX4-ASCII PIC X(1024).
10 PASSHEX4-UPPER PIC X(1024).
10 PASSHEX4-LOWER PIC X(1024).
10 PASSHEX4-EBCDIC PIC X(1024).
*! PASSHEX4 - End-of-Copy File...
A source code listing for SimoDUMP is available for viewing at http://www.simotime.com/simohex4.htm. To download this member or other Simoxxxx members or sample programs that use this callable member refer to the Downloads and Links to Similar Pages section of this document.
This program provides an example of how to justify or position a text string within a field. The example shows how to do the following.
| 1. | Center a text string in a field. |
| 2. | Right justify a text string within a field. |
| 3. | Left justify a text string within a field. |
The callable interface requires a data structure or pass area to be defined. A copy file (PASSJUST.CPY) is provided with the following source code.
*****************************************************************
* Data Structure or Pass Area used for calling SIMOJUST. *
*****************************************************************
* Copyright (C) 1987-2010 SimoTime Enterprises *
* All Rights Reserved *
*****************************************************************
* Provided by SimoTime Enterprises *
* Our e-mail address is: helpdesk@simotime.com *
* Also, visit our Web Site at http://www.simotime.com *
*****************************************************************
01 JUST-PASS-AREA.
05 JUST-REQUEST PIC X(8).
05 JUST-RESPOND PIC 9(4).
05 JUST-SOURCE PIC X(60).
05 JUST-TARGET PIC X(60).
*! PASSJUST - End-of-Copy File...
A source code listing for SimoJUST is available for viewing at http://www.simotime.com/simojust.htm. To download the Simoxxxx members or sample programs that use this callable member refer to the Downloads and Links to Similar Pages section of this document.
This program provides an example of how to display text messages to the screen and write the information to a log file. When the text message is written to a log file it is preceded by a date and time stamp.
The callable interface requires a data structure or pass area to be defined. A copy file (PASSLOGS.CPY) is provided with the following source code.
*****************************************************************
* Data Structure or Pass Area used for calling SIMOLOGS. *
*****************************************************************
* Copyright (C) 1987-2010 SimoTime Enterprises *
* All Rights Reserved *
*****************************************************************
* Provided by SimoTime Enterprises *
* Our e-mail address is: helpdesk@simotime.com *
* Also, visit our Web Site at http://www.simotime.com *
*****************************************************************
* SIMOLOGS-REQUEST Type of request, must be one of the *
* following values. *
* BOTH - Display message on the console, *
* Write message to the SYSLOG file. *
* FILE - Write message to the SYSLOG file. *
* NOTE - Display message on the console, *
* Write message to the SYSLOG file. *
* SHOW - Display message on the console. *
* SIMOLOGS-STATUS This is an indicator as to the success *
* or failure of the request. A value of *
* zero (0000) indicates the routine was *
* successful. A non-zero value indicates *
* a failure. *
* SIMOLOGS-MESSAGE Contains the message text. *
*****************************************************************
01 SIMOLOGS-PASS-AREA.
05 SIMOLOGS-REQUEST pic X(4).
05 SIMOLOGS-STATUS pic 9999.
05 SIMOLOGS-MESSAGE pic X(1024).
*! PASSLOGS - End-of-Copy File...
Note: The maximum length for the message text is 1,024 characters.
A source code listing for SimoLOGS is available for viewing at http://www.simotime.com/simologs.htm. To download the Simoxxxx members or sample programs that use this callable member refer to the Downloads and Links to Similar Pages section of this document.
This Windows Command File may be called from other command files and will display a string of message text to the screen and write to a log file in a consistent, predefined format. The log file function provides a way to review the results of running a command file that was scheduled and executed in an unattended environment. Prior to writing a message to the log file a date and time stamp is inserted in front of the message text. This command file is intended to be called by other command files and used in the Microsoft Windows environment
The call interface is as follows.
call SimoNOTE "This is my message..."
The message text that is between the double quotes will be displayed to the screen and wriiten to a log file. The log file name and location may be defined by setting the SimoNOTE environment variable as shown in the following example. If the SimoNOTE environment variable is not set then the default is to write to the following log file.
set SimoNOTE=c:\SimoLIBR\LOGS\SimoTime.LOG
The following (IVP4NOTE.CMD) is the source code for the Installation Verification Procedure.
@echo OFF
rem * *******************************************************************
rem * This program is provided by: *
rem * SimoTime Enterprises, LLC *
rem * (C) Copyright 1987-2010 All Rights Reserved *
rem * Web Site URL: http://www.simotime.com *
rem * e-mail: helpdesk@simotime.com *
rem * *******************************************************************
rem *
rem * Text - Installation Verification Program (IVP) for SimoNOTE.CMD.
rem * Author - SimoTime Enterprises
rem *
rem * This command line script will display messages to the screen and
rem * write the messages to a log file. This script will call SimoNOTE
rem * to do the actual display and write to the log file.
rem *
rem * Note: the message text must be enclosed in double quotes. This
rem * will allow embedded spaces in the message text. If the
rem * double quotes are not used the message will be truncated
rem * after the first space character.
rem *
rem * Note: prior to writing to the log file the SimoNOTE procedure
rem * will insert a date and time stamp at the front of the
rem * message text.
rem *
setlocal
set SimoNOTE=c:\SimoLIBR\LOGS\Ivp4NOTE.TXT
if exist %SimoNOTE% erase %SimoNOTE%
rem *
call SimoNOTE "*******************************************************Ivp4NOTE"
call SimoNOTE "Starting JobName Ivp4NOTE, User is %USERNAME%"
rem *
call SimoNOTE "Executing the Installation Verification Procedure for SIMONOTE"
rem *
call SimoNOTE "Conclude The log file is %SimoNOTE%"
rem *
call SimoNOTE "Finished JobName Ivp4NOTE, User is %USERNAME%"
if not "%1" == "nopause" start NotePAD %SimoNOTE%
endlocal
if not "%1" == "nopause" pause
A source code listing for SimoNOTE and additional information on usage is available for viewing at http://www.simotime.com/simonote.htm. To download the SimoMODS shared modules or sample programs that use this callable shared modules refer to the Downloads and Links to Similar Pages section of this document.
This program provides an example of how to share a data area between programs that are executing in a single Micro Focus Run Unit. This routine is provided for the batch environment.
The callable interface requires a data structure or pass area to be defined. A copy file (PASSPARK.CPY) is provided with the following source code.
*****************************************************************
* Data Structure or Pass Area used for calling SIMOPARK. *
*****************************************************************
* Copyright (C) 1987-2010 SimoTime Enterprises *
* All Rights Reserved *
*****************************************************************
* Provided by SimoTime Enterprises *
* Our e-mail address is: helpdesk@simotime.com *
* Also, visit our Web Site at http://www.simotime.com *
*****************************************************************
*
* When PARK-PASS-REQUEST is 'S' then
* Save Linkage Buffer in SimoPARK's Working Storage
* When PARK-PASS-REQUEST is 'R' then
* Retreive from SimoPARK's Working Storage to Linkage Section
*
01 PARK-PASS-AREA.
05 PARK-PASS-REQUEST PIC X.
05 PARK-PASS-RESULT PIC 9(4).
05 PARK-PASS-BUFFER PIC X(256).
*! PASSPARK - End-of-Copy File...
A source code listing for SimoSUB1 is available for viewing at http://www.simotime.com/simopark.htm. To download the Simoxxxx members or sample programs that use this callable member refer to the Downloads and Links to Similar Pages section of this document.
This program provides an example of how to parse keywords within a field and then access each keyword using the "Reference Modification" feature of the COBOL language.
The callable interface requires a data structure or pass area to be defined. A copy file (PASSPARS.CPY) is provided with the following source code.
*****************************************************************
* Data Structure used for calling SIMOPARS. *
*****************************************************************
* Copyright (C) 1987-2010 SimoTime Enterprises *
* All Rights Reserved *
*****************************************************************
* Provided by SimoTime Enterprises *
* Our e-mail address is: helpdesk@simotime.com *
* Also, visit our Web Site at http://www.simotime.com *
*****************************************************************
* *
* PRS-REQUEST Type of request, must be zero (0) for *
* parsing. This item is provided by the *
* calling program and is not modified *
* by the parsing routine. *
* PRS-STATUS This is an indicator as to the success *
* or failure of the request. A value of *
* zero (0000) indicates the routine was *
* successful. A non-zero value indicates *
* a failure. *
* *
* ------------------------------------------------------------- *
* The following fields are provided by the calling routine. *
* *
* PRS-DELIMITER This is a one byte character that is *
* used as a delimiter. This item is *
* provided by the calling program and *
* is not modified by the parsing routine. *
* *
* PRS-KEEP-NULL-FIELDS This must be a Yes (Y) or No (N) value *
* (Y) will indicate a Yes, keep null field *
* (N) will indicate a No and null fields *
* will be dropped. *
* PRS-SUSPEND This must be a Yes (Y) or No (N) value *
* to indicate that the suspend/resume *
* function of checking for a delimiter *
* is active. *
* PRS-SUSPEND-BYTE If the previous parameter is (Y) this *
* byte will be used to suspend or resume *
* the testing for a delimiter charcter. *
* PRS-TERMINATOR This must be a Yes (Y) or No (N) value *
* to indicate a character that will be *
* used for termination of the parsing. *
* If (Y) then the next parameter is used *
* as a termination character. If (N) the *
* buffer will be parsed according to the *
* size of the buffer or maximum number *
* of table entries. This item is provided *
* by the calling program and is not *
* modified by the parsing routine. *
* PRS-TERMINATOR-BYTE If the previous parameter is (Y) this *
* byte will be used to terminate the *
* parsing when it is encountered in the *
* data string. This item is provided by *
* the calling program and is not modified *
* by the parsing routine. *
* *
* PRS-BUFFER-SIZE The size of the data string to be *
* parsed and must be a value of 1-1024. *
* This item is provided by the calling *
* program and is not modified by the *
* parsing routine. *
* PRS-BUFFER This is the data string or field that *
* will be parsed. This item is provided *
* by the calling program and is not *
* modified by the parsing routine. *
* *
* PRS-TABLE-MAX The maximum number of table entries *
* available for the POSITION/SIZE values *
* of the words in the input buffer. *
* This item is provided by the calling *
* program and is not modified by the *
* parsing routine. *
* *
* ------------------------------------------------------------- *
* The following fields are updated by the parsing routine. *
* *
* PRS-NUMBER-OF-ITEMS This is the number of keywords found *
* in the input data string. This item is *
* provided by the parsing routine. *
* *
* PRS-LAST-SIG-BYTE This is the position of the last *
* significant, non-delimiter byte. If the *
* PRS-TERMINATOR is "Y" this will be the *
* last significant byte before the *
* terminator byte. *
* *
* PRS-POSITION This is a table of 64 elements of *
* 4-bytes. The value is either zero (0) *
* or the position of a keyword within the *
* input data string. The first position *
* within the buffer is one (1). *
* This item is provided by the parsing *
* routine. *
* PRS-SIZE This is a table of 64 elements of *
* 4-bytes. The value is either zero (0) *
* or the size of a keyword within the *
* input data string. This item is provided *
* by the parsing routine. *
* *
* ------------------------------------------------------------- *
* NOTE... The table element number is the number *
* of the word within the data buffer. *
* The data buffer is PRS-BUFFER. *
* For example, PRS-POSITION(1) would point *
* to the position of the first character *
* of the first word in the data buffer *
* PRS-SIZE(1) would specify the number of *
* characters in the first word. *
* *
*****************************************************************
01 PRS-PARAMETERS.
05 PRS-REQUEST PIC X VALUE '0'.
05 PRS-STATUS PIC 9(4).
*! Provided by the calling program...
05 PRS-DELIMITER PIC X VALUE SPACE.
05 PRS-KEEP-NULL-FIELDS PIC X VALUE 'N'.
05 PRS-SUSPEND PIC X VALUE 'N'.
05 PRS-SUSPEND-BYTE PIC X VALUE SPACE.
05 PRS-TERMINATOR PIC X VALUE 'N'.
05 PRS-TERMINATOR-BYTE PIC X VALUE SPACE.
05 PRS-BUFFER-SIZE PIC 9(4) VALUE 1024.
05 PRS-BUFFER PIC X(1024).
05 PRS-TABLE-MAX PIC 9(4) VALUE 64.
*! Updated by the parsing routine...
05 PRS-NUMBER-OF-ITEMS PIC 9(4) VALUE 0.
05 PRS-LAST-SIG-BYTE PIC 9(4) VALUE 0.
05 PRS-POSITION OCCURS 64 TIMES
PIC 9(4) VALUE 0.
05 PRS-SIZE OCCURS 64 TIMES
PIC 9(4) VALUE 0.
*! PASSPARS - End-of-Copy File...
A source code listing for SimoSUB1 is available for viewing at http://www.simotime.com/simopars.htm. To download the Simoxxxx members or sample programs that use this callable member refer to the Downloads and Links to Similar Pages section of this document.
This program provides an example of how to right-adjust and zero fill a string of digits within a field..
The callable interface requires a data structure or pass area to be defined. A copy file (PASSRA12.CPY) is provided with the following source code.
*****************************************************************
* Data Structure or Pass Area used for calling SIMORA12. *
*****************************************************************
* Copyright (C) 1987-2010 SimoTime Enterprises *
* All Rights Reserved *
*****************************************************************
* Provided by SimoTime Enterprises *
* Our e-mail address is: helpdesk@simotime.com *
* Also, visit our Web Site at http://www.simotime.com *
*****************************************************************
01 RA12-PASS-AREA.
05 RA12-REQUEST PIC X(8).
05 RA12-RESPOND PIC 9(4).
05 RA12-BUFFER.
10 RA12-NUMBER PIC 9(12).
*! PASSRA12 - End-of-Copy File...
A source code listing for SimoRA12 is available for viewing at http://www.simotime.com/simora12.htm. To download the Simoxxxx members or sample programs that use this callable member refer to the Downloads and Links to Similar Pages section of this document.
The SimoSNAP routine (or callable program) is a callable memory dump routine for a linear area of memory. Its primary purpose is to dump the working storage section of a program but may be used to dump other areas of memory or partial areas of working storage. A secondary purpose is to calcualte the size of the memory area.
The callable module (SIMOSNAP) is used to determine the size and dump the content of a COBOL program's WORKING-STORAGE section in a Hex-dump format. The SIMOSNAP routine is intended to be used by application programs currently running on a Linux, UNIX or Windows (LUW) system with Micro Focus. A sample program (CBSNAPC1.CBL) is provided and describes the details of calling and reviewing the output of the snap-dump routine.
The callable interface requires a data structure or pass area to be defined.
The following statement is used to call the snap-dump display routine.
call 'SIMOSNAP' using STSNAP-START STSNAP-CEASE
Two copy files will need to be placed at the beginning and end of the WORKING-STORAGE memory to be dumped. It is important to note that SimoSNAP will only dump a contiguos block of memory.
The 1st copy file (STSNAPB1.CPY) defines the starting point for the memory dump and serves as an eye-catcher when reviewing the dump..
*****************************************************************
* Copy File for SnapDump Start of Working Storage. *
*****************************************************************
* Copyright (C) 1987-2010 SimoTime Enterprises *
* All Rights Reserved *
*****************************************************************
* Provided by SimoTime Enterprises *
* Our e-mail address is: helpdesk@simotime.com *
* Also, visit our Web Site at http://www.simotime.com *
*****************************************************************
01 STSNAP-START.
05 FILLER pic X(16) value 'STSNAP-START-TAG'.
*! STSNAPB1 - End-of-Copy File...
The 2nd copy file (STSNAPB2.CPY) defines the ending point for the memory dump and serves as an eye-catcher when reviewing the dump..
*****************************************************************
* Copy File for SnapDump Start of Working Storage. *
*****************************************************************
* Copyright (C) 1987-2010 SimoTime Enterprises *
* All Rights Reserved *
*****************************************************************
* Provided by SimoTime Enterprises *
* Our e-mail address is: helpdesk@simotime.com *
* Also, visit our Web Site at http://www.simotime.com *
*****************************************************************
01 STSNAP-CEASE.
05 FILLER pic X(16) value 'STSNAP-CEASE-TAG'.
*! STSNAPB2 - End-of-Copy File...
A source code listing for SimoSNAP is available for viewing at http://www.simotime.com/simosnap.htm.
To download the SimoMODS members or sample programs that use this callable member refer to the Downloads and Links to Similar Pages section of this document.
This program provides an example of how to access and display a File Status Code after an attempted file access in a COBOL program.
The callable interface requires a data structure or pass area to be defined.
The following statements are used to call the file status conversion routine.
move '35' to FSPA-STATUS-CODE-02
call 'SIMOSTAT' using FILE-STATUS-PASS-AREA
Upon return from the call to SIMOSTAT the contents of the fields in the pass area will contain the following information.
FSPA-STATUS-CODE-02 = 35 FSPA-STATUS-CODE-04 = 0035 FSPA-TEXT-MESSAGE = 0035, OPEN failure, specified file not found
A copy file (PASSSTAT.CPY) defines the fields within the pass area.
01 FILE-STATUS-PASS-AREA.
05 FSPA-STATUS-CODE-02 PIC X(2).
05 FSPA-STATUS-CODE-04 PIC X(4).
05 FSPA-TEXT-MESSAGE PIC X(80).
A second copy file (TAB4STAT.CPY) is provided that contains a table of File Status Codes with a brief description.
A source code listing for SimoSTAT is available for viewing at http://www.simotime.com/simostat.htm. To download the Simoxxxx members or sample programs that use this callable member refer to the Downloads and Links to Similar Pages section of this document.
This program provides an example of how to replace a text string within a fixed-length field with a text string of a different length.
The callable interface requires a data structure or pass area to be defined. A copy file (PASSSUB1.CPY) is provided with the following source code.
*****************************************************************
* Data Structure or Pass Area used for calling SIMOSUB1. *
*****************************************************************
* Copyright (C) 1987-2010 SimoTime Enterprises *
* All Rights Reserved *
*****************************************************************
* Provided by SimoTime Enterprises *
* Our e-mail address is: helpdesk@simotime.com *
* Also, visit our Web Site at http://www.simotime.com *
*****************************************************************
* SUB-BUFFER-SOURCE - This field contains the text with data *
* to be replaced. This field is not *
* modified by the SimoSUB1 routine. *
* SUB-BUFFER-TARGET - This field contains the text with data *
* that will be modofied by the SimoSUB1 *
* routine. *
* SUB-SEARCH-STRING - This field contains the text string for *
* the search value. *
* SUB-REPLACE-STRING - This field contains the text string for *
* the replace value. *
* SUB-SEARCH-LENGTH - This field defines the length of the *
* search string. *
* SUB-REPLACE-LENGTH - This field defines the length of the *
* replace value. *
*****************************************************************
01 SUBSTITUTE-PARAMETERS.
05 SUB-BUFFER-SOURCE pic X(256).
05 SUB-BUFFER-TARGET pic X(320).
05 SUB-SEARCH-STRING pic X(48).
05 SUB-REPLACE-STRING pic X(48).
05 SUB-SEARCH-LENGTH pic 9(2).
05 SUB-REPLACE-LENGTH pic 9(2).
*! PASSSUB1 - End-of-Copy File...
The following will replace or substitute the value "abc" with the value 'xyz". All remaining characters remain unchanged
* Example 1, Replace a text string with a text string
* of equal size.
move 'abc' to SUB-STRING-OLD
move 'xyz' to SUB-STRING-NEW
add 3 to ZERO giving LENGTH-OF-OLD
add 3 to ZERO giving LENGTH-OF-NEW
call 'SIMOSUB1' using SUBSTITUTE-PARAMETERS
The following will replace or substitute the value "abc" with the value 'uvwxyz". All remaining characters to the right of the substitution will be shifted accordingly. It is possible to truncate characters if the size of the field is too small to hold the new value.
* Example 2, Replace a text string with a text string
* of greater size.
move 'abc' to SUB-STRING-OLD
move 'uvwxyz' to SUB-STRING-NEW
add 3 to ZERO giving LENGTH-OF-OLD
add 6 to ZERO giving LENGTH-OF-NEW
call 'SIMOSUB1' using SUBSTITUTE-PARAMETERS
The following will replace or substitute the value "abc" with the value 'M". All remaining characters to the right of the substitution will be shifted accordingly. The rightmost positions will be padded with spaces.
* Example 3, Replace a text string with a text string
* of smaller size.
move 'abc' to SUB-STRING-OLD
move 'M' to SUB-STRING-NEW
add 3 to ZERO giving LENGTH-OF-OLD
add 1 to ZERO giving LENGTH-OF-NEW
call 'SIMOSUB1' using SUBSTITUTE-PARAMETERS
A source code listing for SimoSUB1 is available for viewing at http://www.simotime.com/simosub1.htm. To download the Simoxxxx members or sample programs that use this callable member refer to the Downloads and Links to Similar Pages section of this document.
The SimoTXTN routine will create a 150-character text data string from a 12-digit numeric field. For example, if the numeric field contains 000000001234 then a text string is created with the following information.
One-Thousand-Two-Hundred-Thirty-Four
The callable interface requires a data structure or pass area to be defined. A copy file (PASSTXTN.CPY) is provided with the following source code.
*****************************************************************
* Data Structure used for calling SIMOTXTN *
*****************************************************************
* Copyright (C) 1987-2010 SimoTime Enterprises *
* All Rights Reserved *
*****************************************************************
* Provided by SimoTime Enterprises *
* Our e-mail address is: helpdesk@simotime.com *
* Also, visit our Web Site at http://www.simotime.com *
*****************************************************************
*
* The following is a summary of the fields used as linkage items.
*
* TXN-PASS-REQUEST This is an eight character data string
* and should contain one of the following
* in upper case.
* DECIMAL0 - The numeric data string has
* zero decimal positions.
* DECIMAL2 - The numeric data string has
* two decimal positions.
* TXN-PASS-RESULT Zero Request was successful
* non-Zero Request was invalid or failed
* TXN-PASS-DIGITS Numeric field provided by caller
* TXN-PASS-TXT-DELIMITER Character used between words in text
* TXN-PASS-TXT-SUFFIX A word that is appended to text string
* TXN-PASS-TXT-LENGTH Length of text within text field
* TXN-PASS-TXT Text string created by conversion
* TXN-PASS-NUM-SYMBOL Character used to insert in front
* of the edited numeric amount string.
* TXN-PASS-NUM-LEFT-EDITED The numeric field edited for decimal,
* comma and currency symbol.
* TXN-PASS-NUM-RIGHT-ADJUST The numeric field right adjusted.
*
*****************************************************************
01 TXN-PASS-AREA.
* Control Information provided by calling program,
* the TXN-PASS-RESULT field may be modified by SimoTXTN.
05 TXN-PASS-REQUEST PIC X(8).
05 TXN-PASS-RESULT PIC 9(4).
05 TXN-PASS-DIGITS PIC 9(12).
05 TXN-PASS-DIGITS-R redefines TXN-PASS-DIGITS
PIC X(12).
* Textual specifications supplied by calling program.
05 TXN-PASS-TXT-DELIMITER PIC X.
05 TXN-PASS-TXT-SUFFIX PIC X(16).
* Textual length and word string supplied by SimoTXTN routine.
05 TXN-PASS-TXT-LENGTH PIC 9(3).
05 TXN-PASS-TXT PIC X(150).
* Numeric editing currency symbol supplied by calling program.
05 TXN-PASS-NUM-SYMBOL PIC X.
* Left-justified with currency, commas, and decimal point,
* supplied by SimoTXTN routine.
05 TXN-PASS-NUM-LEFT-EDITED PIC X(17).
* Right-justified numeric value supplied by SimoTXTN.
05 TXN-PASS-NUM-RIGHT-ADJUST PIC 9(12).
*! PASSTXTN - End-of-Copy File...
The following will translate a twelve digit field of "000000001898" to a 150 byte field of text..
*****************************************************************
* The coding required to do the call to the Numbers-to-Words *
* is as follows. *
*****************************************************************
move 'DECIMAL2' to TXN-PASS-REQUEST
move '000000001898' to TXN-PASS-DIGITS-R
move '-' to TXN-PASS-TXT-DELIMITER
move 'Dollars ' to TXN-PASS-TXT-SUFFIX
move '$' to TXN-PASS-NUM-SYMBOL
call 'SIMOTXTN' using TXN-PASS-AREA
In the preceding example the contents of TXN-PASS-TEXT will be "Eighteen-and-98/100-Dollars" upon return from the call to SIMOTXTN. Also, the TXN-PASS-NUM-LEFT-EDITED field will contain "$18.98", the value will be left-justified with trailing spaces.
A source code listing for SimoTXTN is available for viewing at http://www.simotime.com/simotxtn.htm. To download the Simoxxxx members or sample programs that use this callable member refer to the Downloads and Links to Similar Pages section of this document.
SimoVREC is written and tested using the Micro Focus COBOL dialect. A suite of sample programs that illustrate the use of the SimoVREC routine is provided on the SimoTime Web Site. SimoVREC may be compiled and executed using Micro Focus Net Express running on a PC with Microsift Windows (refer to http://www.microfocus.com ).
The callable interface requires a data structure or pass area to be defined. A copy file (PASSVREC.CPY) is provided with the following source code.
The following is the syntax for calling the routine (SIMOVREC.CBL) that accesses a file with variable length records that is in a mainframe format. The input file was downloaded using FTP and the BINARY mode.
call 'SIMOVREC' using PASSVREC-AREA
A source code listing for SimoVREC is available for viewing at http://www.simotime.com/simovrec.htm. To download the SimoVREC members or sample programs that use this callable member refer to the Downloads and Links to Similar Pages section of this document.
The purpose of this suite of programs is to provide callable routines and/or driver programs to perform business functions, application programming functions or debugging functions.
Permission to use, copy, modify and distribute this software for any commercial purpose requires a fee to be paid to Simotime Enterprises. 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 Enterprises.
Permission to use, copy, modify and distribute this software for a 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 Enterprises.
SimoTime Enterprises makes no warranty or representations about the suitability of the software for any purpose. It is provided "AS IS" without any express or implied warranty, including the implied warranties of merchantability, fitness for a particular purpose and non-infringement. SimoTime Enterprises 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.
The SimoMODS suite of programs, this documentation, the Installation Verification Procedures (IVP's) and examples are provided electronically or on a Compact Disk (CD) with a predefined SETUP procedure. Additional information about acquiring SimoMODS may be obtained by contacting the helpdesk@simotime.com or refer to the Product Availability and Pricing document.
For more information or downloading of the SimoMODS shared modules for evaluation purposes only simply click on one of the following items.
| 1. | Download an evaluation copy of the executables for the shared modules |
| 2. | Download an evaluation copy of the source code for the shared modules |
| 3. | View the complete list of downloadable SimoTime examples and evaluation software |
For information about additional modules look at The SimoCARD Suite for programs and callable routines that access "Card Image" file or sequential files with eighty (80) byte logical records.
Note: You must be attached to the Internet to download a Z-Pack or view the list.
The following is a list of examples that use the various SimoMODS callable routines or driver programs.
|
||||||||||||||||||||||||||||||||||||||||
| A list of examples that use the various SimoMODS callable routines or driver programs |
The following is a list of examples that may be useful when running many of the sample programs provided by SimoTime Enterprises.
| 1. | This item will provide a link to an ASCII or EBCDIC translation table. A column for decimal, hexadecimal and binary is also included. |
| 2. | This document provides a quick summary of the File Status Key for VSAM data sets and QSAM files. |
| 3. | Check out The SimoTime Library for a wide range of topics for Programmers, Project Managers and Software Developers. |
| 4. | To review all the information available on this site start at The SimoTime Home Page . |
Check out The SimoTime Glossary for a list of terms and definitions used in the documents provided by SimoTime.
If you have any questions, suggestions or comments please call or send an e-mail to: helpdesk@simotime.com
We appreciate your comments and feedback.
Founded in 1987, SimoTime Enterprises 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. This includes the smallest thin client using the Internet and the very large mainframe systems. There is more to making the Internet work for your company's business than just having a nice looking WEB site. It is about combining the latest technologies and existing technologies with practical business experience. It's about the business of doing business and looking good in the process. 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. 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 |
| Copyright © 1987-2010 SimoTime Enterprises All Rights Reserved |
| When technology complements business |
| http://www.simotime.com |