Alphabetic Conversion Upper and Lower Case |
The SimoTime Home Page |
This is an example of how COBOL can do case conversion of alpha-numeric data within a field (or text string). The four basic functions provided are as follows.
| ||||||||||
List of Case Conversion or Capitalizations Functions for SIMOCASE |
The example shows a simple conversion between upper and lower case plus capitalization and editing of specific words within a text string. Both COBOL programs were written and tested using the VS COBOL II dialect. Also, both COBOL programs will work with COBOL for MVS and COBOL/370. JCL members are provided to run the jobs as MVS batch jobs on an IBM mainframe or as a project with Micro Focus Mainframe Express (MFE) running on a PC with Windows http://www.microfocus.com ). Also, CMD members are provided to run the jobs with Micro Focus Net Express running on a PC with Windows.
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
The callable interface requires a data structure to be defined. A copy file (PASSCASE.CPY) is provided with the following source code.
***************************************************************** * PASSCASE is a COBOL Copy File * * Data Structure or Pass Area used for calling SIMOCASE. * ***************************************************************** * 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 * ***************************************************************** * * When CASE-PASS-REQUEST * is '0' Do Upper to Lower case conversion * is '1' Do Lower to Upper case conversion * is '2' Do capitalization of each word * is '3' Do 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 - - - - - - - - - - - PASSCASE * ***************************************************************** *
The input text string is moved to CASE-PASS-BUFFER before the call to SIMOCASE. After returning from the call with the CASE-PASS-REQUEST set to a value of '0' or ZERO a lower case text string will be returned in CASE-PASS-BUFFER.
| ||||||
Simple Conversion between Upper and Lower Case |
The input text string is moved to CASE-PASS-BUFFER before the call to SIMOCASE. After returning from the call with the CASE-PASS-REQUEST set to a value of '2' a lower case text string with each word capitalized will be returned in CASE-PASS-BUFFER.
| ||||||
Capitalize Each Word in a Text String |
The input text string is moved to CASE-PASS-BUFFER before the call to SIMOCASE. After returning from the call with the CASE-PASS-REQUEST set to a value of '3' a lower case text string with each word capitalized and specific words modified based on an internal table will be returned in CASE-PASS-BUFFER. Notice in the following example the second occurrence of "the" is not capitalized.
| ||||||
Edit Specific Words in a Text String |
There are two (2) Windows Command files provided with this suite of sample programs. The first Command file will execute the sample programs that do the actual case conversions.
The second Command file is used to create a file that contains records with text strings that will be converted by the case conversion sample programs. This Command file should be executed at least once prior to attempting to execute the sample programs.
The following is the Windows Command file (CASECRE1.cmd) that is required to run as a job on a PC using Micro Focus Net Express.
@echo OFF rem * ******************************************************************* rem * CASECRE1.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 - Read a file of text info, do case convert, write output. rem * Author - SimoTime Technologies rem * Date - January 24, 1996 rem * rem * The job will read an 80-byte file that contains text string rem * information. The job will also write a file containing the results rem * of the case conversion requests. rem * rem * This set of programs will run on a mainframe under MVS or on a rem * Personal Computer with Windows and Micro Focus Net Express. rem * rem * ************ rem * * CaseCrE1 * rem * ********cmd* rem * * rem * * rem * ************ rem * * run **** rem * *********es* * rem * * * rem * * ************************** rem * * * rem * * ************ ************ ************ rem * * * CASEGET1 ******* CaseCrIO ******* CASEPUT1 * rem * * *******rseq* ********cbl* *******rseq* rem * * * rem * * ************ rem * * * SIMOCASE * rem * * ********cbl* rem * * rem * ************ rem * * EOJ * rem * ************ rem * rem * ******************************************************************* rem * Step 1 of 3 Delete any previously created files... rem * set CmdName=CaseCrIO call ..\Env1BASE %CmdName% if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG rem * call SimoNOTE "*******************************************************%CmdName%" call SimoNOTE "Starting CmdName %CmdName%" :DeleteQSAM call SimoNOTE "StepInfo Delete previously created file" set CASEGET1=%BaseLib1%\DATA\Asc1\CASERS80.DAT set CASEPUT1=%BaseLib1%\DATA\Wrk1\CASEPUT1.DAT if exist %CASEPUT1% del %CASEPUT1% rem * rem * ******************************************************************* rem * Step 2 of 3, Convert input, create a new output file... rem * :ExecuteCASEifyRoutine call SimoNOTE "StepInfo Execute the CASE Conversion Program" run CaseCrIO if not ERRORLEVEL = 0 set JobStatus=0020 if not %JobStatus% == 0000 goto :EojNok call SimoNOTE "DataTake %CASEGet1%" call SimoNOTE "DataMake %CASEPUT1%" rem * rem * ******************************************************************* rem * Step 3 of 3, Convert Record Sequential File to ASCII/TEXT file... rem * call SimoNOTE "StepInfo Convert RSEQ to LSEQ" set GETRS080=%CASEPUT1% set PUTLS080=%BaseLib1%\DATA\Wrk1\CASETXT2.TXT if exist %PUTLS080% del %PUTLS080% run CV80ARAL if not "%ERRORLEVEL%" == "0" set JobStatus=0030 if not %JobStatus% == 0000 goto :EojNok call SimoNOTE "DataTake %GETRS080%" call SimoNOTE "DataMake %PUTLS080%" rem * :EojAok call SimoNOTE "Finished JobName %CmdName%, Job Status is %JobStatus%" goto :End :EojNok call SimoNOTE "ABENDING JobName %CmdName%, Job Status is %JobStatus%" :End if not "%1" == "nopause" pause
The following is the Windows Command file (CASECRE2.cmd) that will create a file of records with text strings that may be used by the case conversion sample programs.
@echo OFF rem * ******************************************************************* rem * CASECRE2.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 - Create a Sequential Data Set on disk using ECHO command. rem * Author - SimoTime Technologies rem * Date = January 24, 1996 rem * rem * The first job step (DeleteTEXT) will delete any previously created rem * files. rem * The second job step (CreateTEXT) will create a new ASCII/Text file. rem * The third step will convert the Line Sequential file to a Record rem * Sequential file. rem * rem * This set of programs will run on a Personal Computer with Windows rem * and Micro Focus Net Express. rem * set CmdName=CASECRE2 call ..\Env1BASE %CmdName% if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG rem * call SimoNOTE "*******************************************************%CmdName%" call SimoNOTE "Starting CmdName %CmdName%, User is %USERNAME%" call SimoNOTE "StepInfo Delete previously created files" set CASETXT1=%BaseLib1%\DATA\Asc1\CASETXT1.TXT rem * rem * ******************************************************************* rem * Step 1 of 2 Create and populate a new ASCII/TEXT file... rem * call SimoNOTE "StepInfo Create an ASCII/Text File" if exist %CASETXT1% del %CASETXT1% rem * ..1....:....2....:....3....:....4....:....5....:....6....:....7. echo THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG'S BACK >>%CASETXT1% echo john q adams >>%CASETXT1% echo 123 main street >>%CASETXT1% echo dick aND jane >>%CASETXT1% echo hElLo wOrlD >>%CASETXT1% if exist %CASETXT1% call SimoNOTE "DataMake %CASETXT1%" if not exist %CASETXT1% set JobStatus=9001 if not %JobStatus% == 0000 goto :EojNok rem * rem * ******************************************************************* rem * Step 2 of 2 ConvertASCII/TEXT file to Record Sequential File... rem * call SimoNOTE "StepInfo Convert Line Sequential to Record Sequential" set GETLS080=%BaseLib1%\DATA\Asc1\CASETXT1.TXT set PUTRS080=%BaseLib1%\DATA\Asc1\CASERS80.DAT if exist %PUTRS080% del %PUTRS080% run CV80ALAR if not "%ERRORLEVEL%" == "0" set JobStatus=0030 if not %JobStatus% == 0000 goto :EojNok call SimoNOTE "DataTake %GETLS080%" call SimoNOTE "DataMake %PUTRS080%" rem * :EojAok call SimoNOTE "Finished CmdName %CmdName%, Job Status is %JobStatus% " goto :End :EojNok call SimoNOTE "NOTE ABENDING CmdName %CmdName%, Job Status is %JobStatus% " :End if not "%1" == "nopause" pause
There are two (2) JCL members provided with this suite of sample programs. The first JCL member will execute the sample programs that do the actual case conversions.
The second JCL member is used to create a file that contains records with text strings that will be converted by the case conversion sample programs. This JCL member should be executed at least once prior to attempting to execute the sample programs.
The following is the JCL Member (CASECRJ1.jcl) that is required to run as a job on a Mainframe System or on a Windows System with Micro Focus Mainframe Express.
//CASECRJ1 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1 //* ******************************************************************* //* CASECRJ1.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 - Read file of text strings, do case convert, write output. //* Author - SimoTime Technologies //* Date - January 24, 1996 //* //* The job will read an 80-byte file that contains Text Strings //* The job will also write a file containing the results //* of the case conversion request. //* //* This set of programs will run on a mainframe under MVS or on a //* Personal Computer with Windows and Micro Focus Mainframe Express. //* //* ************ //* * CASECRJ1 * //* ********jcl* //* * //* ************ //* * IEFBR14 * //* ********utl* //* * //* ************ ************ ************ //* * CASEGET1 *-----* CASECRIO *-----* CASEPUT1 * //* *******rseq* ********cbl* *******rseq* //* * * //* * * ************ //* * *-call--* SIMOCASE * //* * ********cbl* //* * //* ************ //* * EOJ * //* ************ //* //* ******************************************************************* //* Step 1 of 2, Delete any previously created file... //* //CLEANUP1 EXEC PGM=IEFBR14 //CASEPUT1 DD DSN=SIMOTIME.DATA.CASEPUT1,DISP=(MOD,DELETE,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,DSORG=PS) //* //* ******************************************************************* //* Step 2 of 2, Test the Callable Case Conversion Routine... //* //CASEEDIT EXEC PGM=CASECRIO //STEPLIB DD DSN=SIMOTIME.DEMO.LOADLIB1,DISP=SHR //CASEGET1 DD DSN=SIMOTIME.DATA.CASEGET1,DISP=SHR //CASEPUT1 DD DSN=SIMOTIME.DATA.CASEPUT1, // DISP=(NEW,CATLG,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,DSORG=PS) //SYSOUT DD SYSOUT=* //
The following is the mainframe JCL member (CASECRJ2.jcl) that will create a file of records with text strings that may be used by the case conversion sample programs.
//CASECRJ2 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1 //* ******************************************************************* //* CASECRJ2.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 - Create a Sequential Data Set on disk using IEBGENER. //* Author - SimoTime Technologies //* Date - January 24, 1996 //* //* The first job step (QSAMDELT) will delete any previously created //* file. The second job step (QCRTDIN1) will create a new file. //* //* This set of programs will run on a mainframe under MVS or on a //* Personal Computer with Windows and Micro Focus Mainframe Express. //* //* ******************************************************************* //* Step 1 of 2, Delete any previously created file... //* //QSAMDELT EXEC PGM=IEFBR14 //SYSUT2 DD DSN=SIMOTIME.DATA.CASEGET1,DISP=(MOD,DELETE,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,DSORG=PS) //* //* ******************************************************************* //* Step 2 of 2, Create and populate a new QSAM file... //* //QCRTDIN1 EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSIN DD DUMMY //* :....1....:....2....:....3....:....4....:....5....:....6....:....7. //SYSUT1 DD * THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG'S BACK john q adams 123 main street dick aND jane hElLo wOrlD /* //SYSUT2 DD DSN=SIMOTIME.DATA.CASEGET1, // DISP=(NEW,CATLG,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,DSORG=PS) //
This program (CASECRIO.cbl) was written to test the callable COBOL program (SIMOCASE.CBL) that does the case conversion between upper and lower case for alphamerical text strings.
IDENTIFICATION DIVISION. PROGRAM-ID. CASECRIO. AUTHOR. SIMOTIME TECHNOLOGIES. ***************************************************************** * This program was generated by SimoZAPS * * A product of SimoTime Technologies * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * * * * Generation Date: 2008-06-14 Generation Time: 18:21:27:26 * * * * Record Record Key * * Function Name Organization Format Max-Min Pos-Len * * INPUT CASEGET1 SEQUENTIAL FIXED 00080 * * * * OUTPUT CASEPUT1 SEQUENTIAL FIXED 00080 * * * ***************************************************************** ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT CASEGET1-FILE ASSIGN TO CASEGET1 ORGANIZATION IS SEQUENTIAL ACCESS MODE IS SEQUENTIAL FILE STATUS IS CASEGET1-STATUS. SELECT CASEPUT1-FILE ASSIGN TO CASEPUT1 ORGANIZATION IS SEQUENTIAL ACCESS MODE IS SEQUENTIAL FILE STATUS IS CASEPUT1-STATUS. ***************************************************************** DATA DIVISION. FILE SECTION. FD CASEGET1-FILE DATA RECORD IS CASEGET1-REC . 01 CASEGET1-REC. 05 CASEGET1-DATA-01 PIC X(00080). FD CASEPUT1-FILE DATA RECORD IS CASEPUT1-REC . 01 CASEPUT1-REC. 05 CASEPUT1-DATA-01 PIC X(00080). ***************************************************************** * This program was created using the SYSMASK3.TXT file as the * * template for the File I/O. It is intended for use with the * * TransCALL facility that makes a call to a routine that does * * the actual conversion between EBCDIC and ASCII. For more * * information or questions contact SimoTime Technologies. * * * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * * * * The SYSMASK3 provides for the sequential reading of the input * * file and the sequential writing of the output file. * * If the output file is indexed then the input file must be in * * sequence by the field that will be used to provide the key * * for the output file. * * * * If the key field is not in sequence then refer to SYSMASK4 * * to provide for a random add or update of the indexed file. * ***************************************************************** WORKING-STORAGE SECTION. 01 SIM-TITLE. 05 T1 pic X(11) value '* CASECRIO '. 05 T2 pic X(34) value 'Example of Case Conversion & COBOL'. 05 T3 pic X(10) value ' v08.02.16'. 05 T4 pic X(24) value ' http://www.simotime.com'. 01 SIM-COPYRIGHT. 05 C1 pic X(11) value '* CASECRIO '. 05 C2 pic X(20) value 'Created by SimoZAPS,'. 05 C3 pic X(20) value ' a utility package '. 05 C4 pic X(28) value 'of SimoTime Technologies '. 01 CASEGET1-STATUS. 05 CASEGET1-STATUS-L pic X. 05 CASEGET1-STATUS-R pic X. 01 CASEGET1-EOF pic X value 'N'. 01 CASEGET1-OPEN-FLAG pic X value 'C'. 01 CASEPUT1-STATUS. 05 CASEPUT1-STATUS-L pic X. 05 CASEPUT1-STATUS-R pic X. 01 CASEPUT1-EOF pic X value 'N'. 01 CASEPUT1-OPEN-FLAG pic X value 'C'. 01 CASEGET1-LRECL pic 9(5) value 00080. 01 CASEPUT1-LRECL pic 9(5) value 00080. ***************************************************************** * The following buffers are used to create a four-byte status * * code that may be displayed. * ***************************************************************** 01 IO-STATUS. 05 IO-STAT1 pic X. 05 IO-STAT2 pic X. 01 IO-STATUS-04. 05 IO-STATUS-0401 pic 9 value 0. 05 IO-STATUS-0403 pic 999 value 0. 01 TWO-BYTES-BINARY pic 9(4) BINARY. 01 TWO-BYTES-ALPHA redefines TWO-BYTES-BINARY. 05 TWO-BYTES-LEFT pic X. 05 TWO-BYTES-RIGHT pic X. ***************************************************************** * Message Buffer used by the Z-DISPLAY-MESSAGE-TEXT routine. * ***************************************************************** 01 MESSAGE-BUFFER. 05 MESSAGE-HEADER pic X(11) value '* CASECRIO '. 05 MESSAGE-TEXT. 10 MESSAGE-TEXT-1 pic X(68) value SPACES. 10 MESSAGE-TEXT-2 pic X(188) value SPACES. ***************************************************************** 01 PROGRAM-NAME pic X(8) value 'CASECRIO'. 01 APPL-RESULT pic S9(9) comp. 88 APPL-AOK value 0. 88 APPL-EOF value 16. 01 CASEGET1-TOTAL. 05 CASEGET1-RDR pic 9(9) value 0. 05 filler pic X(3) value ' - '. 05 filler pic X(23) value 'Line count for CASEGET1'. 01 CASEPUT1-TOTAL. 05 CASEPUT1-ADD pic 9(9) value 0. 05 filler pic X(3) value ' - '. 05 filler pic X(23) value 'Line count for CASEPUT1'. COPY PASSCASE. ***************************************************************** PROCEDURE DIVISION. perform Z-POST-COPYRIGHT perform CASEGET1-OPEN perform CASEPUT1-OPEN add 80 to ZERO giving CASE-PASS-STRING-SIZE perform until CASEGET1-STATUS not = '00' perform CASEGET1-READ if CASEGET1-STATUS = '00' add 1 to CASEGET1-RDR perform BUILD-OUTPUT-RECORD perform CASEPUT1-WRITE if CASEPUT1-STATUS = '00' add 1 to CASEPUT1-ADD end-if end-if end-perform move CASEGET1-TOTAL to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move CASEPUT1-TOTAL to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT if APPL-EOF move 'is Complete...' to MESSAGE-TEXT else move 'is ABENDING...' to MESSAGE-TEXT end-if perform Z-DISPLAY-MESSAGE-TEXT perform CASEPUT1-CLOSE perform CASEGET1-CLOSE GOBACK. ***************************************************************** BUILD-OUTPUT-RECORD. *> TransCALL process... move SPACES to CASE-PASS-BUFFER move CASEGET1-REC(1:80) to CASE-PASS-BUFFER move 'Input Record ..... ' to CASEPUT1-REC move CASE-PASS-BUFFER(1:80) to CASEPUT1-REC(20:61) perform CASEPUT1-WRITE move '0' to CASE-PASS-REQUEST call 'SIMOCASE' using CASE-PASS-AREA move 'Convert Lower .... ' to CASEPUT1-REC move CASE-PASS-BUFFER(1:80) to CASEPUT1-REC(20:61) perform CASEPUT1-WRITE move '2' to CASE-PASS-REQUEST call 'SIMOCASE' using CASE-PASS-AREA move 'Capitalization ... ' to CASEPUT1-REC move CASE-PASS-BUFFER(1:80) to CASEPUT1-REC(20:61) perform CASEPUT1-WRITE move '3' to CASE-PASS-REQUEST call 'SIMOCASE' using CASE-PASS-AREA move 'Edited Words ..... ' to CASEPUT1-REC move CASE-PASS-BUFFER(1:80) to CASEPUT1-REC(20:61) exit. ***************************************************************** * I/O Routines for the INPUT File... * ***************************************************************** CASEGET1-CLOSE. add 8 to ZERO giving APPL-RESULT. close CASEGET1-FILE if CASEGET1-STATUS = '00' subtract APPL-RESULT from APPL-RESULT else add 12 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'CLOSE Failure with CASEGET1' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move CASEGET1-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. *---------------------------------------------------------------* CASEGET1-READ. read CASEGET1-FILE if CASEGET1-STATUS = '00' subtract APPL-RESULT from APPL-RESULT else if CASEGET1-STATUS = '10' add 16 to ZERO giving APPL-RESULT else add 12 to ZERO giving APPL-RESULT end-if end-if if APPL-AOK CONTINUE else if APPL-EOF move 'Y' to CASEGET1-EOF else move 'READ Failure with CASEGET1' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move CASEGET1-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if end-if exit. *---------------------------------------------------------------* CASEGET1-OPEN. add 8 to ZERO giving APPL-RESULT. open input CASEGET1-FILE if CASEGET1-STATUS = '00' subtract APPL-RESULT from APPL-RESULT move 'O' to CASEGET1-OPEN-FLAG else add 12 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'OPEN Failure with CASEGET1' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move CASEGET1-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. ***************************************************************** * I/O Routines for the OUTPUT File... * ***************************************************************** CASEPUT1-WRITE. if CASEPUT1-OPEN-FLAG = 'C' perform CASEPUT1-OPEN end-if write CASEPUT1-REC if CASEPUT1-STATUS = '00' subtract APPL-RESULT from APPL-RESULT else if CASEPUT1-STATUS = '10' add 16 to ZERO giving APPL-RESULT else add 12 to ZERO giving APPL-RESULT end-if end-if. if APPL-AOK CONTINUE else move 'WRITE Failure with CASEPUT1' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move CASEPUT1-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. *---------------------------------------------------------------* CASEPUT1-OPEN. add 8 to ZERO giving APPL-RESULT. open OUTPUT CASEPUT1-FILE if CASEPUT1-STATUS = '00' subtract APPL-RESULT from APPL-RESULT move 'O' to CASEPUT1-OPEN-FLAG else add 12 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'OPEN Failure with CASEPUT1' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move CASEPUT1-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. *---------------------------------------------------------------* CASEPUT1-CLOSE. add 8 to ZERO giving APPL-RESULT. close CASEPUT1-FILE if CASEPUT1-STATUS = '00' subtract APPL-RESULT from APPL-RESULT move 'C' to CASEPUT1-OPEN-FLAG else add 12 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'CLOSE Failure with CASEPUT1' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move CASEPUT1-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. ***************************************************************** * The following Z-ROUTINES provide administrative functions * * for this program. * ***************************************************************** * ABEND the program, post a message to the console and issue * * a STOP RUN. * ***************************************************************** Z-ABEND-PROGRAM. if MESSAGE-TEXT not = SPACES perform Z-DISPLAY-MESSAGE-TEXT end-if move 'PROGRAM-IS-ABENDING...' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT add 12 to ZERO giving RETURN-CODE STOP RUN. * exit. ***************************************************************** * Display CONSOLE messages... * ***************************************************************** Z-DISPLAY-MESSAGE-TEXT. if MESSAGE-TEXT-2 = SPACES display MESSAGE-BUFFER(1:79) else display MESSAGE-BUFFER end-if move all SPACES to MESSAGE-TEXT exit. ***************************************************************** * Display the file status bytes. This routine will display as * * four digits. If the full two byte file status is numeric it * * will display as 00nn. If the 1st byte is a numeric nine (9) * * the second byte will be treated as a binary number and will * * display as 9nnn. * ***************************************************************** Z-DISPLAY-IO-STATUS. if IO-STATUS not NUMERIC or IO-STAT1 = '9' move IO-STAT1 to IO-STATUS-04(1:1) subtract TWO-BYTES-BINARY from TWO-BYTES-BINARY move IO-STAT2 to TWO-BYTES-RIGHT add TWO-BYTES-BINARY to ZERO giving IO-STATUS-0403 move 'File Status is: nnnn' to MESSAGE-TEXT move IO-STATUS-04 to MESSAGE-TEXT(17:4) perform Z-DISPLAY-MESSAGE-TEXT else move '0000' to IO-STATUS-04 move IO-STATUS to IO-STATUS-04(3:2) move 'File Status is: nnnn' to MESSAGE-TEXT move IO-STATUS-04 to MESSAGE-TEXT(17:4) perform Z-DISPLAY-MESSAGE-TEXT end-if exit. ***************************************************************** Z-POST-COPYRIGHT. display SIM-TITLE display SIM-COPYRIGHT exit. ***************************************************************** * This program was generated by SimoZAPS * * A product of SimoTime Technologies * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * * * * Generation Date: 2008-06-14 Generation Time: 18:21:27:28 * *****************************************************************
This program (SIMOCASE.cbl) was originally written to be used as a teaching and learning aid. It was first used in a production environment to replace a callable 370 assembler routine. Today, this program (or a modified version) is used in a number of mainframe shops and it is the program of choice used by SimoTime. Also, the program has been tested and deployed on a Windows System with Mainframe Express or Net Express from Micro Focus. The SIMOCASE callable program is part of the SimoMODS package of callable routines.
Explore how to do simple case conversion of text strings between Upper and Lower Case. Also, this routine has some advanced functions to do capitalization of the first letter in a word and/or identify certain words to be exempt from the conversion process.
This copy file (PASSCASE.cpy) provides a convenient method for defining the data areas (or fields) that are used to pass information between the demo program and the case conversion routine.
***************************************************************** * PASSCASE is a COBOL Copy File * * Data Structure or Pass Area used for calling SIMOCASE. * ***************************************************************** * 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 * ***************************************************************** * * When CASE-PASS-REQUEST * is '0' Do Upper to Lower case conversion * is '1' Do Lower to Upper case conversion * is '2' Do capitalization of each word * is '3' Do 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 - - - - - - - - - - - PASSCASE * ***************************************************************** *
This document may be used to assist as a tutorial for new programmers or as a quick reference for experienced programmers.
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.
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.
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.
The following links may be to the current server or to the Internet.
Note: The latest versions of the SimoTime Documents and Program Suites are available on the Internet and may be accessed using the icon. If a user has a SimoTime Enterprise License the Documents and Program Suites may be available on a local server and accessed using the icon.
Explore a complete list of the SimoTime Callable Routines or Utility Programs. This includes the callable routines and utility programs for the Micro Focus environment.
Explore the JCL Connection for more examples of JCL functionality with programming techniques and sample code.
Explore the COBOL Connection for more examples of COBOL programming techniques and sample code.
Explore An Enterprise System Model that describes and demonstrates how Applications that were running on a Mainframe System and non-relational data that was located on the Mainframe System were copied and deployed in a Microsoft Windows environment with Micro Focus Enterprise 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.
Explore The File Status Return Codes that are used to interpret the results of accessing VSAM data sets and/or QSAM files.
The following links will require an internet connect.
This suite of programs and documentation is available to download for review and evaluation purposes. Other uses will require a SimoTime Software License. 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.
Explore the Glossary of Terms for a list of terms and definitions used in this suite of documents and white papers.
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.
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 |
Case Conversion using a COBOL Callable Routine |
Copyright © 1987-2025 SimoTime Technologies and Services All Rights Reserved |
When technology complements business |
http://www.simotime.com |