Validate a Street Address
COBOL parses a Street Address
  Table of Contents  v-24.01.01 - cblstr01.htm 
  Introduction
  Sample Input and Output
  Application Flowchart
  Call Interface
  The CMD Members
  Run the Demonstration Program
  Create the Input Test File
  The JCL Members
  Run the Demonstration Program
  Create the Input Test File
  COBOL, Demonstration Program
  COBOL, Street Edit Routine
  COBOL, Parsing Routine
  Copy File for the Pass Area
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Contact or Feedback
  Company Overview
The SimoTime Home Page 

Table of Contents Previous Section Next Section Introduction

The objective of this suite of programs is to examine a data string containing a street address and produce a new data string with an edited version of the street address.

1 Convert to an upper and lower case format.
2 Compress leading and repetitive space characters.
3 Identify Post Office Box addresses
4 Provide option to standardize words (i.e. change "bl" to "Blvd").
5 Calculate the length of the text strings within the address fields.
  Functions provided by the Routine that does Parsing and Editing of a Street Address

The parsing routine uses reference modification to identify the position of the first significant character after a delimiter character. This approach compensates for multiple leading or embedded delimiter characters. For example, if the delimiter character is a space then leading spaces will be ignored and multiple, embedded spaces will be treated as a single space.


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

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

Table of Contents Previous Section Next Section Sample Input and Output

The following table shows examples of the editing and formatting capabilities of this suite of programs.

Control Street Address Conversion Description
INP    15 CARNOUSTIE DRIVE    
MOD 15 Carnoustie Drive Do a simple case conversion.
INP POST OFFICE BOX 9144    
POB P.O. Box 9144 Identify and format a Post Office Box.
INP    23 Post Street  
AOK 23 Post Street Input is OK, no conversion required.
INP   710 HOLLYWOOD BL.  
MOD 710 Hollywood Blvd Do case conversion and word substitution.
INP    P   O  box 32447  
POB P.O. Box 32447 Identify and format for a Post Office Box. Also, remove leading and multiple embedded spaces.
INP THE CORNER OF HOLLYWOOD AND VINE    
MOD The Corner of Hollywood and Vine Do case conversion and word substitution.
INP POB 27  
POB P.O. Box 27 Identify and format a Post Office Box.

Table of Contents Previous Section Next Section Application Flowchart

The following is a flowchart of the demonstration for processing a street address to reformat and identify Post Office Box addresses.

             
Entry Point
ZOS
Entry Point
Windows
   
   
CBLSTRJ1
jcl
CBLSTRE1
cmd
Submit the Job
   
   
IEFBR14
Utility
IF Exist
statement
Delete previously created output files
   
   
 
 
   
   
 
 
   
   
SIMOADR1
rseq
 
 
CBLSTRC1
cbl
   
   
SIMOADR2
rseq
Read the input file containing street addresses and create a new file containing edited street addresses.
   
   
   
   
   
SIMOROAD
cbl
Case conversion, Word-substitution, Remove leading and multiple embedded spaces and identify PO Box addresses.
   
   
   
SIMOPARS
cbl
Parse the words within the "street address" field.
   
EOJ
End-Of-Job
 
Program Flow for the Editing of a Street Address

Color Associations: The  light-green  boxes are unique to SIMOTIME Technologies using an IBM Mainframe System or Micro Focus Enterprise Developer. The  light-red  boxes are unique to the SIMOTIME Technologies using a Linux, UNIX or Windows System and COBOL Technologies such as Micro Focus. The  light-yellow  boxes are SIMOTIME Technologies, Third-party Technologies, decision points or program transitions in the processing logic or program generations. The  light-blue  boxes identify the input/output data structures such as Documents, Spreadsheets, Data Files, VSAM Data Sets, Partitioned Data Set Members (PDSM's) or Relational Tables. The  light-gray  boxes identify a system function or an informational item.

Table of Contents Previous Section Next Section Call Interface

To call the routine (SIMOROAD) the fields for the pass area need to be initialized. The following shows an example of initializing the pass area fields and making the call.

      *>   Prepare linkage section and call SimoROAD…
           move 'UNK '          to SYSADR2-CNTL-01
           move 'SIMOROAD'      to RDPA-REQUEST
           move SYSADR1-CNTL-01 to RDPA-ADR1-CNTL
           move SYSADR1-DATA-01 to RDPA-ADR1-DATA
           add 76 to ZERO   giving RDPA-ADR1-SIZE
           call 'SIMOROAD'   using ROAD-PASS-AREA

For a brief description of all the fields used in the pass area refer to the COBOL Copy File that is used when defining the pass area and calling SIMOROAD.

Table of Contents Previous Section Next Section The CMD Members

Two CMD members are provided. This first CMD member CBLSTRE1.cmd will run the demonstration program. The second CMD member CBLSTRE2.cmd is used to create the input data file that is used by the first CMD member.

Table of Contents Previous Section Next Section Run the Demonstration Program

The following is the Windows CMD member (CBLSTRE1.cmd) required to run the mainline program. The SET statement will need to be modified for unique PC requirements.

@echo OFF
rem  * *******************************************************************
rem  *               CBLSTRE1.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  Street Address, create edited file.
rem  * Author - SimoTime Technologies
rem  * Date   - January 24, 1996
rem  *
rem  * The job will read an 80-byte file that contains street address
rem  * record. The job will then edit the street address and identify
rem  * PO Boxes. A new file of edited street addresses will be created.
rem  *
rem  * This set of programs will run on a Windows Systems and
rem  * Micro Focus technology.
rem  *
rem  *    ************
rem  *    * CBLSTRE1 *
rem  *    ********cmd*
rem  *         *
rem  *    ************
rem  *    * If Exist *
rem  *    *******stmt*
rem  *         *
rem  *    ************     ************     ************
rem  *    *   run    ******* SIMOLOGS ******* CONSOLE  *
rem  *    ************  *  ********cbl*  *  ************
rem  *         *        *                *
rem  *         *        *                *  ************
rem  *         *        *                ****  SYSLOG  *
rem  *         *        *                   ********txt*
rem  *         *        *
rem  *         *        **************************
rem  *         *                                 *
rem  *         *           ************     ************     ************
rem  *         *           * SIMOADR1 ******* CBLSTRC1 ******* SIMOADR2 *
rem  *         *           ********txt*     ********cbl*     ********csv*
rem  *         *                                 *
rem  *         *                            ************
rem  *         *                            * SIMOROAD *
rem  *         *                            ********cbl*
rem  *         *                                 *
rem  *         *                            ************
rem  *         *                            * SIMOPARS *
rem  *         *                            ********cbl*
rem  *    ************
rem  *    *   EOJ    *
rem  *    ************
rem  *
rem  *
rem  * *******************************************************************
rem  * Step   1   Delete any previously created file...
rem  *
     set CmdName=CBLSTRE1
     call ..\Env1Base
rem  *
     call SimoNOTE "*******************************************************%CmdName%.cmd"
     call SimoNOTE "Starting JobName %CmdName%.cmd"
:DeleteQSAM
     call SimoNOTE "Identify JobStep DeleteQSAM"
     set SIMOADR1=%BaseLib1%\DATA\Asc1\SIMOADR1.DAT
     set SIMOADR2=%BaseLib1%\DATA\Wrk1\SIMOADR2.DAT
     if exist %SIMOADR2% del %SIMOADR2%
rem  *
rem  * *******************************************************************
rem  * Step   2   Edit input, create a new output file...
rem  *
:CBLSTRC1
     call SimoNOTE "Identify JobStep ExecuteStreetAddressEditRoutine"
     run CBLSTRC1
     if "%ERRORLEVEL%" == "1" set JobStatus=0001
     if not "%JobStatus%" == "0000" goto :EojNOK
     if exist %SIMOADR2% goto :EojAok
     set JobStatus=0002
     goto :EojNok
:EojAOK
     call SimoNOTE "Finished CmdName %CmdName%, Job Status is %JobStatus%"
     goto :End
:EojNOK
     call SimoNOTE "ABENDING CmdName %CmdName%, Job Status is %JobStatus%"
     echo %DATE% - %TIME% Starting User ABEND Processing...>>%SYSLOG%
     set >>%SYSLOG%
     echo %DATE% - %TIME% Complete User ABEND Processing...>>%SYSLOG%
     goto :End
:End
     call SimoNOTE "DATATAKE is %SIMOADR1%"
     call SimoNOTE "DATAMAKE is %SIMOADR2%"
     call SimoNOTE "SYSOUT.. is %SYSOUT%"
     if not "%1" == "nopause" pause
     exit /B %JobStatus%

Table of Contents Previous Section Next Section Create the Input Test File

The following is the Windows CMD member (CBLSTRE2.cmd) that creates the input data file.. The SET statement will need to be modified for unique PC requirements.

@echo OFF
rem  * *******************************************************************
rem  *               CBLSTRE2.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 function.
rem  * Author - SimoTime Technologies
rem  * Date   = January 24, 1996
rem  *
rem  * The first job step (DeleteQSAM) will delete any previously created
rem  * file. The second job step (CreateQSAM) will create a new file.
rem  *
rem  * This set of programs will run on a Personal Computer with Windows
rem  * and Micro Focus Net Express.
rem  *
     set CmdName=CBLSTRE2
     call ..\Env1Base
rem  *
     call SimoNOTE "*******************************************************%CmdName%.CMD"
     call SimoNOTE "Starting JobName %CmdName%.CMD"
rem  *
rem  * *******************************************************************
rem  * Step   1 of 2  Delete previously created QSAM file...
rem  *
:DeleteQSAM
     call SimoNOTE "Identify JobStep DeleteQSAM"
     set SIMOADR0=%BaseLib1%\DATA\Txt1\LSEQADR1.TXT
     if exist %SIMOADR0% del %SIMOADR0%
rem  *
rem  * *******************************************************************
rem  * Step   2 of 2  Create and populate a new QSAM file...
rem  *
:CreateQSAM
     call SimoNOTE "Identify JobStep CreateQSAM"
rem  *....1....:....2....:....3....:....4....:....5....:....6....:....7....:....8
echo INP   15  CARNOUSTIE DRIVE >>%SIMOADR0%
echo INP POST OFFICE BOX 9144   >>%SIMOADR0%
echo INP 123 MAIN STREET        >>%SIMOADR0%
echo INP POB 27                 >>%SIMOADR0%
echo INP 1317 ST. CHARLES AVE.  >>%SIMOADR0%
echo INP 23 Post Street         >>%SIMOADR0%
echo INP PO BOX 21637           >>%SIMOADR0%
echo INP 710 HOLLYWOOD BL.      >>%SIMOADR0%
echo INP 1271 MACDOUGAL LANE    >>%SIMOADR0%
echo INP 14 VAN NESS AVENUE     >>%SIMOADR0%
echo INP 77 SUNSET BL           >>%SIMOADR0%
echo INP P.O. BOX 1665          >>%SIMOADR0%
echo INP PO 94949-5849          >>%SIMOADR0%
echo INP 777 Seventh Avenue     >>%SIMOADR0%
echo INP PO   BOX 12638         >>%SIMOADR0%
echo INP    P   O   box 32447   >>%SIMOADR0%
echo INP 1564 Alameda de la Loma                          >>%SIMOADR0%
echo INP THE CORNER OF HOLLYWOOD AND VINE                 >>%SIMOADR0%
echo INP 16 LARKSPUR LANDING CIRCLE, SUITE 116            >>%SIMOADR0%
echo INP pO 0123456789 CAN you FiX tHiS AnD THAT TEst bL. >>%SIMOADR0%
echo INP 17 LINCOLN WAY, APT 101D                         >>%SIMOADR0%
echo INP 1454 Po Way                                      >>%SIMOADR0%
echo INP 1656 SOUTH EVANS AVE                             >>%SIMOADR0%
     if exist %SIMOADR0% goto :Convert
     set JobStatus=0020
     goto :EojNok
rem  *
:Convert
     set GETLS080=%BaseLib1%\DATA\Txt1\LSEQADR1.TXT
     set PUTRS080=%BaseLib1%\DATA\Asc1\SIMOADR1.DAT
     if exist %PUTRS080% erase %PUTRS080%
     run CV80ALAR
     if not "%ERRORLEVEL%" == "0" set JobStatus=0030
     if not "%JobStatus%" == "0000" goto :EojNOK
     if not exist %PUTRS080% set JobStatus=0035
     if not "%JobStatus%" == "0000" goto :EojNOK
     goto EojAok
rem  *
:EojAOK
     call SimoNOTE "Finished CmdName %CmdName%, Job Status is %JobStatus%"
     goto :End
:EojNOK
     call SimoNOTE "ABENDING CmdName %CmdName%, Job Status is %JobStatus%"
     echo %DATE% - %TIME% Starting User ABEND Processing...>>%SYSLOG%
     set >>%SYSLOG%
     echo %DATE% - %TIME% Complete User ABEND Processing...>>%SYSLOG%
     goto :End
:End
     call SimoNOTE "Conclude SysOut is %SYSOUT%"
     if not "%1" == "nopause" pause
     exit /B %JobStatus%

Table of Contents Previous Section Next Section The JCL Members

Two JCL members are provided. This first JCL member CBLSTRJ1.jcl will run the demonstration program. The second JCL member CBLSTRJ2.jcl is used to create the input data file that is used by the first JCL member.

Table of Contents Previous Section Next Section Run the Demonstration Program

The following is the mainframe JCL (CBLSTRJ1.jcl) required to run the mainline program. The JOB and DD statements will need to be modified for unique mainframe requirements.

//CBLSTRJ1 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*       CBLSTRJ1.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 a file containing street addresses, write output.
//* Author - SimoTime Technologies
//* Date   - January 24, 1996
//*
//* The job will read an 80-byte file that contains street address
//* information. The job will also write a file containing the results
//* of the street address parse and edit functions..
//*
//* This set of programs will run on a mainframe under MVS or on a
//* Personal Computer with Windows and Micro Focus Mainframe Express.
//*
//*                     ************
//*                     * CBLSTRJ1 *
//*                     ********jcl*
//*                          *
//*                     ************
//*                     * IEFBR14  *
//*                     ********utl*
//*                          *
//*    ************     ************     ************
//*    * SIMOADR1 *-----* CBLSTRC1 *-----* SIMOADR2 *
//*    ********dat*     ********cbl*     ********dat*
//*                          *   *
//*                          *   *       ************
//*                          *   ***CALL** SIMOROAD *
//*                          *           ********cbl*
//*                          *             *
//*                          *             *       ************
//*                          *             ***CALL** SIMOPARS *
//*                          *                     ********cbl*
//*                     ************
//*                     *   EOJ    *
//*                     ************
//*
//* *******************************************************************
//* Step 1 of 2, Delete any previously created file...
//*
//QSAMDELT EXEC PGM=IEFBR14
//SIMOADR2  DD  DSN=SIMOTIME.DATA.SIMOADR2,DISP=(MOD,DELETE,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=256,BLKSIZE=2560,DSORG=PS)
//*
//* *******************************************************************
//* Step 2 of 2, Edit input, create a new output file...
//*
//EXECDAT1 EXEC PGM=CBLSTRC1
//STEPLIB  DD  DSN=SIMOTIME.DEMO.LOADLIB1,DISP=SHR
//SIMOADR1 DD  DSN=SIMOTIME.DATA.SIMOADR1,DISP=SHR
//SIMOADR2 DD  DSN=SIMOTIME.DATA.SIMOADR2,
//             DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=256,BLKSIZE=2560,DSORG=PS)
//SYSOUT   DD  SYSOUT=*
//

Table of Contents Previous Section Next Section Create the Input Test File

The following is the mainframe JCL member (CBLSTRJ2.jcl) that creates the input data file.. The JOB and DD statements will need to be modified for unique mainframe requirements.

//CBLSTRJ2 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*       CBLSTRJ2.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 (DELTQSAM) will delete any previously created
//* file. The second job step (CRTQNAME) 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
//SIMOADR1 DD  DSN=SIMOTIME.DATA.SIMOADR1,DISP=(MOD,DELETE,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,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  *
INP   15  CARNOUSTIE DRIVE
INP POST OFFICE BOX 9144
INP 123 MAIN STREET
INP POB 27
INP 1317 ST. CHARLES AVE.
INP 23 Post Street
INP PO BOX 21637
INP 710 HOLLYWOOD BL.
INP 1271 MACDOUGAL LANE
INP 14 VAN NESS AVENUE
INP 77 SUNSET BL
INP P.O. BOX 1665
INP PO 94949-5849
INP 777 Seventh Avenue
INP PO   BOX 12638
INP    P   O   box 32447
INP 1564 Alameda de la Loma
INP THE CORNER OF HOLLYWOOD AND VINE
INP 16 LARKSPUR LANDING CIRCLE, SUITE 116
INP pO 0123456789 CAN you FiX tHiS AnD THAT TEst bL.
INP 17 LINCOLN WAY, APT 101D
INP 1454 Po Way
INP 1656 SOUTH EVANS AVE
/*
//SYSUT2   DD  DSN=SIMOTIME.DATA.SIMOADR1,
//             DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS)
//

Table of Contents Previous Section Next Section COBOL, Demonstration Program

This program (CBLSTRC1.cbl) was written to test and demonstrate the calling of a COBOL program (SIMOROAD.cbl) that does the editing of a field or data string containing the street address. SIMOROAD calls SIMOPARS.cbl to do the parsing of the street address information into keywords.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    CBLSTRC1.
       AUTHOR.        SIMOTIME TECHNOLOGIES.
      *****************************************************************
      * Copyright (C) 1987-2019 SimoTime Technologies.                *
      *                                                               *
      * All rights reserved.  Unpublished, all rights reserved under  *
      * copyright law and international treaty.  Use of a copyright   *
      * notice is precautionary only and does not imply publication   *
      * or disclosure.                                                *
      *                                                               *
      * Permission to use, copy, modify and distribute this software  *
      * for any non-commercial purpose and without fee is hereby      *
      * granted, provided the SimoTime copyright notice appear on all *
      * copies of the software. The SimoTime name or Logo may not be  *
      * used in any advertising or publicity pertaining to the use    *
      * of the software without the written permission of SimoTime    *
      * Technologies.                                                 *
      *                                                               *
      * Permission to use, copy, modify and distribute this software  *
      * for any commercial purpose requires a fee to be paid to       *
      * SimoTime Technologies. Once the fee is received by SimoTime   *
      * the latest version of the software will be delivered and a    *
      * license will be granted for use within an enterprise,         *
      * provided the SimoTime copyright notice appear on all copies   *
      * of the software. The SimoTime name or Logo may not be used    *
      * in any advertising or publicity pertaining to the use of the  *
      * software without the written permission of SimoTime           *
      * Technologies.                                                 *
      *                                                               *
      * SimoTime Technologies makes no warranty or representations    *
      * about the suitability of the software for any purpose. It is  *
      * provided "AS IS" without any expressed or implied warranty,   *
      * including the implied warranties of merchantability, fitness  *
      * for a particular purpose and non-infringement. SimoTime       *
      * Technologies shall not be liable for any direct, indirect,    *
      * special or consequential damages resulting from the loss of   *
      * use, data or projects, whether in an action of contract or    *
      * tort, arising out of or in connection with the use or         *
      * performance of this software                                  *
      *                                                               *
      * SimoTime Technologies                                         *
      * 15 Carnoustie Drive                                           *
      * Novato, CA 94949-5849                                         *
      * 415.883.6565                                                  *
      *                                                               *
      * RESTRICTED RIGHTS LEGEND                                      *
      * Use, duplication, or disclosure by the Government is subject  *
      * to restrictions as set forth in subparagraph (c)(1)(ii) of    *
      * the Rights in Technical Data and Computer Software clause at  *
      * DFARS 52.227-7013 or subparagraphs (c)(1) and (2) of          *
      * Commercial  Computer Software - Restricted Rights  at 48      *
      * CFR 52.227-19, as applicable.  Contact SimoTime Technologies, *
      * 15 Carnoustie Drive, Novato, CA 94949-5849.                   *
      *                                                               *
      *****************************************************************
      *      This program is provided by SimoTime Technologies        *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *****************************************************************
      *
      *****************************************************************
      * Source Member: CBLSTRC1.CBL
      * Copy Files:    PASSROAD.CPY
      * Calls to:      SIMOROAD
      *                Copy Files:    PASSPARS.CPY
      *                Calls to:      SIMOPARS
      *****************************************************************
      *
      *                     ************
      *                     * CBLSTRJ1 *
      *                     ********jcl*
      *                          *
      *                     ************
      *                     * IEFBR14  *
      *                     ********utl*
      *                          *
      *    ************     ************     ************
      *    * SIMOADR1 *-----* CBLSTRC1 *-----* SIMOADR2 *
      *    ********dat*     ********cbl*     ********dat*
      *                          *   *
      *                          *   *       ************
      *                          *   ***call** SIMOROAD *
      *                          *           ********cbl*
      *                          *                *
      *                          *                *       ************
      *                          *                ***call** SIMOPARS *
      *                          *                        ********cbl*
      *                     ************
      *                     *   EOJ    *
      *                     ************
      *
      *****************************************************************
      *
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT SIMOADR1-FILE  ASSIGN to      SIMOADR1
                  ORGANIZATION is SEQUENTIAL
                  ACCESS MODE  is SEQUENTIAL
                  FILE STATUS  is SIMOADR1-STATUS.
           SELECT SIMOADR2-FILE  ASSIGN to      SIMOADR2
                  ORGANIZATION is SEQUENTIAL
                  ACCESS MODE  is SEQUENTIAL
                  FILE STATUS  is SIMOADR2-STATUS.

      *****************************************************************
       DATA DIVISION.
       FILE SECTION.
       FD  SIMOADR1-FILE
           DATA RECORD    is SIMOADR1-RECORD.
       01  SIMOADR1-RECORD.
           05  SIMOADR1-CNTL-01 pic X(4).
           05  SIMOADR1-DATA-01 pic X(76).

       FD  SIMOADR2-FILE
           DATA RECORD    is SIMOADR2-RECORD.
       01  SIMOADR2-RECORD.
           05  SIMOADR2-CNTL-01 pic X(4).
           05  SIMOADR2-SIZE-01 pic 9(5).
           05  SIMOADR2-BLANK   pic X.
           05  SIMOADR2-DATA-01 pic X(246).

       WORKING-STORAGE SECTION.
       01  SIM-TITLE.
           05  T1 pic X(11) value '* CBLSTRC1 '.
           05  T2 pic X(32) value 'Processing a Street Address     '.
           05  T3 pic X(10) value ' v08.01.04'.
           05  T4 pic X(24) value ' http://www.simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* CBLSTRC1 '.
           05  C2 pic X(20) value 'Copyright 1987-2019 '.
           05  C3 pic X(28) value '   SimoTime Technologies    '.
           05  C4 pic X(20) value ' All Rights Reserved'.

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

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

       01  MESSAGE-BUFFER.
           05  MESSAGE-HEADER      pic X(11)   value '* CBLSTRC1 '.
           05  MESSAGE-TEXT.
               10  MESSAGE-TEXT-1  pic X(68)   value SPACES.
               10  MESSAGE-TEXT-2  pic X(188)  value SPACES.

       01  SIMOADR1-STATUS.
           05  SIMOADR1-STATUS-L   pic X.
           05  SIMOADR1-STATUS-R   pic X.
       01  SIMOADR1-EOF            pic X       value 'N'.
       01  SIMOADR1-OPEN-FLAG      pic X       value 'C'.

       01  SIMOADR2-STATUS.
           05  SIMOADR2-STATUS-L   pic X.
           05  SIMOADR2-STATUS-R   pic X.
       01  SIMOADR2-EOF            pic X       value 'N'.
       01  SIMOADR2-OPEN-FLAG      pic X       value 'C'.

       01  IO-STATUS.
           05  IO-STAT1            pic X.
           05  IO-STAT2            pic X.

       01  TWO-BYTES.
           05  TWO-BYTES-LEFT      pic X.
           05  TWO-BYTES-RIGHT     pic X.
       01  TWO-BYTES-BINARY        redefines   TWO-BYTES pic 9(4) comp.

       01  APPL-RESULT             pic S9(9)   comp.
           88  APPL-AOK            value 0.
           88  APPL-EOF            value 16.

       01  SIMOADR1-TOTAL.
           05  filler       pic X(23)  value 'SIMOADR1 line count is '.
           05  SIMOADR1-LOC pic 9(7)    value 0.

       01  SUB-AOK         pic 9(7)    value 0.
       01  SUB-MOD         pic 9(7)    value 0.
       01  SUB-POB         pic 9(7)    value 0.
       01  SUB-POX         pic 9(7)    value 0.
       01  SUB-OTH         pic 9(7)    value 0.
       01  SUB-TOT         pic 9(7)    value 0.

      *****************************************************************
      * The following copy file of the pass area for calling SIMODATE,
      * the date editing routine.
      *****************************************************************
       COPY PASSROAD.

      *****************************************************************
       PROCEDURE DIVISION.
           perform Z-POST-COPYRIGHT
           perform SIMOADR1-OPEN
           perform SIMOADR2-OPEN
           initialize SIMOADR2-RECORD

           perform until SIMOADR1-STATUS not = '00'
               perform SIMOADR1-READ
               if  SIMOADR1-STATUS = '00'
                   add 1 to SIMOADR1-LOC
      *        *   Prepare linkage section and call SimoROAD...
                   move 'UNK '           to SIMOADR2-CNTL-01
                   move 'SIMOROAD'       to RDPA-REQUEST
                   move SIMOADR1-CNTL-01 to RDPA-ADR1-CNTL
                   move SIMOADR1-DATA-01 to RDPA-ADR1-DATA
                   add 76 to ZERO    giving RDPA-ADR1-SIZE
                   call 'SIMOROAD'   using ROAD-PASS-AREA

                   if  RDPA-RESULT = 0
      *            *   The following two statements are for
      *            *   demonstration purposes.
      *            *   Write Input record to output file.
                       initialize SIMOADR2-RECORD
                       move SIMOADR1-CNTL-01 to SIMOADR2-CNTL-01
                       add RDPA-ADR1-SIZE    to ZERO
                                         giving SIMOADR2-SIZE-01
                       move SIMOADR1-DATA-01 to SIMOADR2-DATA-01
                       perform SIMOADR2-WRITE
                       initialize SIMOADR2-RECORD
                       move RDPA-ADR2-CNTL to SIMOADR2-CNTL-01
                       add RDPA-ADR2-SIZE  to ZERO
                                       giving SIMOADR2-SIZE-01
                       move RDPA-ADR2-DATA to SIMOADR2-DATA-01
                       perform SIMOADR2-WRITE
                       perform CALCULATE-SUB-TOTALS
                   else
                       move RDPA-ADR2-CNTL to SIMOADR2-CNTL-01
                       move RDPA-ADR2-DATA to SIMOADR2-DATA-01
                       move SIMOADR2-RECORD to MESSAGE-TEXT
                       perform Z-DISPLAY-CONSOLE-MESSAGE
                       perform SIMOADR2-WRITE
                       move SIMOADR1-DATA-01 to SIMOADR2-DATA-01
                       perform SIMOADR2-WRITE
                   end-if
               end-if
           end-perform

           perform DISPLAY-SUB-TOTALS
           perform Z-THANK-YOU

           GOBACK.

      *****************************************************************
      * The following routines are in alphabetical sequence..         *
      *****************************************************************

      *****************************************************************
       CALCULATE-SUB-TOTALS.
           evaluate RDPA-ADR2-CNTL
               when 'AOK ' add 1 to SUB-AOK
               when 'MOD ' add 1 to SUB-MOD
               when 'POB ' add 1 to SUB-POB
               when 'PO? ' add 1 to SUB-POX
               when OTHER  add 1 to SUB-OTH
           end-evaluate
           exit.

      *****************************************************************
       DISPLAY-SUB-TOTALS.
           add SUB-AOK SUB-MOD SUB-POB SUB-POX SUB-OTH to SUB-TOT
           move 'AOK .... ' to MESSAGE-TEXT
           move SUB-AOK     to MESSAGE-TEXT(10:7)
           perform Z-DISPLAY-CONSOLE-MESSAGE
           move 'MOD .... ' to MESSAGE-TEXT
           move SUB-MOD     to MESSAGE-TEXT(10:7)
           perform Z-DISPLAY-CONSOLE-MESSAGE
           move 'POB .... ' to MESSAGE-TEXT
           move SUB-POB     to MESSAGE-TEXT(10:7)
           perform Z-DISPLAY-CONSOLE-MESSAGE
           move 'PO? .... ' to MESSAGE-TEXT
           move SUB-POX     to MESSAGE-TEXT(10:7)
           perform Z-DISPLAY-CONSOLE-MESSAGE
           move 'Other .. ' to MESSAGE-TEXT
           move SUB-OTH     to MESSAGE-TEXT(10:7)
           move 'TOTAL .. ' to MESSAGE-TEXT
           move SUB-TOT     to MESSAGE-TEXT(10:7)
           perform Z-DISPLAY-CONSOLE-MESSAGE
           exit.

      *****************************************************************
      * I/O ROUTINES FOR SIMOADR1...                                  *
      *****************************************************************
       SIMOADR1-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close SIMOADR1-FILE
           if  SIMOADR1-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'SIMOADR1-Failure-CLOSE...' to MESSAGE-TEXT
               perform Z-DISPLAY-CONSOLE-MESSAGE
               move SIMOADR1-STATUS to IO-STATUS
               perform Z-DISPLAY-CONSOLE-MESSAGE
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       SIMOADR1-READ.
           read SIMOADR1-FILE
           if  SIMOADR1-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               if  SIMOADR1-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 SIMOADR1-EOF
               else
                   move 'SIMOADR1-Failure-GET...' to MESSAGE-TEXT
                   perform Z-DISPLAY-CONSOLE-MESSAGE
                   move SIMOADR1-STATUS to IO-STATUS
                   perform Z-DISPLAY-CONSOLE-MESSAGE
                   perform Z-ABEND-PROGRAM
               end-if
           end-if
           exit.
      *---------------------------------------------------------------*
       SIMOADR1-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open input SIMOADR1-FILE
           if  SIMOADR1-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'O' to SIMOADR1-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'SIMOADR1-Failure-OPEN...' to MESSAGE-TEXT
               perform Z-DISPLAY-CONSOLE-MESSAGE
               move SIMOADR1-STATUS to IO-STATUS
               perform Z-DISPLAY-CONSOLE-MESSAGE
               perform Z-ABEND-PROGRAM
           end-if
           exit.

      *****************************************************************
      * I/O ROUTINES FOR SIMOADR2...                                  *
      *****************************************************************
       SIMOADR2-WRITE.
           if  SIMOADR2-OPEN-FLAG = 'C'
               perform SIMOADR2-OPEN
           end-if
           write SIMOADR2-RECORD
           if  SIMOADR2-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               if  SIMOADR2-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 'SIMOADR2-Failure-WRITE...' to MESSAGE-TEXT
               perform Z-DISPLAY-CONSOLE-MESSAGE
               move SIMOADR2-STATUS to IO-STATUS
               perform Z-DISPLAY-CONSOLE-MESSAGE
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       SIMOADR2-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open output SIMOADR2-FILE
           if  SIMOADR2-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'O' to SIMOADR2-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'SIMOADR2-Failure-OPEN...' to MESSAGE-TEXT
               perform Z-DISPLAY-CONSOLE-MESSAGE
               move SIMOADR2-STATUS to IO-STATUS
               perform Z-DISPLAY-CONSOLE-MESSAGE
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       SIMOADR2-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close SIMOADR2-FILE
           if  SIMOADR2-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'C' to SIMOADR2-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'SIMOADR2-Failure-CLOSE...' to MESSAGE-TEXT
               perform Z-DISPLAY-CONSOLE-MESSAGE
               move SIMOADR2-STATUS to IO-STATUS
               perform Z-DISPLAY-CONSOLE-MESSAGE
               perform Z-ABEND-PROGRAM
           end-if
           exit.

      *****************************************************************
      * The following Z-Routines perform administrative tasks         *
      * 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-CONSOLE-MESSAGE
           end-if
           move 'PROGRAM-IS-ABENDING...'  to MESSAGE-TEXT
           perform Z-DISPLAY-CONSOLE-MESSAGE
           add 12 to ZERO giving RETURN-CODE
           STOP RUN.
      *    exit.

      *****************************************************************
      * Display CONSOLE messages...                                   *
      *****************************************************************
       Z-DISPLAY-CONSOLE-MESSAGE.
           if MESSAGE-TEXT-2 = SPACES
               display MESSAGE-BUFFER(1:79) upon console
           else
               display MESSAGE-BUFFER upon console
           end-if
           move all SPACES to MESSAGE-TEXT
           exit.

      ****************************************************************
      * Display the file status bytes. This routine will display as   *
      * two digits if the full two byte file status is numeric. If    *
      * second byte is non-numeric then it will be treated as a       *
      * binary number.                                                *
      *****************************************************************
       Z-DISPLAY-IO-STATUS.
           if  IO-STATUS not NUMERIC
           or  IO-STAT1    = '9'
               subtract TWO-BYTES-BINARY from TWO-BYTES-BINARY
               move IO-STAT2 to TWO-BYTES-RIGHT
               display '* CBLSTRC1 File-Status-' IO-STAT1 '/'
                       TWO-BYTES-BINARY upon console
           else
               display '* CBLSTRC1 File-Status-' IO-STATUS upon console
           end-if
           exit.

      *****************************************************************
       Z-POST-COPYRIGHT.
           display SIM-TITLE     upon console
           display SIM-COPYRIGHT upon console
           exit.

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

Table of Contents Previous Section Next Section COBOL, Street Edit Routine

This program (SIMOROAD.cbl) does the editing of the street address. It does the case conversion, word substitution, identifies Post Office Box addresses and calculates the length of the text strings within the fields.

Note: This member is a part of the SIMOMODS package and is included here as a reference point or matter of convenience.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    SIMOROAD.
       AUTHOR.        SIMOTIME TECHNOLOGIES.
      *****************************************************************
      * Copyright (C) 1987-2019 SimoTime Technologies.                *
      *                                                               *
      * All rights reserved.  Unpublished, all rights reserved under  *
      * copyright law and international treaty.  Use of a copyright   *
      * notice is precautionary only and does not imply publication   *
      * or disclosure.                                                *
      *                                                               *
      * Permission to use, copy, modify and distribute this software  *
      * for any non-commercial purpose and without fee is hereby      *
      * granted, provided the SimoTime copyright notice appear on all *
      * copies of the software. The SimoTime name or Logo may not be  *
      * used in any advertising or publicity pertaining to the use    *
      * of the software without the written permission of SimoTime    *
      * Technologies.                                                 *
      *                                                               *
      * Permission to use, copy, modify and distribute this software  *
      * for any commercial purpose requires a fee to be paid to       *
      * SimoTime Technologies. Once the fee is received by SimoTime   *
      * the latest version of the software will be delivered and a    *
      * license will be granted for use within an enterprise,         *
      * provided the SimoTime copyright notice appear on all copies   *
      * of the software. The SimoTime name or Logo may not be used    *
      * in any advertising or publicity pertaining to the use of the  *
      * software without the written permission of SimoTime           *
      * Technologies.                                                 *
      *                                                               *
      * SimoTime Technologies makes no warranty or representations    *
      * about the suitability of the software for any purpose. It is  *
      * provided "AS IS" without any expressed or implied warranty,   *
      * including the implied warranties of merchantability, fitness  *
      * for a particular purpose and non-infringement. SimoTime       *
      * Technologies shall not be liable for any direct, indirect,    *
      * special or consequential damages resulting from the loss of   *
      * use, data or projects, whether in an action of contract or    *
      * tort, arising out of or in connection with the use or         *
      * performance of this software                                  *
      *                                                               *
      * SimoTime Technologies                                         *
      * 15 Carnoustie Drive                                           *
      * Novato, CA 94949-5849                                         *
      * 415.883.6565                                                  *
      *                                                               *
      * RESTRICTED RIGHTS LEGEND                                      *
      * Use, duplication, or disclosure by the Government is subject  *
      * to restrictions as set forth in subparagraph (c)(1)(ii) of    *
      * the Rights in Technical Data and Computer Software clause at  *
      * DFARS 52.227-7013 or subparagraphs (c)(1) and (2) of          *
      * Commercial  Computer Software - Restricted Rights  at 48      *
      * CFR 52.227-19, as applicable.  Contact SimoTime Technologies, *
      * 15 Carnoustie Drive, Novato, CA 94949-5849.                   *
      *                                                               *
      *****************************************************************
      *      This program is provided by SimoTime Technologies        *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *****************************************************************
      * Source Member: SIMOROAD.CBL
      * Copy Files:    PASSPARS.CPY
      * Calls to:      SIMOPARS
      *****************************************************************
      * MAINTENANCE
      * -----------
      * 1994/02/27 Simmons, Created program.
      * 1994/03/17 Simmons, Fixed bug to correct recalculation of the
      *            size of the edited street address.
      *
      *****************************************************************
       DATA DIVISION.
       WORKING-STORAGE SECTION.

       01  SIM-TITLE.
           05  T1 pic X(11) value '* SIMOROAD '.
           05  T2 pic X(32) value 'Processing a Street Address     '.
           05  T3 pic X(10) value ' v08.03.28'.
           05  T4 pic X(24) value ' http://www.simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* SIMOROAD '.
           05  C2 pic X(20) value 'Copyright 1987-2019 '.
           05  C3 pic X(28) value '   SimoTime Technologies    '.
           05  C4 pic X(20) value ' All Rights Reserved'.

       01  MESSAGE-BUFFER.
           05  MESSAGE-HEADER      pic X(11)   value '* SIMOROAD '.
           05  MESSAGE-TEXT.
               10  MESSAGE-TEXT-1  pic X(68)   value SPACES.
               10  MESSAGE-TEXT-2  pic X(188)  value SPACES.

       01  WORD-14                 pic X(14)   value SPACES.
       01  WORD-12                 pic X(12)   value SPACES.
       01  WORD-SIZE               pic 9(5)    value 0.

       01  X1                      pic 9(5)    value 0.
       01  X2                      pic 9(5)    value 0.
       01  X3                      pic 9(5)    value 0.

       01  LOWER-CASE  pic X(26)   value 'abcdefghijklmnopqrstuvwxyz'.
       01  UPPER-CASE  pic X(26)   value 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.

      *****************************************************************
      * The following copy file is the pass area for calling SIMOPARS,
      * the field parsing routine.
      *****************************************************************
       COPY PASSPARS.

      *****************************************************************
       LINKAGE SECTION.
       COPY PASSROAD.

      *****************************************************************
       PROCEDURE DIVISION using ROAD-PASS-AREA.
      *    perform Z-POST-COPYRIGHT
           move 'UNK ' to RDPA-ADR2-CNTL
           move SPACES to RDPA-ADR2-DATA
           add 16 to ZERO giving RDPA-RESULT

           evaluate RDPA-ADR1-CNTL
               when 'INP ' perform PROCESS-STREET-ADDRESS
               when OTHER  perform Z-ABEND-INVALID-REQUEST
           end-evaluate

           GOBACK.

      *****************************************************************
      * The following routines are in alphabetical sequence..         *
      *****************************************************************
      * This routine is used for debugging purposes,
      *****************************************************************
       ADDR-FUNCTION-DISPLAY-WORDS.
      *    Display the contents of the parsing tables.
           add 1 to ZERO giving X1
           perform until PRS-SIZE(X1) = 0
                      or PRS-POSITION(X1) = 0
                      or X1       > PRS-TABLE-MAX
                      or X1       > PRS-NUMBER-OF-ITEMS
               move X1 to MESSAGE-TEXT(6:5)
               move PRS-POSITION(X1) to MESSAGE-TEXT(19:4)
               move PRS-SIZE(X1) to MESSAGE-TEXT(32:4)
               if  PRS-SIZE(X1) < 20
                   move PRS-BUFFER(PRS-POSITION(X1):PRS-SIZE(X1))
                     to MESSAGE-TEXT(50:PRS-SIZE(X1))
               else
                   move PRS-BUFFER(PRS-POSITION(X1):19)
                     to MESSAGE-TEXT(50:19)
               end-if
               perform Z-DISPLAY-CONSOLE-MESSAGE
               add 1 to X1
           end-perform
           exit.

      *****************************************************************
      * Call the SIMOPARS routine to parse the Street Addres
      *****************************************************************
       ADDR-FUNCTION-PARSE.
      *>   Prepare control items for parsing.
           move '0' to PRS-REQUEST
           add 9 to ZERO giving PRS-STATUS
           move ' ' to PRS-DELIMITER
           move 'N' to PRS-TERMINATOR
           move ' ' to PRS-TERMINATOR-BYTE
           add 32 to ZERO giving PRS-TABLE-MAX
           if  RDPA-ADR1-SIZE > 0
               add RDPA-ADR1-SIZE to ZERO giving PRS-BUFFER-SIZE
           else
               add 48             to ZERO giving PRS-BUFFER-SIZE
           end-if
           move ZERO to PRS-NUMBER-OF-ITEMS
      *>   Move the data string to the parsing buffer and call
      *>   the parsing routine.
           move RDPA-ADR1-DATA to PRS-BUFFER
           call 'SIMOPARS'   using PRS-PARAMETERS
           if  PRS-STATUS not = 0
               move 'Parsing Failure of Address Field' to MESSAGE-TEXT
               perform Z-ABEND-PROGRAM
           end-if
           exit.

      *****************************************************************
       BUILD-NEW-STREET-ADDRESS.
           move SPACES to RDPA-ADR2-DATA
           inspect PRS-BUFFER(1:PRS-BUFFER-SIZE)
                   converting UPPER-CASE to LOWER-CASE
           add 1 to ZERO giving X1
           add 1 to ZERO giving X2
           perform until PRS-SIZE(X1) = 0
                      or PRS-POSITION(X1) = 0
                      or X1       > PRS-TABLE-MAX
                      or X1       > PRS-NUMBER-OF-ITEMS
               if  PRS-BUFFER(PRS-POSITION(X1):1) is NUMERIC
                   move PRS-BUFFER(PRS-POSITION(X1):PRS-SIZE(X1))
                     to RDPA-ADR2-DATA(X2:PRS-SIZE(X1))
                   inspect
                       RDPA-ADR2-DATA(X2:PRS-SIZE(X1))
                       converting LOWER-CASE to UPPER-CASE
                   add PRS-SIZE(X1) to X2
                   add 1            to X2
               else
                   perform BUILD-NEW-STREET-ADDRESS-100
               end-if
               add 1 to X1
           end-perform
           exit.

      *---------------------------------------------------------------*
       BUILD-NEW-STREET-ADDRESS-100.
           if  PRS-BUFFER(PRS-POSITION(X1):1) = 'p'
           and PRS-SIZE(X1)               < 5
               move SPACES to WORD-14
               move PRS-BUFFER(PRS-POSITION(X1):PRS-SIZE(X1))
                 to WORD-14
               perform BUILD-NEW-STREET-POSSIBLE-POB
           else
               perform BUILD-NEW-STREET-NORMAL-WORD
           end-if
           exit.

      *---------------------------------------------------------------*
       BUILD-NEW-STREET-POSSIBLE-POB.
           evaluate WORD-14
               when 'pob       ' perform BUILD-NEW-STREET-POSSIBLE-PO-1
               when 'pobox     ' perform BUILD-NEW-STREET-POSSIBLE-PO-1
               when 'p.o.box   ' perform BUILD-NEW-STREET-POSSIBLE-PO-1
               when 'pob.      ' perform BUILD-NEW-STREET-POSSIBLE-PO-1
               when 'po        ' perform BUILD-NEW-STREET-POSSIBLE-PO-2
               when 'p.o.      ' perform BUILD-NEW-STREET-POSSIBLE-PO-2
               when 'p.        ' perform BUILD-NEW-STREET-POSSIBLE-PO-3
               when 'p         ' perform BUILD-NEW-STREET-POSSIBLE-PO-3
               when 'post      ' perform BUILD-NEW-STREET-POSSIBLE-PO-3
               when OTHER        perform BUILD-NEW-STREET-NORMAL-WORD
           end-evaluate
           exit.

      *---------------------------------------------------------------*
       BUILD-NEW-STREET-POSSIBLE-PO-1.
           move 'POB ' to RDPA-ADR2-CNTL
           move 'P.O. Box '  to RDPA-ADR2-DATA(X2:9)
           add 9 to X2
           subtract RDPA-RESULT from RDPA-RESULT
           exit.

      *---------------------------------------------------------------*
       BUILD-NEW-STREET-POSSIBLE-PO-2.
           add X1 to 1 giving X3
           if  PRS-POSITION(X3) > 0
           and PRS-SIZE(X3) > 0
               if  PRS-BUFFER(PRS-POSITION(X3):4) = 'box '
                   move 'POB ' to RDPA-ADR2-CNTL
                   move 'P.O. Box '  to RDPA-ADR2-DATA(X2:9)
                   add 1 to X1
                   add 9 to X2
                   subtract RDPA-RESULT from RDPA-RESULT
               else
                   if  PRS-BUFFER(PRS-POSITION(X3):1) is NUMERIC
                       move 'POB ' to RDPA-ADR2-CNTL
                       move 'P.O. Box '  to RDPA-ADR2-DATA(X2:9)
                       add 9 to X2
                       subtract RDPA-RESULT from RDPA-RESULT
                   else
                       move 'PO? ' to RDPA-ADR2-CNTL
                       perform BUILD-NEW-STREET-NORMAL-WORD
                       subtract RDPA-RESULT from RDPA-RESULT
                   end-if
               end-if
           end-if
           exit.

      *---------------------------------------------------------------*
       BUILD-NEW-STREET-POSSIBLE-PO-3.
           add X1 to 1 giving X3
           if  PRS-POSITION(X3) > 0
           and PRS-SIZE(X3) > 0
               if  PRS-BUFFER(PRS-POSITION(X3):2) = 'o '
               or  PRS-BUFFER(PRS-POSITION(X3):3) = 'o. '
               or  PRS-BUFFER(PRS-POSITION(X3):7) = 'office '
                   add 1 to X3
                   if  PRS-BUFFER(PRS-POSITION(X3):4) = 'box '
                   and PRS-POSITION(X3) > 0
                   and PRS-SIZE(X3) > 0
                       move 'POB ' to RDPA-ADR2-CNTL
                       move 'P.O. Box '  to RDPA-ADR2-DATA(X2:9)
                       add 2 to X1
                       add 9 to X2
                       subtract RDPA-RESULT from RDPA-RESULT
                   else
                       if  PRS-BUFFER(PRS-POSITION(X3):1) is NUMERIC
                           move 'POB ' to RDPA-ADR2-CNTL
                           move 'P.O. Box '  to RDPA-ADR2-DATA(X2:9)
                           add 9 to X2
                           subtract RDPA-RESULT from RDPA-RESULT
                       else
                           move 'PO? ' to RDPA-ADR2-CNTL
                           perform BUILD-NEW-STREET-NORMAL-WORD
                           subtract RDPA-RESULT from RDPA-RESULT
                       end-if
                   end-if
               else
                   perform BUILD-NEW-STREET-NORMAL-WORD
               end-if
           end-if
           exit.

      *---------------------------------------------------------------*
       BUILD-NEW-STREET-NORMAL-WORD.
      *>   Test for possible word substitution...
           move SPACES to WORD-12
           if  PRS-SIZE(X1) < 13
               move PRS-BUFFER(PRS-POSITION(X1):PRS-SIZE(X1))
                 to WORD-12
               perform BUILD-NEW-STREET-SUB-WORD-ALL
           end-if

           if  WORD-12 = SPACES
               move PRS-BUFFER(PRS-POSITION(X1):PRS-SIZE(X1))
                 to RDPA-ADR2-DATA(X2:PRS-SIZE(X1))
               inspect RDPA-ADR2-DATA(X2:1)
                   converting LOWER-CASE to UPPER-CASE
               add PRS-SIZE(X1) to X2
               add 1              to X2
               subtract RDPA-RESULT from RDPA-RESULT
           else
               move WORD-12(1:WORD-SIZE)
                 to RDPA-ADR2-DATA(X2:WORD-SIZE)
               if  PRS-POSITION(X1) = 1
                   inspect RDPA-ADR2-DATA(X2:1)
                       converting LOWER-CASE to UPPER-CASE
               end-if
               add WORD-SIZE to X2
               add 1         to X2
               subtract RDPA-RESULT from RDPA-RESULT
           end-if
           exit.

      *---------------------------------------------------------------*
       BUILD-NEW-STREET-SUB-WORD-ALL.
           evaluate WORD-12
             when 'ave         ' move 'Avenue    '   to WORD-12
                                 add  6  to ZERO giving WORD-SIZE
             when 'ave.        ' move 'Avenue    '   to WORD-12
                                 add  6  to ZERO giving WORD-SIZE
             when 'bl          ' move 'Blvd      '   to WORD-12
                                 add  4  to ZERO giving WORD-SIZE
             when 'bl.         ' move 'Blvd      '   to WORD-12
                                 add  4  to ZERO giving WORD-SIZE
             when 'de          ' move 'de        '   to WORD-12
                                 add  2  to ZERO giving WORD-SIZE
             when 'la          ' move 'la        '   to WORD-12
                                 add  2  to ZERO giving WORD-SIZE
             when 'of          ' move 'of        '   to WORD-12
                                 add  2  to ZERO giving WORD-SIZE
             when 'and         ' move 'and       '   to WORD-12
                                 add  3  to ZERO giving WORD-SIZE
             when 'the         ' move 'the       '   to WORD-12
                                 add  3  to ZERO giving WORD-SIZE
             when 'macdougal   ' move 'MacDougal'    to WORD-12
                                 add  9  to ZERO giving WORD-SIZE
             when OTHER          move SPACES to WORD-12
           end-evaluate
           exit.

      *****************************************************************
       CALCULATE-BUFFER-SIZE-01.
           add PRS-NUMBER-OF-ITEMS to ZERO giving X1
           add PRS-POSITION(X1) to PRS-SIZE(X1) giving RDPA-ADR1-SIZE
           subtract 1 from RDPA-ADR1-SIZE
           exit.

      *****************************************************************
       CALCULATE-BUFFER-SIZE-02.
           if  RDPA-ADR2-DATA = SPACES
               move ZERO to RDPA-ADR2-SIZE
           else
               add length of RDPA-ADR2-DATA to ZERO giving X1
               add length of RDPA-ADR2-DATA to ZERO giving X3
               perform  until X1 not = X3
                           or X1     < 4
                 divide X3 by 2 giving X1
                 if  X1 > 0
                     if  RDPA-ADR2-DATA(X1 + 1:X3 - X1) = SPACES
                         add X1 to ZERO giving X3
                     end-if
                 end-if
               end-perform
               add 1 to ZERO giving RDPA-ADR2-SIZE
               move ZERO to X2
               perform until X2 = X3
                 add 1 to X2
                 if  RDPA-ADR2-DATA(X2:1) not = SPACE
                     add X2 to ZERO giving RDPA-ADR2-SIZE
                 end-if
               end-perform
           end-if
           exit.

      *****************************************************************
       COMPRESS-MULTIPLE-SPACES.
           move SPACES to RDPA-ADR2-DATA
           add 1 to ZERO giving X1
           add 1 to ZERO giving X2
           perform until PRS-SIZE(X1) = 0
                      or PRS-POSITION(X1) = 0
                      or X1       > PRS-TABLE-MAX
                      or X1       > PRS-NUMBER-OF-ITEMS
               move PRS-BUFFER(PRS-POSITION(X1):PRS-SIZE(X1))
                 to RDPA-ADR2-DATA(X2:PRS-SIZE(X1))
               add X2 to ZERO giving PRS-POSITION(X1)
               add PRS-SIZE(X1) to X2
               add 1 to X2
               add 1 to X1
           end-perform
           move SPACES to PRS-BUFFER
           move RDPA-ADR2-DATA to PRS-BUFFER
           move SPACES to RDPA-ADR2-DATA
           exit.

      *---------------------------------------------------------------*
       POST-TABLE-ITEM.
           move 'Item-nnnn, Offset-nnnn, Length-nnnn, Parameter - '
             to MESSAGE-TEXT(1:49)
           move X1 to MESSAGE-TEXT(6:4)
           move PRS-POSITION(X1) to MESSAGE-TEXT(19:4)
           move PRS-SIZE(X1) to MESSAGE-TEXT(32:4)
           if  PRS-SIZE(X1) < 20
               move PRS-BUFFER(PRS-POSITION(X1):PRS-SIZE(X1))
                 to MESSAGE-TEXT(50:PRS-SIZE(X1))
           else
               move PRS-BUFFER(PRS-POSITION(X1):19)
                 to MESSAGE-TEXT(50:19)
           end-if
           perform Z-DISPLAY-CONSOLE-MESSAGE
           exit.

      *****************************************************************
       PROCESS-STREET-ADDRESS.
           if  RDPA-ADR1-DATA = SPACES
           or  RDPA-ADR1-DATA = LOW-VALUES
               perform Z-ABEND-INVALID-INPUT
           else
               perform ADDR-FUNCTION-PARSE
               perform CALCULATE-BUFFER-SIZE-01
               if  PRS-STATUS = 0
      *            perform ADDR-FUNCTION-DISPLAY-WORDS
                   perform COMPRESS-MULTIPLE-SPACES
                   perform PROCESS-STREET-ADDRESS-100
                   perform CALCULATE-BUFFER-SIZE-02
               else
                   move 'Parsing Error' to RDPA-ADR2-DATA
                   move RDPA-ADR2-DATA to MESSAGE-TEXT
                   perform Z-DISPLAY-CONSOLE-MESSAGE
               end-if

           end-if.
           exit.

      *---------------------------------------------------------------*
       PROCESS-STREET-ADDRESS-100.
           perform BUILD-NEW-STREET-ADDRESS
           if  RDPA-ADR2-CNTL = 'UNK '
           and RDPA-ADR2-DATA not = SPACES
               if  RDPA-ADR1-DATA = RDPA-ADR2-DATA
                   move 'AOK ' to RDPA-ADR2-CNTL
                   subtract RDPA-RESULT from RDPA-RESULT
               else
                   move 'MOD ' to RDPA-ADR2-CNTL
                   subtract RDPA-RESULT from RDPA-RESULT
               end-if
               subtract RDPA-RESULT from RDPA-RESULT
           end-if
           exit.

      *****************************************************************
      * The following Z-Routines perform 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-CONSOLE-MESSAGE
           end-if
           move 'PROGRAM-IS-ABENDING...'  to MESSAGE-TEXT
           perform Z-DISPLAY-CONSOLE-MESSAGE
           add 12 to ZERO giving RETURN-CODE
           STOP RUN.
      *    exit.

      *---------------------------------------------------------------*
       Z-ABEND-INVALID-REQUEST.
           add 18 to ZERO giving RDPA-RESULT
           move 'ERR ' to RDPA-ADR2-CNTL
           move 'Call to SimoROAD with invalid request'
             to RDPA-ADR2-DATA
           exit.

      *---------------------------------------------------------------*
       Z-ABEND-INVALID-INPUT.
           add 20 to ZERO giving RDPA-RESULT
           move 'ERR ' to RDPA-ADR2-CNTL
           move 'Call to SimoROAD with blank input address'
             to RDPA-ADR2-DATA
           exit.

      *****************************************************************
      * Display CONSOLE messages...                                   *
      *****************************************************************
       Z-DISPLAY-CONSOLE-MESSAGE.
           if MESSAGE-TEXT-2 = SPACES
               display MESSAGE-BUFFER(1:79) upon console
           else
               display MESSAGE-BUFFER upon console
           end-if
           move all SPACES to MESSAGE-TEXT
           exit.

      *****************************************************************
       Z-POST-COPYRIGHT.
           display SIM-TITLE     upon console
           display SIM-COPYRIGHT upon console
           exit.
      *****************************************************************
      *      This example is provided by SimoTime Technologies        *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************

Table of Contents Previous Section Next Section COBOL, Parsing Routine

This program (SIMOPARS.cbl) was written to provide parsing capability of a data string. It uses "Reference Modification" to scan the data string.

Note: This member is a part of the SIMOMODS package and is included here as a reference point or matter of convenience.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    SIMOPARS.
       AUTHOR.        SIMOTIME TECHNOLOGIES.
      *****************************************************************
      * Copyright (C) 1987-2019 SimoTime Technologies.                *
      *                                                               *
      * All rights reserved.  Unpublished, all rights reserved under  *
      * copyright law and international treaty.  Use of a copyright   *
      * notice is precautionary only and does not imply publication   *
      * or disclosure.                                                *
      *                                                               *
      * Permission to use, copy, modify and distribute this software  *
      * for any non-commercial purpose and without fee is hereby      *
      * granted, provided the SimoTime copyright notice appear on all *
      * copies of the software. The SimoTime name or Logo may not be  *
      * used in any advertising or publicity pertaining to the use    *
      * of the software without the written permission of SimoTime    *
      * Technologies.                                                 *
      *                                                               *
      * Permission to use, copy, modify and distribute this software  *
      * for any commercial purpose requires a fee to be paid to       *
      * SimoTime Technologies. Once the fee is received by SimoTime   *
      * the latest version of the software will be delivered and a    *
      * license will be granted for use within an enterprise,         *
      * provided the SimoTime copyright notice appear on all copies   *
      * of the software. The SimoTime name or Logo may not be used    *
      * in any advertising or publicity pertaining to the use of the  *
      * software without the written permission of SimoTime           *
      * Technologies.                                                 *
      *                                                               *
      * SimoTime Technologies makes no warranty or representations    *
      * about the suitability of the software for any purpose. It is  *
      * provided "AS IS" without any expressed or implied warranty,   *
      * including the implied warranties of merchantability, fitness  *
      * for a particular purpose and non-infringement. SimoTime       *
      * Technologies shall not be liable for any direct, indirect,    *
      * special or consequential damages resulting from the loss of   *
      * use, data or projects, whether in an action of contract or    *
      * tort, arising out of or in connection with the use or         *
      * performance of this software                                  *
      *                                                               *
      * SimoTime Technologies                                         *
      * 15 Carnoustie Drive                                           *
      * Novato, CA 94949-5849                                         *
      * 415.883.6565                                                  *
      *                                                               *
      * RESTRICTED RIGHTS LEGEND                                      *
      * Use, duplication, or disclosure by the Government is subject  *
      * to restrictions as set forth in subparagraph (c)(1)(ii) of    *
      * the Rights in Technical Data and Computer Software clause at  *
      * DFARS 52.227-7013 or subparagraphs (c)(1) and (2) of          *
      * Commercial  Computer Software - Restricted Rights  at 48      *
      * CFR 52.227-19, as applicable.  Contact SimoTime Technologies, *
      * 15 Carnoustie Drive, Novato, CA 94949-5849.                   *
      *                                                               *
      *****************************************************************
      *      This program is provided by SimoTime Technologies        *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *****************************************************************
      *
      *****************************************************************
      * Source Member: SIMOPARS.CBL
      * Copy Files     PASSPARS.CPY
      *****************************************************************
      *
      * SIMOPARS - Parse Buffer defined in pass area.
      *
      * CALLING PROTOCOL
      * ----------------
      * call 'SIMOPARS' using PRS-PARAMETERS
      *
      *    01  PRS-PARAMETERS.
      *        05  PRS-REQUEST          PIC X       VALUE '0'.
      *        05  PRS-STATUS           PIC 9(4).
      *        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 2048.
      *        05  PRS-BUFFER           PIC X(2048).
      *        05  PRS-TABLE-MAX        PIC 9(4)    VALUE 128.
      *        05  PRS-NUMBER-OF-ITEMS  PIC 9(4)    VALUE 0.
      *        05  PRS-LAST-SIG-BYTE    PIC 9(4)    VALUE 0.
      *        05  PRS-POSITION         OCCURS 128 TIMES
      *                                 PIC 9(4)    VALUE 0.
      *        05  PRS-SIZE             OCCURS 128 TIMES
      *
      * This routine uses reference modification to identify the
      * position of the first significant character after the
      * delimiter character. This approach compensates for multiple
      * leading or embedded delimiter characters. The string function
      * of COBOL does not handle leading spaces.
      *
      * For example, if the delimiter character is a space then
      * leading spaces will be ignored and multiple, embedded spaces
      * will be treated as a single space.
      *
      * MAINTENANCE
      * -----------
      * 1998/01/02 Simmons, CREATED PROGRAM.
      * 1998/01/02 Simmons, No changes to date...
      *
      *****************************************************************
      *
       ENVIRONMENT DIVISION.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
      *****************************************************************
      * Data-structure for Program use...                             *
      *****************************************************************
       01  I-PTR               pic 9(4)    value 0.
       01  O-PTR               pic 9(4)    value 0.
       01  B-COUNT             pic 9(4)    value 0.

      *****************************************************************
      * Message Buffer used by the Z-DISPLAY-MESSAGE-TEXT routine.    *
      *****************************************************************
       01  MESSAGE-BUFFER.
           05  MESSAGE-HEADER      pic X(11)   value '* SIMOPARS '.
           05  MESSAGE-TEXT.
               10  MESSAGE-TEXT-1  pic X(68)   value SPACES.
               10  MESSAGE-TEXT-2  pic X(188)  value SPACES.

      *****************************************************************
       LINKAGE SECTION.
       COPY PASSPARS.

      *****************************************************************
       PROCEDURE DIVISION using PRS-PARAMETERS.
           if  PRS-REQUEST not = '2'
               perform EDIT-LINKAGE-ITEMS
           end-if

           add      8 to   ZERO giving RETURN-CODE
           add      9 to   ZERO giving PRS-STATUS
           move ZERO to PRS-NUMBER-OF-ITEMS
           evaluate PRS-REQUEST
             when '0'   perform PARSE-BUFFER
             when '1'   perform INITIALIZE-TABLE-ELEMENTS
             when '2'   perform INITIALIZE-DEFAULT-VALUES
             when OTHER add 12 to ZERO giving PRS-STATUS
           end-evaluate

           if  PRS-STATUS = 9
               subtract PRS-STATUS from PRS-STATUS
           end-if

           GOBACK.

      *****************************************************************
       EDIT-LINKAGE-ITEMS.
           if  PRS-TABLE-MAX not numeric
               add 128 to ZERO giving PRS-TABLE-MAX
               move 'PRS-TABLE-MAX set to 128' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
           end-if
           if  PRS-TABLE-MAX > 128
               add 128 to ZERO giving PRS-TABLE-MAX
               move 'PRS-TABLE-MAX set to 128' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
           end-if

           if  PRS-BUFFER-SIZE not numeric
               add 2048 to ZERO giving PRS-BUFFER-SIZE
               move 'PRS-BUFFER-SIZE set to 2048' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
           end-if
           if  PRS-BUFFER-SIZE > 2048
               add 2048 to ZERO giving PRS-BUFFER-SIZE
               move 'PRS-BUFFER-SIZE set to 2048' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TEXT
           end-if

           exit.

      *****************************************************************
       INITIALIZE-DEFAULT-VALUES.
           move ',' to PRS-DELIMITER
           move 'Y' to PRS-SPACE-TRUNCATION
           move 'Y' to PRS-KEEP-NULL-FIELDS
           add 128 to ZERO giving PRS-TABLE-MAX
           add 2048 to ZERO giving PRS-BUFFER-SIZE
           perform INITIALIZE-TABLE-ELEMENTS
           move '0' to PRS-REQUEST
           move ZERO to PRS-STATUS
           move ZERO to PRS-NUMBER-OF-ITEMS
           move ZERO to PRS-LAST-SIG-BYTE
           exit.

      *****************************************************************
       INITIALIZE-TABLE-ELEMENTS.
           move 1 to I-PTR
           move 1 to O-PTR
           perform until O-PTR > PRS-TABLE-MAX
               move 0 to PRS-POSITION(O-PTR)
               move 0 to PRS-SIZE(O-PTR)
               add  1 to O-PTR
           end-perform
           subtract RETURN-CODE from RETURN-CODE
           exit.

      *****************************************************************
       PARSE-BUFFER.
      *!   Initialize Position/Length tables to zero (0).
           perform INITIALIZE-TABLE-ELEMENTS
           move ZERO to PRS-LAST-SIG-BYTE
      *!   Parse the Buffer.
           add 1 to ZERO giving O-PTR
           perform until I-PTR > PRS-BUFFER-SIZE
             perform PARSE-BUFFER-10
           end-perform

      *    Wrap-up the parse of this buffer...
           if  PRS-LAST-SIG-BYTE > 0
           and PRS-BUFFER(PRS-LAST-SIG-BYTE:1) not = PRS-DELIMITER
               add 1 to PRS-NUMBER-OF-ITEMS
           end-if

           if  PRS-POSITION(O-PTR) = 0
               subtract 1 from O-PTR
           end-if

           subtract RETURN-CODE from RETURN-CODE

           exit.
      *---------------------------------------------------------------*
       PARSE-BUFFER-10.
           if  PRS-BUFFER(I-PTR:1) not = SPACE
               add I-PTR to ZERO giving PRS-LAST-SIG-BYTE
           end-if

           if  PRS-BUFFER(I-PTR:1) = PRS-DELIMITER
               add 1 to B-COUNT
               if  PRS-KEEP-NULL-FIELDS = 'Y'
               or  B-COUNT = 1
               and PRS-SIZE(O-PTR) > 0
                   if  O-PTR < PRS-TABLE-MAX
                       add 1 to O-PTR
                       add 1 to PRS-NUMBER-OF-ITEMS
                   else
                       move PRS-BUFFER-SIZE to I-PTR
                   end-if
               end-if
           else
               subtract B-COUNT from B-COUNT
               add 1 to PRS-SIZE(O-PTR)
               if  PRS-SIZE(O-PTR) = 1
                   move I-PTR to PRS-POSITION(O-PTR)
               end-if
           end-if

           add 1 to I-PTR
           if  PRS-TERMINATOR = 'Y'
           and I-PTR  not > PRS-BUFFER-SIZE
           and PRS-BUFFER(I-PTR:1) = PRS-TERMINATOR-BYTE
               if  PRS-SIZE(O-PTR) > 0
                   add 1 to PRS-NUMBER-OF-ITEMS
               end-if
               add PRS-BUFFER-SIZE to 1 giving I-PTR
           end-if

           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.

      *****************************************************************
      *      This example is provided by SimoTime Technologies        *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************

Table of Contents Previous Section Next Section Copy File for the Pass Area

The following is the copy file (PASSROAD.cpy) used for the pass area when calling the parsing routine.

      *****************************************************************
      *     Data Structure or Pass Area used for calling SIMOROAD.    *
      *****************************************************************
      *         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       *
      *****************************************************************
      * RDPA-REQUEST,   Type of request, must be "SIMOROAD" for
      *                 parsing. This item is provided by the calling
      *                 program and is not modified by the parse and
      *                 edit routine.
      * RDPA-RESULT,    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.
      * RDPA-ADR1-CNTL, This is a four byte string that is used to
      *                 specify input data. This string should
      *                 contain "INP ". This item is provided by the
      *                 calling program and is not modified by the
      *                 parse and edit routine.
      * RDPA-ADR1-DATA, This string must contain the street address
      *                 to be parsed and edited. This string is not
      *                 modified by the parse and edit routine.
      * RDPA-ADR1-SIZE, This is the size of the actual text within
      *                 the RDPA-ADR1-DATA string. This item is
      *                 created by the parse and edit routine.
      * RDPA-ADR2-CNTL, This is a four byte string that is used to
      *                 specify the result of the parse and edit
      *                 routine for the input street address. This
      *                 item is created by the parse and edit routine.
      * RDPA-ADR2-DATA, This string will contain the street address
      *                 that is created by the parse and edit routine.
      * RDPA-ADR2-SIZE, This is the size of the actual text within
      *                 the RDPA-ADR2-DATA string. This item is
      *                 created by the parse and edit routine.
      *
       01  ROAD-PASS-AREA.
           05  RDPA-REQUEST    PIC X(8).
           05  RDPA-RESULT     PIC S9(9)   COMP.
           05  RDPA-ADR1-CNTL  PIC X(4).
           05  RDPA-ADR1-DATA  PIC X(128).
           05  RDPA-ADR1-SIZE  PIC 9(5).
           05  RDPA-ADR2-CNTL  PIC X(4).
           05  RDPA-ADR2-DATA  PIC X(256).
           05  RDPA-ADR2-SIZE  PIC 9(5).
      *
      ***  PASSROAD - End-of-Copy File - - - - - - - - - - - PASSROAD *
      *****************************************************************
      *

Table of Contents Previous Section Next Section Summary

The objective of this suite of programs is to examine a data string containing a street address and produce a new data string with an edited version of the street address. 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.

Table of Contents Previous Section Next Section Software Agreement and Disclaimer

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

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

Table of Contents Previous Section Next Section Downloads and Links

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

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

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

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

Link to Internet   Link to Server   Explore The File Status Return Codes that are used to interpret the results of accessing VSAM data sets and/or QSAM files.

Table of Contents Previous Section Next Section Internet Access Required

The following links will require an internet connect.

This suite of programs and documentation is available 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.

Table of Contents Previous Section Next Section Glossary of Terms

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

Table of Contents Previous Section Next Section Contact or Feedback

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

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

 

We appreciate hearing from you.

Table of Contents Previous Section Next Section Company Overview

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

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

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

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


Return-to-Top
Validate a Street Address, COBOL parses a Street Address
Copyright © 1987-2025
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com