APPENDIX 8: SAMPLE APPLICATION PROGRAMS AND JCL

This appendix exhibits sample batch user application programs written in COBOL, Assembler, PL/1, C and NATURAL. These programs exemplify how a user-written application program may be coded to interact with Geosupport via its Application Programming Interface (API).

For each sample program, this appendix contains a printout of the job-stream input for an MSW application, the job-stream input for a COW application, and a printout of the program execution output report. The job-stream input contains the JCL to compile, link-edit and execute the program and, embedded in the JCL, the program source code (except for NATURAL) and a few in-stream records of sample input data. The NATURAL program source code is not embedded in the job-stream, and is printed separately. The MSW and COW sample programs both generate the same output report.

Please note that the sample application programs are not guaranteed to run exactly as shown in this appendix. The samples are here as an aid in developing Geosupport application programs.

All of the sample programs use the Geosupport COPY facility. Since this appendix displays un-compiled source code rather than compilation output listings, the source code is shown without the COPY file expansions. Therefore, the source code as shown contains references to fields in Geosupport work areas but does not contain the definitions of those fields. To see those definitions, refer to the listings of the COPY file contents in Appendix 5 (for MSW) and Appendix 14 (for COW).

There are two sample programs in each programming language, referred to as Sample Programs #1 and #2. The processing performed in Sample Program #1 is similar for all of the programming languages, as is the processing performed in Sample Program #2. Note: there is an MSW and COW version of each of the sample programs.

In brief, Sample Program #1 reads a record containing an address from the in-stream input file; calls Functions 1 and D, checking the Geosupport Return Code (GRC) generated by each call; and writes a record into a formatted output report. The report displays the input address data and, as appropriate, selected output data obtained from Geosupport and/or the GRC, Reason Code and Message.

Sample Program #2 performs similar processing, but its input file contains street intersections instead of addresses, and accordingly it calls Function 2 instead of Function 1.

Both sample programs use the Compact Names feature to direct Geosupport to return street names in a format suitable for display in the output report. In addition, Sample Program #1, but not Sample Program #2, uses the Street Name Normalization Length Limit (SNL) feature to limit the lengths of normalized street names so they will fit into that program’s output report.

In both sample programs, Function D is called to generate the cross street names. Note, that Geosupport will generate all the cross street names automatically if the user specifies the Cross Street Names Flag in the initial Function 1 or Function 2 call or if the user calls Functions 1/1E Extended or Function 1B. (See Cross Street Names Flag in Appendix 3.) The Function D call, however, is used in the sample programs to demonstrate use of Function D and a one work-area-call.

In detail, the processing performed by Sample Program #1 is as follows:

  • Read a record from the in-stream input file.

  • Prime Work Area 1 with the function code, the Work Area Format Indicator (required for COW), the address information (Borough Code, House Number and Street Name) from the input record, the appropriate SNL value, and the code required to request street names in the compact format.

  • Call Function 1.

  • Examine the Geosupport Return Code (GRC).

  • If the GRC indicates a successful call or a warning, use the street codes of the cross streets retrieved in WA2 as input to a Function D call to obtain their street names for display in the output report 14. The Function D processing is performed as follows:

  • Prime Work Area 1 with the function code value, the Work Area Format Indicator (required for COW), and the street codes of the cross streets obtained from the Function 1 call.

  • Call Function D

  • Note: If the Cross Street Names Flag is used in the original call to Function 1 (or if Extended Mode of Function1 is used or if Function 1B is used), all the cross street names will be returned.

  • Examine the GRC.

  • If the GRC is zeros, include the street names obtained from Function D in the output report. Otherwise, include the GRC, the Reason Code and the warning/reject message in the output report.

  • Write an output report line containing the input information and, selected output information obtained from Work Area 2 (e.g., the ZIP code, Community District, and cross streets) and/or the Geosupport Return Code, Reason Code and Message

___________________________

14 Note: The sample programs have been written in a skeletal fashion to illustrate the use of the Geosupport API as clearly as possible. Thus, for example, Sample Program #1 assumes, when it gets a ’hit’ for an input address, that WA2 contains at least one cross street at each end of the block face containing the address. In reality, this is not necessarily the case; in a real application, the program would check for the presence of cross street codes before calling Function D.

COBOL SAMPLE PROGRAM #1

- Input Job Stream - MSW
- Input Job Stream - COW
- Output Report

COBOL SAMPLE PROGRAM #1-JOB Stream-MSW

          //COBF1SRC JOB   YOUR-JOB-CARD-INFORMATION
          //*
          //********************************************************************
          //***  COBOL SAMPLE BATCH GEOSUPPORT USER APPLICATION PROGRAM \#1  ****
          //***                     MSW FORMAT                              ****
          //********************************************************************
          //STEP1 EXEC   IGYWCLG,PARM.COBOL=(NOWORD,OPTIMIZE)
          //COBOL.SYSLIB DD DSN=A030.GEO.COPYLIB2,DISP=SHR
          //             DD DSN=A030.GEO.COPYLIB,DISP=SHR
          //COBOL.SYSIN  DD *
                *****************************************************************
                \* THIS PROGRAM MAKES FUNCTION 1 AND D CALLS TO GEOSUPPORT USING *
                \* BORO, HOUSE NUMBER & STREET NAME SUPPLIED BY AN INSTREAM FILE.*
                \* FUNCTION 1 RETURNS GEOGRAPHIC INFORMATION FOR AN ADDRESS.     *
                \* FUNCTION D TRANSLATES AN INPUT STREET CODE TO A STREET NAME.  *
                \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
                \*       NOTE: IF THE CROSS STREET NAMES FLAG WERE USED IN THE   *
                \*             ORIGINAL CALL TO FUNCTION 1, ALL THE CROSS STREET *
                \*             NAMES WOULD HAVE BEEN RETURNED BY FUNCTION 1.     *
                *****************************************************************
                *
                 IDENTIFICATION DIVISION.
                   PROGRAM-ID. COBS1JOB.

                ****************************************

                 ENVIRONMENT DIVISION.
                   INPUT-OUTPUT SECTION.
                   FILE-CONTROL.
                     SELECT IN-FILE ASSIGN TO INFILE.
                     SELECT RPT-FILE ASSIGN TO RPTFILE.

                ****************************************

                 DATA DIVISION.
                   FILE SECTION.

                **** REPLACE CODE BELOW WITH YOUR OWN INPUT FILE DEFINTION *****
                   FD  IN-FILE
                       RECORDING MODE IS F
                       RECORD CONTAINS 80 CHARACTERS
                       LABEL RECORDS ARE OMITTED.

                 01  INPUT-TO-GEOSUPPORT.
                     05  IN-BORO-CODE        PIC X.
                     05  FILLER              PIC X.
                     05  IN-HOUSE-NUMBER     PIC X(12).
                     05  FILLER              PIC X.
                     05  IN-STREET           PIC X(32).
                     05  FILLER              PIC X(33).

                   FD  RPT-FILE
                       RECORDING MODE IS F
                       RECORD CONTAINS 132 CHARACTERS
                       LABEL RECORDS ARE OMITTED.

                 01  RPT-LINE                PIC X(132).
                 WORKING-STORAGE SECTION.
                 **************************************************************
                *** USE OF GEOSUPPORT COPY LIBRARIES (REFERENCED BELOW BY THE ***
                *** COPY STATEMENTS) IS STRONGLY ENCOURAGED.                  ***
                *****************************************************************
                 01  WORK1.    COPY  W1COB.
                 01  WORK2.    COPY  W2COB.

                **** REPLACE CODE BELOW WITH YOUR OWN REPORT LAYOUT    *********

                 01  RPT-DATA-LINE1.
                     05  OUT-BOR             PIC X.
                     05  FILLER              PIC X         VALUE ' '.
                     05  OUT-HN              PIC X(12).
                     05  FILLER              PIC X         VALUE ' '.
                     05  OUT-ST              PIC X(32).
                     05  FILLER              PIC X         VALUE ' '.
                     05  OUT-ZIP             PIC X(5).
                     05  FILLER              PIC X         VALUE ' '.
                     05  OUT-CD              PIC X(2).
                     05  FILLER              PIC X         VALUE ' '.
                     05  OUT-NYPD-PCT        PIC X(3).
                     05  FILLER              PIC X(6)      VALUE ' '.
                     05  OUT-SCHLDIST        PIC X(2).
                     05  FILLER              PIC X(58)     VALUE ' '.

                 01  RPT-DATA-LINE2.
                     05  FILLER              PIC X(74)     VALUE ' '.
                     05  OUT-LO-X-STREET     PIC X(25).
                     05  FILLER              PIC X VALUE ' '.
                     05  OUT-HI-X-STREET     PIC X(25).

                 01  RPT-ERR-LINE-1.
                     05  ERR-BOR             PIC X.
                     05  FILLER              PIC X         VALUE ' '.
                     05  ERR-HN              PIC X(12).
                     05  FILLER              PIC X         VALUE ' '.
                     05  ERR-ST              PIC X(32).
                     05  FILLER              PIC X(14)
                         VALUE ' *** FUNCTION '.
                     05  ERR-FUNCTION        PIC X.
                     05  FILLER              PIC X(7)
                         VALUE ' GRC = '.
                     05  ERR-GRC             PIC X(2).
                     05  FILLER              PIC X(15) VALUE ' REASON CODE = '.
                     05  ERR-REASON          PIC X.
                     05  FILLER              PIC X(45) VALUE ' '.

                 01  RPT-ERR-LINE-2.
                     05  FILLER              PIC X(48) VALUE ' '.
                     05  FILLER              PIC X(4) VALUE '*** '.
                     05  OUT-ERR-MSG         PIC X(80).

                 01  RPT-WRN-LINE.
                     05  WRN-BOR             PIC X.
                     05  FILLER              PIC X         VALUE ' '.
                     05  WRN-HN              PIC X(12).

              05  FILLER             PIC X         VALUE ' '.
                     05  WRN-ST              PIC X(32).
                     05  FILLER              PIC X(14)
                         VALUE ' *** FUNCTION '.
                     05  WRN-FUNCTION        PIC X.
                     05  FILLER              PIC X(16)
                   VALUE ' WARNING, GRC = '.
                     05  WRN-GRC             PIC X(2).
                     05  FILLER              PIC X(15) VALUE ' REASON CODE = '.
                     05  WRN-REASON          PIC X(1).
                     05  FILLER              PIC X(36) VALUE ' '.

                 01  RPT-HEADER-1.
                     05  FILLER              PIC X(40)  VALUE
                     'SAMPLE COBOL PROGRAM \#1 EXECUTION OUTPUT'.
                     05  FILLER              PIC X(72) VALUE ' '.

                 01  RPT-HEADER-2.
                     05  FILLER              PIC X(58)  VALUE
                     '*****---------- INPUT ADDRESS ------------***** *****-----'.
                     05  FILLER              PIC X(58)  VALUE
                     '---------------- SELECTED OUTPUT ITEMS -------------------'.
                     05  FILLER              PIC X(16)  VALUE
                     '----*****       '.

                 01  RPT-HEADER-3.
                     05  FILLER              PIC X(58)  VALUE
                     'B HOUSE NUMBER IN-STREET-NAME                     ZIP CD N'.
                     05  FILLER              PIC X(58)  VALUE
                     'YPD-PCT SCHLDST LOW CROSS STREET          HIGH CROSS STREE'.
                     05  FILLER              PIC X(16)  VALUE
                     'T               '.

                 01  RPT-HEADER-4.
                     05  FILLER              PIC X(58)  VALUE
                     '_ ____________ ________________________________ _____ __ \_'.
                     05  FILLER              PIC X(58)  VALUE
                     '_______ _______ _________________________ ________________'.
                     05  FILLER              PIC X(16)  VALUE
                     '_________       '.

                 01  FLAGS.
                     05 DATA-FLAG    PIC XXX   VALUE 'YES'.
                       88 MORE-DATA            VALUE 'YES'.
                       88 NO-DATA              VALUE 'NO '.

                ****************************************

                 PROCEDURE DIVISION.

                     OPEN INPUT IN-FILE, OUTPUT RPT-FILE.
                     WRITE RPT-LINE FROM RPT-HEADER-1 AFTER ADVANCING 1 LINES.
                     WRITE RPT-LINE FROM RPT-HEADER-2 AFTER ADVANCING 2 LINES.
                     WRITE RPT-LINE FROM RPT-HEADER-3 AFTER ADVANCING 2 LINES.
                     WRITE RPT-LINE FROM RPT-HEADER-4 AFTER ADVANCING 0 LINES.
                     READ IN-FILE AT END MOVE 'NO ' TO DATA-FLAG.
                     PERFORM PROCESS THRU PROCESS-EX
              UNTIL NO-DATA.
                     CLOSE IN-FILE, RPT-FILE.
                     MOVE 0 TO RETURN-CODE
                     STOP RUN.

          Process.
                *****************************************************************
                \* TO MAKE A FUNCTION 1 CALL:                                    *
                \*   (1) INITIALIZE WORKAREA 1 TO SPACES                         *
                \*   (2) SET WA1'S FUNCTION CODE FIELD TO 1                      *
                \*   (3) MOVE THE INPUT BORO TO WA1'S INPUT BORO CODE FIELD      *
                \*   (4) MOVE THE INPUT HOUSE NUMBER TO WA1'S INPUT HOUSE NUMBER *
                \*       FIELD                                                   *
                \*   (5) MOVE THE INPUT STREET TO WA1'S INPUT STREET NAME FIELD  *
                \*   (6) CALL GBI WITH 2 WORKAREAS                               *
                \*   (7) CHECK RETURN CODES FOR ERRORS OR WARNINGS               *
                *****************************************************************
                *****************************************************************
                \* AS OF GEOSUPPORT 10.1,                                        *
                \* TO RECEIVE ROADBED-SPECIFIC INFORMATION,                      *
                \* SET THE ROADBED REQUEST SWITCH TO 'R', AS FOLLOWS:            *
                \* MOVE 'R' TO GEO-WA1-IN-ROADBED-REQ-SWITCH.                    *
                *****************************************************************
                     MOVE SPACES TO WORK1.
                     MOVE '1 ' TO GEO-WA1-IN-FUNCTION-CODE.
                     MOVE IN-BORO-CODE TO GEO-WA1-IN-BORO OUT-BOR ERR-BOR WRN-BOR.
                     MOVE IN-HOUSE-NUMBER TO GEO-WA1-IN-HOUSENUM OUT-HN ERR-HN
                                                                 WRN-HN.
                     MOVE IN-STREET TO GEO-WA1-IN-STREET-1 OUT-ST ERR-ST WRN-ST.
                     CALL 'GBI' USING WORK1 WORK2.

                     IF GEO-WA1-OUT-RETURN-CODE NOT = 00
                        MOVE '1' TO ERR-FUNCTION WRN-FUNCTION
                        PERFORM PRINT-ERROR-LINE THRU P-E-EX.

                     IF (GEO-WA1-OUT-RETURN-CODE = 00) OR
                       (GEO-WA1-OUT-RETURN-CODE = 01)
                        PERFORM SUCCESSFUL-FUNC1 THRU S-F1-EX.

                     READ IN-FILE AT END MOVE 'NO ' TO DATA-FLAG.

                 PROCESS-EX.
                     EXIT.

                 SUCCESSFUL-FUNC1.

                ***********************************************************
                ***** REPLACE CODE BELOW WITH YOUR OWN CODE FOR ***********
                ***** PROCESSING SUCCESSFUL GEOSUPPORT CALLS          *****
                ***********************************************************
                     MOVE GEO-WA2-FN1-ZIP            TO OUT-ZIP.
                     MOVE GEO-WA2-FN1-COMDIST-NUMBER TO OUT-CD.
                     MOVE GEO-WA2-FN1-POL-PRECINCT   TO OUT-NYPD-PCT.
                     MOVE GEO-WA2-FN1-SCHOOLDIST     TO OUT-SCHLDIST.
                     IF GEO-WA1-OUT-RETURN-CODE = 00
                       WRITE RPT-LINE FROM RPT-DATA-LINE1 AFTER ADVANCING 2 LINES
                     ELSE
                       MOVE SPACES TO OUT-BOR OUT-HN OUT-ST
                       WRITE RPT-LINE FROM RPT-DATA-LINE1 AFTER ADVANCING 1 LINES.

                ************************************************************
                \* THIS PROGRAM ASSUMES THERE EXISTS AT LEAST ONE HIGH AND  *
                \* ONE LOW CROSS STREET.  TO GET THE STREET NAMES OF THE    *
                \* FIRST-LISTED HIGH AND FIRST-LISTED LOW CROSS STREETS     *
                \* FROM THE HIGH AND LOW STREET CODE LISTS CALL FUNCTION D: *
                \*   (1) INITIALIZE WORKAREA 1 TO SPACES                    *
                \*   (2) SET WA1'S FUNCTION CODE FIELD TO D                 *
                \*   (3) SET WA1'S STREET NAME LENGTH FIELD TO DESIRED      *
                \*       VALUE (IN THIS CASE 25 BECAUSE THE REPORT LINE     *
                \*              HAS SPACE FOR ONLY 25 CHARACTERS)           *
                \*   (4) USE THE COMPACT STREET NAMES OPTION TO OBTAIN      *
                \*       STREET NAMES FORMATTED FOR DISPLAY                 *
                \*   (5) MOVE WA2'S LOW PBSC FIELD TO WA1'S INPUT STREET    *
                \*       CODE 1 FIELD                                       *
                \*   (6) MOVE WA2'S HIGH PBSC FIELD TO WA1'S INPUT STREET   *
                \*       CODE 2 FIELD                                       *
                \*   (7) CALL GBI WITH 1 WORKAREA                           *
                \*   (8) CHECK RETURN CODES FOR ERRORS OR WARNINGS          *
                ************************************************************
                     MOVE SPACES TO WORK1.
                     MOVE 'D ' TO GEO-WA1-IN-FUNCTION-CODE.
                     MOVE 'C' TO GEO-WA1-IN-COMPACT-NAME-FLAG.
                     MOVE '25' TO GEO-WA1-IN-SNL.
                     MOVE GEO-WA2-FN1-LOW-PBSC (1) TO GEO-WA1-IN-STREETCODE-1.
                     MOVE GEO-WA2-FN1-HI-PBSC  (1) TO GEO-WA1-IN-STREETCODE-2.
                     CALL 'GBI' USING WORK1.

                     IF GEO-WA1-OUT-RETURN-CODE NOT = 00
                        MOVE 'D' TO ERR-FUNCTION WRN-FUNCTION
                        PERFORM PRINT-ERROR-LINE THRU P-E-EX.

                     IF (GEO-WA1-OUT-RETURN-CODE = 00) OR
                        (GEO-WA1-OUT-RETURN-CODE = 01)
                        PERFORM SUCCESSFUL-FUNCD THRU S-FD-EX.

                 S-F1-EX.
                     EXIT.

                 SUCCESSFUL-FUNCD.

                     MOVE GEO-WA1-OUT-STREET-1 TO OUT-LO-X-STREET
                     MOVE GEO-WA1-OUT-STREET-2 TO OUT-HI-X-STREET
                     WRITE RPT-LINE FROM RPT-DATA-LINE2 AFTER ADVANCING 0 LINES.

                 S-FD-EX.
                     EXIT.


                 PRINT-ERROR-LINE.
                     MOVE GEO-WA1-OUT-RETURN-CODE TO ERR-GRC WRN-GRC.
                     MOVE GEO-WA1-OUT-REASON-CODE TO ERR-REASON WRN-REASON.
                     MOVE GEO-WA1-OUT-ERROR-MESSAGE TO OUT-ERR-MSG.

                     IF GEO-WA1-OUT-RETURN-CODE = 01
                **** INSERT YOUR OWN WARNING ROUTINE HERE  ****
                       WRITE RPT-LINE FROM RPT-WRN-LINE AFTER ADVANCING 2 LINES
                     ELSE
                **** INSERT YOUR OWN WARNING ROUTINE HERE  ****


             WRITE RPT-LINE FROM RPT-ERR-LINE-1 AFTER ADVANCING 2 LINES.

                     WRITE RPT-LINE FROM RPT-ERR-LINE-2 AFTER ADVANCING 1 LINES.

                 P-E-EX.
                     EXIT.
          /*
          //LKED.SYSIN DD *
            INCLUDE INCLIB(GBI)
          //LKED.INCLIB   DD DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR

          //******************************************************************//
          //*                                                                \*//
          //*  AS OF GEOSUPPPORT VERSION 10.0,                               \*//
          //*  THE STEPLIB (OR JOBLIB) OF THE GEOSUPPORT EXECUTION STEP      \*//
          //*  MUST INCLUDE THE FOLLOWING TWO CONCATENATED DATASETS:         \*//
          //*       A030.GEO.SUPPORT.PDSE.LOADLIB                            \*//
          //*       A030.GEO.SUPPORT.LOADLIB                                 \*//
          //*                                                                \*//
          //******************************************************************//
          //GO.STEPLIB DD DSN=A030.GEO.SUPPORT.PDSE.LOADLIB,DISP=SHR
          //           DD DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
          //*
          //******************************************************************//
          //*                                                                \*//
          //*  AS OF GEOSUPPPORT VERSION 10.0,                               \*//
          //*  DD STATEMENTS FOR GEOSUPPORT DATA FILES (E.G. GRID, PAD, ETC) \*//
          //*  ARE NO LONGER NEEDED AND ARE IGNORED.  GEOSUPPORT IS TAILORED \*//
          //*  TO USE STANDARD GEOSUPPORT DATA SET NAMES.                    \*//
          //*  TO USE NON-STANDARD FILES, SEE YOUR SYSTEMS PROGRAMMER.       \*//
          //*                                                                \*//
          //******************************************************************//
          //*
          //GO.SYSUDUMP DD SYSOUT=A,OUTLIM=3000
          //GO.SYSOUT   DD SYSOUT=A
          //GO.RPTFILE  DD SYSOUT=A
          //GO.INFILE  DD *
          1 22           READE ST
          1 500          DUANE ST
          1 82-84        BROADWAY
          4 165-100      BAISLEY BLVD
          4 165-1000     BAISLEY BLVD
          /*
          //

COBOL SAMPLE PROGRAM #1 – Job Stream - COW

      //COBC1SRC JOB   YOUR-JOB-CARD-INFORMATION
      //*
      //********************************************************************
      //***  COBOL SAMPLE BATCH GEOSUPPORT USER APPLICATION PROGRAM #1  ****
      //***                     COW FORMAT                              ****
      //********************************************************************
      //STEP1 EXEC   IGYWCLG,PARM.COBOL=(NOWORD,OPTIMIZE)
      //COBOL.SYSLIB DD DSN=A030.GEO.COPYLIB2,DISP=SHR
      //             DD DSN=A030.GEO.COPYLIB,DISP=SHR
      //COBOL.SYSIN  DD *
            *****************************************************************
            \* THIS PROGRAM MAKES FUNCTION 1 AND D CALLS TO GEOSUPPORT USING *
            \* BORO, HOUSE NUMBER & STREET NAME SUPPLIED BY AN INSTREAM FILE.*
            \* FUNCTION 1 RETURNS GEOGRAPHIC INFORMATION FOR AN ADDRESS.     *
            \* FUNCTION D TRANSLATES AN INPUT STREET CODE TO A STREET NAME.  *
            \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
            \*       NOTE: IF THE CROSS STREET NAMES FLAG WERE USED IN THE   *
            \*             ORIGINAL CALL TO FUNCTION 1, ALL THE CROSS STREET *
            \*             NAMES WOULD HAVE BEEN RETURNED BY FUNCTION 1.     *
            *****************************************************************
            *
             IDENTIFICATION DIVISION.
               PROGRAM-ID. COBS1JOB.

            ****************************************

             ENVIRONMENT DIVISION.
               INPUT-OUTPUT SECTION.

       FILE-CONTROL.
                 SELECT IN-FILE ASSIGN TO INFILE.
                 SELECT RPT-FILE ASSIGN TO RPTFILE.

            ****************************************

             DATA DIVISION.
               FILE SECTION.

            **** REPLACE CODE BELOW WITH YOUR OWN INPUT FILE DEFINTION *****
               FD  IN-FILE
                   RECORDING MODE IS F
                   RECORD CONTAINS 80 CHARACTERS
                   LABEL RECORDS ARE OMITTED.

             01  INPUT-TO-GEOSUPPORT.
                 05  IN-BORO-CODE        PIC X.
                 05  FILLER              PIC X.
                 05  IN-HOUSE-NUMBER     PIC X(12).
                 05  FILLER              PIC X.
                 05  IN-STREET           PIC X(32).
                 05  FILLER              PIC X(33).

               FD  RPT-FILE
                   RECORDING MODE IS F
                   RECORD CONTAINS 132 CHARACTERS
                   LABEL RECORDS ARE OMITTED.

             01  RPT-LINE                PIC X(132).

             WORKING-STORAGE SECTION.

      *****************************************************************
            *** USE OF GEOSUPPORT COPY LIBRARIES (REFERENCED BELOW BY THE ***
            *** COPY STATEMENTS) IS STRONGLY ENCOURAGED.                  ***
            *****************************************************************
             01  WORK1.    COPY  P1COB.
             01  WORK2.    COPY  P2COB.

            **** REPLACE CODE BELOW WITH YOUR OWN REPORT LAYOUT    *********

             01  RPT-DATA-LINE1.
                 05  OUT-BOR             PIC X.
                 05  FILLER              PIC X         VALUE ' '.
                 05  OUT-HN              PIC X(12).
                 05  FILLER              PIC X         VALUE ' '.
                 05  OUT-ST              PIC X(32).
                 05  FILLER              PIC X         VALUE ' '.
                 05  OUT-ZIP             PIC X(5).
                 05  FILLER              PIC X         VALUE ' '.
                 05  OUT-CD              PIC X(2).
                 05  FILLER              PIC X         VALUE ' '.
                 05  OUT-NYPD-PCT        PIC X(3).
                 05  FILLER              PIC X(6)      VALUE ' '.
                 05  OUT-SCHLDIST        PIC X(2).
                 05  FILLER              PIC X(58)     VALUE ' '.

             01  RPT-DATA-LINE2.
                 05  FILLER              PIC X(74)     VALUE ' '.
                 05  OUT-LO-X-STREET     PIC X(25).
                 05  FILLER              PIC X VALUE ' '.
                 05  OUT-HI-X-STREET     PIC X(25).

                 01  RPT-ERR-LINE-1.
                 05  ERR-BOR             PIC X.
                 05  FILLER              PIC X         VALUE ' '.
                 05  ERR-HN              PIC X(12).
                 05  FILLER              PIC X         VALUE ' '.
                 05  ERR-ST              PIC X(32).
                 05  FILLER              PIC X(14)
                     VALUE ' *** FUNCTION '.
                 05  ERR-FUNCTION        PIC X.
                 05  FILLER              PIC X(7)
                     VALUE ' GRC = '.
                 05  ERR-GRC             PIC X(2).
                 05  FILLER              PIC X(15) VALUE ' REASON CODE = '.
                 05  ERR-REASON          PIC X.
                 05  FILLER              PIC X(45) VALUE ' '.

             01  RPT-ERR-LINE-2.
                 05  FILLER              PIC X(48) VALUE ' '.
                 05  FILLER              PIC X(4) VALUE '*** '.
                 05  OUT-ERR-MSG         PIC X(80).

             01  RPT-WRN-LINE.
                 05  WRN-BOR             PIC X.
                 05  FILLER              PIC X         VALUE ' '.
                 05  WRN-HN              PIC X(12).

          05  FILLER              PIC X         VALUE ' '.
                 05  WRN-ST              PIC X(32).
                 05  FILLER              PIC X(14)

        VALUE ' *** FUNCTION '.
                 05  WRN-FUNCTION        PIC X.
                 05  FILLER              PIC X(16)
                     VALUE ' WARNING, GRC = '.
                 05  WRN-GRC             PIC X(2).
                 05  FILLER              PIC X(15) VALUE ' REASON CODE = '.
                 05  WRN-REASON          PIC X(1).
                 05  FILLER              PIC X(36) VALUE ' '.

             01  RPT-HEADER-1.
                 05  FILLER              PIC X(40)  VALUE
                 'SAMPLE COBOL PROGRAM \#1 EXECUTION OUTPUT'.
                 05  FILLER              PIC X(72) VALUE ' '.

             01  RPT-HEADER-2.
                 05  FILLER              PIC X(58)  VALUE
                 '*****---------- INPUT ADDRESS ------------***** *****-----'.
                 05  FILLER              PIC X(58)  VALUE
                 '---------------- SELECTED OUTPUT ITEMS -------------------'.
                 05  FILLER              PIC X(16)  VALUE
                 '----*****       '.

             01  RPT-HEADER-3.
                 05  FILLER              PIC X(58)  VALUE
                 'B HOUSE NUMBER IN-STREET-NAME                     ZIP CD N'.
                 05  FILLER              PIC X(58)  VALUE
                 'YPD-PCT SCHLDST LOW CROSS STREET          HIGH CROSS STREE'.
                 05  FILLER              PIC X(16)  VALUE
                 'T               '.

             01  RPT-HEADER-4.
                 05  FILLER              PIC X(58)  VALUE
                 '_ ____________ ________________________________ _____ __ \_'.

                 05  FILLER              PIC X(58)  VALUE
                 '_______ _______ _________________________ ________________'.
                 05  FILLER              PIC X(16)  VALUE
                 '_________       '.

             01  FLAGS.
                 05 DATA-FLAG    PIC XXX   VALUE 'YES'.
                   88 MORE-DATA            VALUE 'YES'.
                   88 NO-DATA              VALUE 'NO '.

            ****************************************

             PROCEDURE DIVISION.

                 OPEN INPUT IN-FILE, OUTPUT RPT-FILE.
                 WRITE RPT-LINE FROM RPT-HEADER-1 AFTER ADVANCING 1 LINES.
                 WRITE RPT-LINE FROM RPT-HEADER-2 AFTER ADVANCING 2 LINES.
                 WRITE RPT-LINE FROM RPT-HEADER-3 AFTER ADVANCING 2 LINES.
                 WRITE RPT-LINE FROM RPT-HEADER-4 AFTER ADVANCING 0 LINES.
                 READ IN-FILE AT END MOVE 'NO ' TO DATA-FLAG.


                 PERFORM PROCESS THRU PROCESS-EX
                 UNTIL NO-DATA.
                 CLOSE IN-FILE, RPT-FILE.
                 MOVE 0 TO RETURN-CODE
                 STOP RUN.

             PROCESS.

            *****************************************************************
            \* TO MAKE A FUNCTION 1 CALL:                                    *
            \*   (1) INITIALIZE WORKAREA 1 TO SPACES                         *
            \*   (2) SET WA1'S FUNCTION CODE FIELD TO 1                      *
            \*   (3) SET THE PLATFORM INDICATOR SWITCH (NON-IBM-MAINFRAME)   *
            \*       TO USE CHARACTER-ONLY WORK AREAS (COWS)                 *
            \*   (4) MOVE THE INPUT BORO TO WA1'S INPUT BORO CODE FIELD      *
            \*   (5) MOVE THE INPUT HOUSE NUMBER TO WA1'S INPUT HOUSE NUMBER *
            \*       FIELD                                                   *
            \*   (6) MOVE THE INPUT STREET TO WA1'S INPUT STREET NAME FIELD  *
            \*   (7) CALL GBI WITH 2 WORKAREAS                               *
            \*   (8) CHECK RETURN CODES FOR ERRORS OR WARNINGS               *
            *****************************************************************
            *****************************************************************
            \* AS OF GEOSUPPORT 10.1,                                        *
            \* TO RECEIVE ROADBED-SPECIFIC INFORMATION,                      *
            \* SET THE ROADBED REQUEST SWITCH TO 'R', AS FOLLOWS:            *
            \* MOVE 'R' TO PIWA1-IN-ROADBED-REQ-SWITCH.                      *
            *****************************************************************
                 MOVE SPACES TO WORK1.
                 MOVE '1 ' TO PIWA1-IN-FUNC-CODE.
                 MOVE 'C' TO GEO-WA1-IN-NON-IBM-MAIN-FRAME.
                 MOVE IN-BORO-CODE TO GEO-WA1-IN-BORO OUT-BOR ERR-BOR WRN-BOR.
                 MOVE IN-HOUSE-NUMBER TO PIWA1-IN-HOUSENUM-DISPLAY OUT-HN
                                                     ERR-HN WRN-HN.
                 MOVE IN-STREET TO GEO-WA1-IN-STREET-1 OUT-ST ERR-ST WRN-ST.
                 CALL 'GBI' USING WORK1 WORK2.

                 IF GEO-WA1-OUT-RETURN-CODE NOT = 00
                    MOVE '1' TO ERR-FUNCTION WRN-FUNCTION
                    PERFORM PRINT-ERROR-LINE THRU P-E-EX.

                 IF (GEO-WA1-OUT-RETURN-CODE = 00) OR
                   (GEO-WA1-OUT-RETURN-CODE = 01)
                    PERFORM SUCCESSFUL-FUNC1 THRU S-F1-EX.

             READ IN-FILE AT END MOVE 'NO ' TO DATA-FLAG.

             PROCESS-EX.
                 EXIT.

             SUCCESSFUL-FUNC1.

            ***********************************************************
            ***** REPLACE CODE BELOW WITH YOUR OWN CODE FOR ***********
            ***** PROCESSING SUCCESSFUL GEOSUPPORT CALLS          *****
            ***********************************************************
                 MOVE GEO-WA2-FN1-ZIP            TO OUT-ZIP.
                 MOVE GEO-WA2-FN1-COMDIST-NUMBER TO OUT-CD.


          MOVE GEO-WA2-FN1-POL-PRECINCT   TO OUT-NYPD-PCT.
                 MOVE GEO-WA2-FN1-SCHOOLDIST     TO OUT-SCHLDIST.
                 IF GEO-WA1-OUT-RETURN-CODE = 00
                   WRITE RPT-LINE FROM RPT-DATA-LINE1 AFTER ADVANCING 2 LINES
                 ELSE
                   MOVE SPACES TO OUT-BOR OUT-HN OUT-ST
                   WRITE RPT-LINE FROM RPT-DATA-LINE1 AFTER ADVANCING 1 LINES.


            ****************************************************************
            \* THIS PROGRAM ASSUMES THERE EXISTS AT LEAST ONE HIGH AND      *
            \* ONE LOW CROSS STREET.  TO GET THE STREET NAMES OF THE        *
            \* FIRST-LISTED HIGH AND FIRST-LISTED LOW CROSS STREETS         *
            \* FROM THE HIGH AND LOW STREET CODE LISTS CALL FUNCTION D:     *
            \*   (1) INITIALIZE WORKAREA 1 TO SPACES                        *
            \*   (2) SET WA1'S FUNCTION CODE FIELD TO D                     *
            \*   (3) SET THE PLATFORM INDICATOR SWITCH (NON-IBM-MAINFRAME)  *
            \*       TO USE CHARACTER-ONLY WORK AREAS (COWS)                *
            \*   (4) SET WA1'S STREET NAME LENGTH FIELD TO DESIRED          *
            \*       VALUE (IN THIS CASE 25 BECAUSE THE REPORT LINE         *
            \*              HAS SPACE FOR ONLY 25 CHARACTERS)               *
            \*   (5) USE THE COMPACT STREET NAMES OPTION TO OBTAIN          *
            \*       STREET NAMES FORMATTED FOR DISPLAY                     *
            \*   (6) MOVE WA2'S LOW BSC FIELD TO WA1'S INPUT STREET         *
            \*       CODE 1 FIELD                                           *
            \*   (7) MOVE WA2'S HIGH BSC FIELD TO WA1'S INPUT STREET        *
            \*       CODE 2 FIELD                                           *
            \*   (8) CALL GBI WITH 1 WORKAREA                               *
            \*   (9) CHECK RETURN CODES FOR ERRORS OR WARNINGS              *
            ****************************************************************
                 MOVE SPACES TO WORK1.
                 MOVE 'D ' TO PIWA1-IN-FUNC-CODE.
                 MOVE 'C' TO GEO-WA1-IN-NON-IBM-MAIN-FRAME.
                 MOVE 'C' TO GEO-WA1-IN-COMPACT-NAME-FLAG.
                 MOVE '25' TO GEO-WA1-IN-SNL.
                 MOVE PIWA2-FN1-LOW-B5SC (1) TO GEO-WA1-IN-10SC-1.
                 MOVE PIWA2-FN1-HI-B5SC  (1) TO GEO-WA1-IN-10SC-2.
                 CALL 'GBI' USING WORK1.

                 IF GEO-WA1-OUT-RETURN-CODE NOT = 00
                    MOVE 'D' TO ERR-FUNCTION WRN-FUNCTION
                    PERFORM PRINT-ERROR-LINE THRU P-E-EX.

                 IF (GEO-WA1-OUT-RETURN-CODE = 00) OR
                    (GEO-WA1-OUT-RETURN-CODE = 01)
                    PERFORM SUCCESSFUL-FUNCD THRU S-FD-EX.

             S-F1-EX.
             EXIT.

             SUCCESSFUL-FUNCD.

                 MOVE GEO-WA1-OUT-STREET-1 TO OUT-LO-X-STREET
                 MOVE GEO-WA1-OUT-STREET-2 TO OUT-HI-X-STREET
                 WRITE RPT-LINE FROM RPT-DATA-LINE2 AFTER ADVANCING 0 LINES.

             S-FD-EX.

                 EXIT.


             PRINT-ERROR-LINE.
                 MOVE GEO-WA1-OUT-RETURN-CODE TO ERR-GRC WRN-GRC.
                 MOVE GEO-WA1-OUT-REASON-CODE TO ERR-REASON WRN-REASON.
                 MOVE GEO-WA1-OUT-ERROR-MESSAGE TO OUT-ERR-MSG.

                 IF GEO-WA1-OUT-RETURN-CODE = 01
            **** INSERT YOUR OWN WARNING ROUTINE HERE  ****
                   WRITE RPT-LINE FROM RPT-WRN-LINE AFTER ADVANCING 2 LINES
                 ELSE
            **** INSERT YOUR OWN ERROR ROUTINE HERE  ****
                   WRITE RPT-LINE FROM RPT-ERR-LINE-1 AFTER ADVANCING 2 LINES.

        WRITE RPT-LINE FROM RPT-ERR-LINE-2 AFTER ADVANCING 1 LINES.

             P-E-EX.
                 EXIT.
      /*
      //LKED.SYSIN DD *
        INCLUDE INCLIB(GBI)
      //LKED.INCLIB   DD DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
      //******************************************************************//
      //*                                                                \*//
      //*  AS OF GEOSUPPPORT VERSION 10.0,                               \*//
      //*  THE STEPLIB (OR JOBLIB) OF THE GEOSUPPORT EXECUTION STEP      \*//
      //*  MUST INCLUDE THE FOLLOWING TWO CONCATENATED DATASETS:         \*//
      //*       A030.GEO.SUPPORT.PDSE.LOADLIB                            \*//
      //*       A030.GEO.SUPPORT.LOADLIB                                 \*//
      //*                                                                \*//
      //******************************************************************//
      //GO.STEPLIB DD DSN=A030.GEO.SUPPORT.PDSE.LOADLIB,DISP=SHR
      //           DD DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
      //*
      //******************************************************************//
      //*                                                                \*//
      //*  AS OF GEOSUPPPORT VERSION 10.0,                               \*//
      //*  DD STATEMENTS FOR GEOSUPPORT DATA FILES (E.G. GRID, PAD, ETC) \*//
      //*  ARE NO LONGER NEEDED AND ARE IGNORED.  GEOSUPPORT IS TAILORED \*//
      //*  TO USE STANDARD GEOSUPPORT DATA SET NAMES.                    \*//
      //*  TO USE NON-STANDARD FILES, SEE YOUR SYSTEMS PROGRAMMER.       \*//
      //*                                                                \*//
      //******************************************************************//
      //*
      //GO.SYSUDUMP DD SYSOUT=A,OUTLIM=3000
      //GO.SYSOUT   DD SYSOUT=A
      //GO.RPTFILE  DD SYSOUT=A
      //GO.INFILE  DD *
      1 22           READE ST
      1 500          DUANE ST
      1 82-84        BROADWAY
      4 165-100      BAISLEY BLVD
      4 165-1000     BAISLEY BLVD
      /*
      //

COBOL SAMPLE PROGRAM #1 – Output Report

          SAMPLE COBOL PROGRAM \#1 EXECUTION OUTPUT

           *****---------- INPUT ADDRESS ------------***** *****--------------------- SELECTED OUTPUT ITEMS -----------------------*****

           B HOUSE NUMBER IN-STREET-NAME                     ZIP CD NYPD-PCT SCHLDST LOW CROSS STREET          HIGH CROSS STREET
           - ------------ -------------------------------- ----- -- -------- ------- ------------------------- -------------------------

           1 22           READE ST                         10007 01 005      02      ELK STREET                BROADWAY

           1 500          DUANE ST                         *** FUNCTION 1 GRC = 42 REASON CODE =
                                                           *** ADDRESS NUMBER OUT OF RANGE

           1 82-84        BROADWAY                         *** FUNCTION 1 WARNING, GRC = 01 REASON CODE = 1
                                                           *** ADDR NUMBER ALTERED: RANGE ASSUMED. USING DIGITS BEFORE DASH ONLY
                                                           10005 01 001      02      RECTOR STREET             WALL GREEN

           4 165-100      BAISLEY BLVD                     11434 12 113      28      SMITH STREET              166 STREET

           4 165-1000     BAISLEY BLVD                     *** FUNCTION 1 GRC = 13 REASON CODE = 2
                                                           *** ADDRESS NBR 165-1000  HAS MORE THAN 3 DIGITS AFTER THE DASH.

COBOL SAMPLE PROGRAM #2

- Input Job Stream - MSW
- Input Job Stream - COW
- Output Report - COW

COBOL SAMPLE PROGRAM #2- Job Stream - MSW

      //COBF2SRC JOB   YOUR-JOB-CARD-INFORMATION
      //*
      //********************************************************************
      //***  COBOL SAMPLE BATCH GEOSUPPORT USER APPLICATION PROGRAM \#2  ****
      //***                     MSW FORMAT                              ****
      //********************************************************************
      //STEP1 EXEC   IGYWCLG,PARM.COBOL=(NOWORD,OPTIMIZE)
      //COBOL.SYSLIB DD DSN=A030.GEO.COPYLIB2,DISP=SHR
      //             DD DSN=A030.GEO.COPYLIB,DISP=SHR
      //COBOL.SYSIN  DD *
            *****************************************************************
            \* THIS PROGRAM MAKES FUNCTION 2 AND D CALLS TO GEOSUPPORT USING *
            \* TWO BOROS AND TWO STREET NAMES SUPPLIED BY AN INSTREAM FILE.  *
            \* FUNCTION 2 RETURNS GEOGRAPHIC INFORMATION FOR AN INTERSECTION.*
            \* FUNCTION D TRANSLATES AN INPUT STREET CODE TO A STREET NAME.  *
            \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
            \*       NOTE: IF THE CROSS STREET NAMES FLAG WERE USED IN THE   *
            \*             ORIGINAL CALL TO FUNCTION 2, ALL THE CROSS STREET *
            \*             NAMES WOULD HAVE BEEN RETURNED BY FUNCTION 2.     *
            *****************************************************************
            *
             IDENTIFICATION DIVISION.
               PROGRAM-ID. COBS1JOB.

            ****************************************

             ENVIRONMENT DIVISION.
               INPUT-OUTPUT SECTION.
               FILE-CONTROL.
                 SELECT IN-FILE ASSIGN TO INFILE.
                 SELECT RPT-FILE ASSIGN TO RPTFILE.

            ****************************************

             DATA DIVISION.
               FILE SECTION.

            **** REPLACE CODE BELOW WITH YOUR OWN INPUT FILE DEFINTION *****
               FD  IN-FILE
                   RECORDING MODE IS F
                   RECORD CONTAINS 80 CHARACTERS
                   LABEL RECORDS ARE OMITTED.

             01  INPUT-TO-GEOSUPPORT.
                 05  IN-BOR1             PIC X.
                 05  FILLER              PIC X.
                 05  IN-STREET1          PIC X(32).
                 05  FILLER              PIC X.
                 05  IN-BOR2             PIC X.
                 05  FILLER              PIC X.
                 05  IN-STREET2          PIC X(32).
                 05  FILLER              PIC X(11).

               FD  RPT-FILE
                   RECORDING MODE IS F
                   RECORD CONTAINS 132 CHARACTERS
                   LABEL RECORDS ARE OMITTED.

             01  RPT-LINE                PIC X(132).

             WORKING-STORAGE SECTION.

      77  I                       PIC 9 VALUE 0.

            *****************************************************************
            *** USE OF GEOSUPPORT COPY LIBRARIES (REFERENCED BELOW BY THE ***
            *** COPY STATEMENTS) IS STRONGLY ENCOURAGED.                  ***
            *****************************************************************
             01  WORK1.    COPY  W1COB.
             01  WORK2.    COPY  W2COB.

            **** REPLACE CODE BELOW WITH YOUR OWN REPORT LAYOUT    *********

             01  RPT-DATA-LINE1.
                 05  OUT-BOR1            PIC X.
                 05  FILLER              PIC X         VALUE ' '.
                 05  OUT-ST1             PIC X(32).
                 05  FILLER              PIC X         VALUE ' '.
                 05  OUT-BOR2            PIC X.
                 05  FILLER              PIC X         VALUE ' '.
                 05  OUT-ST2             PIC X(32).
                 05  OUT-DETAIL.
                   10  FILLER            PIC X         VALUE ' '.
                   10  OUT-ZIP           PIC X(5).
                   10  FILLER            PIC X         VALUE ' '.
                   10  OUT-CD            PIC X(2).
                   10  FILLER            PIC X         VALUE ' '.
                   10  OUT-NYPD-PCT      PIC X(3).
                   10  FILLER            PIC X(6)      VALUE ' '.
                   10  OUT-SCHLDIST      PIC X(2).
                   10  FILLER            PIC X(42)     VALUE ' '.

             01  RPT-DATA-LINE2.
                 05  FILLER              PIC X(96)     VALUE ' '.
                 05  OUT-ST              PIC X(32).
                 05  FILLER              PIC X(4) VALUE ' '.

             01  RPT-ERR-LINE.
                 05  FILLER              PIC X(15) VALUE '***** FUNCTION '.
                 05  ERR-FUNCTION        PIC X.
                 05  FILLER              PIC X(7)  VALUE ' GRC = '.
                 05  ERR-GRC             PIC X(2).
                 05  FILLER              PIC X(15) VALUE ' REASON CODE = '.
                 05  ERR-REASON          PIC X.
                 05  FILLER              PIC X(2)  VALUE '. '.
                 05  OUT-ERR-MSG         PIC X(80).
                 05  FILLER              PIC X(9) VALUE ' '.

             01  RPT-WRN-LINE.
                 05  FILLER              PIC X(15) VALUE '***** FUNCTION '.
                 05  WRN-FUNCTION        PIC X.
                 05  FILLER              PIC X(15) VALUE ' WARNING GRC = '.
                 05  WRN-GRC             PIC X(2).
                 05  FILLER              PIC X(15) VALUE ' REASON CODE = '.
                 05  WRN-REASON          PIC X.
                 05  FILLER              PIC X(2)  VALUE '. '.
                 05  OUT-WRN-MSG         PIC X(80).
                 05  FILLER              PIC X    VALUE ' '.

             01  RPT-HEADER-1.
                 05  FILLER              PIC X(40)  VALUE
                 'SAMPLE COBOL PROGRAM \#2 EXECUTION OUTPUT'.
                 05  FILLER              PIC X(72) VALUE ' '.

           01  RPT-HEADER-2.
                 05  FILLER              PIC X(58)  VALUE
                 '*****----------------- INPUT INTERSECTION ----------------'.
                 05  FILLER              PIC X(58)  VALUE
                 '------***** *****------------ SELECTED OUTPUT ITEMS ------'.
                 05  FILLER              PIC X(16)  VALUE
                 '-------*****'.

             01  RPT-HEADER-3.
                 05  FILLER              PIC X(58)  VALUE
                 'B IN-STREET-NAME-1                 B IN-STREET-NAME-2     '.
                 05  FILLER              PIC X(58)  VALUE
                 '              ZIP CD NYPD-PCT SCHLDST INTERSECTING STREET '.
                 05  FILLER              PIC X(16)  VALUE
                 'NAMES           '.

             01  RPT-HEADER-4.
                 05  FILLER              PIC X(58)  VALUE
                 '_ ________________________________ _ _____________________'.
                 05  FILLER              PIC X(58)  VALUE
                 '___________ _____ __ ________ _______ ____________________'.
                 05  FILLER              PIC X(16)  VALUE
                 '____________    '.

             01  FLAGS.
                 05 DATA-FLAG    PIC XXX   VALUE 'YES'.
                   88 MORE-DATA            VALUE 'YES'.
                   88 NO-DATA              VALUE 'NO '.

            ****************************************

             PROCEDURE DIVISION.

                 OPEN INPUT IN-FILE, OUTPUT RPT-FILE.
                 WRITE RPT-LINE FROM RPT-HEADER-1 AFTER ADVANCING 1 LINES.
                 WRITE RPT-LINE FROM RPT-HEADER-2 AFTER ADVANCING 2 LINES.
                 WRITE RPT-LINE FROM RPT-HEADER-3 AFTER ADVANCING 2 LINES.
                 WRITE RPT-LINE FROM RPT-HEADER-4 AFTER ADVANCING 0 LINES.
                 READ IN-FILE AT END MOVE 'NO ' TO DATA-FLAG.
                 PERFORM PROCESS THRU PROCESS-EX
                     UNTIL NO-DATA.
                 CLOSE IN-FILE, RPT-FILE.
                 MOVE 0 TO RETURN-CODE
                 STOP RUN.

             PROCESS.




            ******************************************************************
            \* TO MAKE A FUNCTION 2 CALL:                                     *
            \*   (1) INITIALIZE WORKAREA 1 TO SPACES                          *
            \*   (2) SET WA1'S FUNCTION-CODE TO 2                             *
            \*   (3) MOVE THE 1ST INPUT BORO TO WA1'S INPUT BORO CODE FIELD   *
            \*   (4) MOVE THE 1ST INPUT STREET TO WA1'S INPUT STREET NAME     *
            \*       FIELD                                                    *
            \*   (5) MOVE THE 2ND INPUT BORO TO WA1'S INPUT BORO CODE 2 FIELD *
            \*   (6) MOVE THE 2ND INPUT STREET TO WA1'S INPUT STREET NAME 2   *
            \*       FIELD                                                    *
            \*   (7) CALL GBI WITH 2 WORKAREAS                                *
            \*   (8) CHECK RETURN CODES FOR ERRORS OR WARNINGS                *
            ******************************************************************
                 MOVE SPACES TO WORK1.
                 MOVE '2 ' TO GEO-WA1-IN-FUNCTION-CODE.
               MOVE IN-BOR1 TO GEO-WA1-IN-BORO   OUT-BOR1.
                 MOVE IN-BOR2 TO GEO-WA1-IN-BORO-2 OUT-BOR2.
                 MOVE IN-STREET1 TO GEO-WA1-IN-STREET-1 OUT-ST1.
              MOVE IN-STREET2 TO GEO-WA1-IN-STREET-2 OUT-ST2.
                 CALL 'GBI' USING WORK1 WORK2.

                 IF GEO-WA1-OUT-RETURN-CODE NOT = 00
                    MOVE '2' TO ERR-FUNCTION WRN-FUNCTION
                    PERFORM PRINT-ERROR-LINE THRU P-E-EX.

                 IF (GEO-WA1-OUT-RETURN-CODE = 00) OR
                   (GEO-WA1-OUT-RETURN-CODE = 01)
                    PERFORM SUCCESSFUL-FUNC2 THRU S-F2-EX
                 ELSE
                   MOVE SPACES TO OUT-DETAIL
                   WRITE RPT-LINE FROM RPT-DATA-LINE1 AFTER ADVANCING 1 LINES.

                 READ IN-FILE AT END MOVE 'NO ' TO DATA-FLAG.

             PROCESS-EX.
                 EXIT.

             SUCCESSFUL-FUNC2.

            ***********************************************************
            ***** REPLACE CODE BELOW WITH YOUR OWN CODE FOR ***********
            ***** PROCESSING SUCCESSFUL GEOSUPPORT CALLS          *****
            ***********************************************************
                 MOVE GEO-WA2-FN2-ZIP            TO OUT-ZIP.
                 MOVE GEO-WA2-FN2-COMDIST-NUMBER TO OUT-CD.
                 MOVE GEO-WA2-FN2-POL-PRECINCT   TO OUT-NYPD-PCT.
                 MOVE GEO-WA2-FN2-SCHOOLDIST     TO OUT-SCHLDIST.
            \* PROCESS CROSS STREET** CHECK FOR AT LEAST 1.
                 WRITE RPT-LINE FROM RPT-DATA-LINE1 AFTER ADVANCING 2 LINES.

                 PERFORM CALL-D THRU CALL-D-EX
                    VARYING I FROM 1 BY 1 UNTIL
                        (I > GEO-WA2-FN2-NUM-OF-INTERSECTS).

             S-F2-EX.
                 EXIT.

             CALL-D.

            *******************************************************
            \* TO GET STREET NAMES FOR INTERSECTING STREET CODES   *
            \* MAKE A FUNCTION D CALL:                             *
            \*   (1) INITIALIZE WORKAREA 1 TO SPACES               *
            \*   (2) SET THE WA1'S FUNCTION CODE FIELD TO D        *
            \*   (3) USE THE COMPACT STREET NAMES OPTION TO OBTAIN *
            \*       STREET NAMES FORMATTED FOR DISPLAY            *
            \*   (4) MOVE THE PACKED BORO AND STREET CODE TO       *
            \*       WA1'S INPUT STREET CODE 1 FIELD               *
            \*   (5) CALL GBI WITH 1 WORKAREA                      *
            \*   (6) CHECK RETURN CODES FOR ERRORS OR WARNINGS     *
            *******************************************************
                 MOVE SPACES TO WORK1.
                 MOVE 'D ' TO GEO-WA1-IN-FUNCTION-CODE.
                 MOVE 'C' TO GEO-WA1-IN-COMPACT-NAME-FLAG.
                 MOVE '25' TO GEO-WA1-IN-SNL.
                 MOVE GEO-WA2-FN2-INTERSECT-PBSC (I)
                     TO GEO-WA1-IN-STREETCODE-1

           CALL 'GBI' USING WORK1.

                 IF GEO-WA1-OUT-RETURN-CODE NOT = 00
                    MOVE 'D' TO ERR-FUNCTION WRN-FUNCTION
                    PERFORM PRINT-ERROR-LINE THRU P-E-EX.

          IF (GEO-WA1-OUT-RETURN-CODE = 00) OR
                    (GEO-WA1-OUT-RETURN-CODE = 01)
                    PERFORM SUCCESSFUL-FUNCD THRU S-FD-EX.

             CALL-D-EX.
                 EXIT.

             SUCCESSFUL-FUNCD.

                   MOVE GEO-WA1-OUT-STREET-1 TO OUT-ST
                   IF I = 1
                   WRITE RPT-LINE FROM RPT-DATA-LINE2 AFTER ADVANCING 0 LINES
                   ELSE
                   WRITE RPT-LINE FROM RPT-DATA-LINE2 AFTER ADVANCING 1 LINES.

             S-FD-EX.
                 EXIT.


             PRINT-ERROR-LINE.
                 MOVE GEO-WA1-OUT-RETURN-CODE TO ERR-GRC WRN-GRC.
                 MOVE GEO-WA1-OUT-REASON-CODE TO ERR-REASON WRN-REASON.
                 MOVE GEO-WA1-OUT-ERROR-MESSAGE TO OUT-ERR-MSG OUT-WRN-MSG.

                 IF GEO-WA1-OUT-RETURN-CODE = 01
            **** INSERT YOUR OWN WARNING ROUTINE HERE  ****
                   WRITE RPT-LINE FROM RPT-WRN-LINE AFTER ADVANCING 2 LINES
                 ELSE
            **** INSERT YOUR OWN WARNING ROUTINE HERE  ****
                   WRITE RPT-LINE FROM RPT-ERR-LINE AFTER ADVANCING 2 LINES.

             P-E-EX.
                 EXIT.
      /*
      //LKED.SYSIN DD *
        INCLUDE INCLIB(GBI)
      //LKED.INCLIB   DD DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
      //******************************************************************//
      //*                                                                \*//
      //*  AS OF GEOSUPPPORT VERSION 10.0,                               \*//
      //*  THE STEPLIB (OR JOBLIB) OF THE GEOSUPPORT EXECUTION STEP      \*//
      //*  MUST INCLUDE THE FOLLOWING TWO CONCATENATED DATASETS:         \*//
      //*       A030.GEO.SUPPORT.PDSE.LOADLIB                            \*//
      //*       A030.GEO.SUPPORT.LOADLIB                                 \*//
      //*                                                                \*//
      //******************************************************************//
      //GO.STEPLIB DD DSN=A030.GEO.SUPPORT.PDSE.LOADLIB,DISP=SHR
      //           DD DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
      //*
      //******************************************************************//
      //*                                                                \*//
      //*  AS OF GEOSUPPPORT VERSION 10.0,                               \*//
      //*  DD STATEMENTS FOR GEOSUPPORT DATA FILES (E.G. GRID, PAD, ETC) \*//
      //*  ARE NO LONGER NEEDED AND ARE IGNORED.  GEOSUPPORT IS TAILORED \*//
      //*  TO USE STANDARD GEOSUPPORT DATA SET NAMES.                    \*//
      //*  TO USE NON-STANDARD FILES, SEE YOUR SYSTEMS PROGRAMMER.       \*//
      /*                                                                \*//
      //******************************************************************//
      //*
      //GO.SYSUDUMP DD SYSOUT=A,OUTLIM=3000
      //GO.SYSOUT   DD SYSOUT=A
      //GO.RPTFILE  DD SYSOUT=A
      //GO.INFILE  DD *
      1 CHAMBERS ST                      1 HUDSON ST
      1 SIXTH AVE                        1 W. 8 ST
      1 DUANE ST                         1 READE ST
      /*
      //

COBOL SAMPLE PROGRAM #2- Job Stream- COW

  //COBC2SRC JOB   YOUR-JOB-CARD-INFORMATION
  //*
  //********************************************************************
  //***  COBOL SAMPLE BATCH GEOSUPPORT USER APPLICATION PROGRAM #2  ****
  //***                     COW FORMAT                              ****
  //********************************************************************
  //STEP1 EXEC   IGYWCLG,PARM.COBOL=(NOWORD,OPTIMIZE)
  //COBOL.SYSLIB DD DSN=A030.GEO.COPYLIB2,DISP=SHR
  //             DD DSN=A030.GEO.COPYLIB,DISP=SHR
  //COBOL.SYSIN  DD *
        *****************************************************************
        * THIS PROGRAM MAKES FUNCTION 2 AND D CALLS TO GEOSUPPORT USING *
        * TWO BOROS AND TWO STREET NAMES SUPPLIED BY AN INSTREAM FILE.  *
        * FUNCTION 2 RETURNS GEOGRAPHIC INFORMATION FOR AN INTERSECTION.*
        * FUNCTION D TRANSLATES AN INPUT STREET CODE TO A STREET NAME.  *
        * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
        *       NOTE: IF THE CROSS STREET NAMES FLAG WERE USED IN THE   *
        *             ORIGINAL CALL TO FUNCTION 2, ALL THE CROSS STREET *
        *             NAMES WOULD HAVE BEEN RETURNED BY FUNCTION 2.     *
        *****************************************************************
        *
         IDENTIFICATION DIVISION.
           PROGRAM-ID. COBS1JOB.

        ****************************************

         ENVIRONMENT DIVISION.
           INPUT-OUTPUT SECTION.
           FILE-CONTROL.
             SELECT IN-FILE ASSIGN TO INFILE.
             SELECT RPT-FILE ASSIGN TO RPTFILE.

        ****************************************

         DATA DIVISION.
           FILE SECTION.

        **** REPLACE CODE BELOW WITH YOUR OWN INPUT FILE DEFINTION *****
           FD  IN-FILE
               RECORDING MODE IS F
               RECORD CONTAINS 80 CHARACTERS
               LABEL RECORDS ARE OMITTED.

         01  INPUT-TO-GEOSUPPORT.
             05  IN-BOR1             PIC X.
             05  FILLER              PIC X.
             05  IN-STREET1          PIC X(32).
             05  FILLER              PIC X.
             05  IN-BOR2             PIC X.
             05  FILLER              PIC X.
             05  IN-STREET2          PIC X(32).
             05  FILLER              PIC X(11).

           FD  RPT-FILE
               RECORDING MODE IS F
               RECORD CONTAINS 132 CHARACTERS
               LABEL RECORDS ARE OMITTED.

         01  RPT-LINE                PIC X(132).

         WORKING-STORAGE SECTION.

         77  I                       PIC 9 VALUE 0.

        *****************************************************************
        *** USE OF GEOSUPPORT COPY LIBRARIES (REFERENCED BELOW BY THE ***
        *** COPY STATEMENTS) IS STRONGLY ENCOURAGED.                  ***
        *****************************************************************
         01  WORK1.    COPY  P1COB.
         01  WORK2.    COPY  P2COB.

        **** REPLACE CODE BELOW WITH YOUR OWN REPORT LAYOUT    *********

         01  RPT-DATA-LINE1.
             05  OUT-BOR1            PIC X.
             05  FILLER              PIC X         VALUE ' '.
             05  OUT-ST1             PIC X(32).
             05  FILLER              PIC X         VALUE ' '.
             05  OUT-BOR2            PIC X.
             05  FILLER              PIC X         VALUE ' '.
             05  OUT-ST2             PIC X(32).
             05  OUT-DETAIL.
               10  FILLER            PIC X         VALUE ' '.
               10  OUT-ZIP           PIC X(5).
               10  FILLER            PIC X         VALUE ' '.
               10  OUT-CD            PIC X(2).
               10  FILLER            PIC X         VALUE ' '.
               10  OUT-NYPD-PCT      PIC X(3).
               10  FILLER            PIC X(6)      VALUE ' '.
               10  OUT-SCHLDIST      PIC X(2).
               10  FILLER            PIC X(42)     VALUE ' '.

         01  RPT-DATA-LINE2.
             05  FILLER              PIC X(96)     VALUE ' '.
             05  OUT-ST              PIC X(32).
             05  FILLER              PIC X(4) VALUE ' '.

         01  RPT-ERR-LINE.
             05  FILLER              PIC X(15) VALUE '***** FUNCTION '.
             05  ERR-FUNCTION        PIC X.
             05  FILLER              PIC X(7)  VALUE ' GRC = '.
             05  ERR-GRC             PIC X(2).
             05  FILLER              PIC X(15) VALUE ' REASON CODE = '.
             05  ERR-REASON          PIC X.
             05  FILLER              PIC X(2)  VALUE '. '.
             05  OUT-ERR-MSG         PIC X(80).
             05  FILLER              PIC X(9) VALUE ' '.

         01  RPT-WRN-LINE.
             05  FILLER              PIC X(15) VALUE '***** FUNCTION '.
             05  WRN-FUNCTION        PIC X.
             05  FILLER              PIC X(15) VALUE ' WARNING GRC = '.
             05  WRN-GRC             PIC X(2).
             05  FILLER              PIC X(15) VALUE ' REASON CODE = '.
             05  WRN-REASON          PIC X.
             05  FILLER              PIC X(2)  VALUE '. '.
             05  OUT-WRN-MSG         PIC X(80).
             05  FILLER              PIC X    VALUE ' '.

         01  RPT-HEADER-1.
             05  FILLER              PIC X(40)  VALUE
             'SAMPLE COBOL PROGRAM #2 EXECUTION OUTPUT'.
             05  FILLER              PIC X(72) VALUE ' '.

         01  RPT-HEADER-2.
             05  FILLER              PIC X(58)  VALUE
             '*****----------------- INPUT INTERSECTION ----------------'.
             05  FILLER              PIC X(58)  VALUE
             '------***** *****------------ SELECTED OUTPUT ITEMS ------'.
             05  FILLER              PIC X(16)  VALUE
             '-------*****'.

         01  RPT-HEADER-3.
             05  FILLER              PIC X(58)  VALUE
             'B IN-STREET-NAME-1                 B IN-STREET-NAME-2     '.
             05  FILLER              PIC X(58)  VALUE
             '              ZIP CD NYPD-PCT SCHLDST INTERSECTING STREET '.
             05  FILLER              PIC X(16)  VALUE
             'NAMES           '.

         01  RPT-HEADER-4.
             05  FILLER              PIC X(58)  VALUE
             '_ ________________________________ _ _____________________'.
             05  FILLER              PIC X(58)  VALUE
             '___________ _____ __ ________ _______ ____________________'.
             05  FILLER              PIC X(16)  VALUE
             '____________    '.

         01  FLAGS.
             05 DATA-FLAG    PIC XXX   VALUE 'YES'.
               88 MORE-DATA            VALUE 'YES'.
               88 NO-DATA              VALUE 'NO '.

        ****************************************

         PROCEDURE DIVISION.

             OPEN INPUT IN-FILE, OUTPUT RPT-FILE.
             WRITE RPT-LINE FROM RPT-HEADER-1 AFTER ADVANCING 1 LINES.
             WRITE RPT-LINE FROM RPT-HEADER-2 AFTER ADVANCING 2 LINES.
             WRITE RPT-LINE FROM RPT-HEADER-3 AFTER ADVANCING 2 LINES.
             WRITE RPT-LINE FROM RPT-HEADER-4 AFTER ADVANCING 0 LINES.
             READ IN-FILE AT END MOVE 'NO ' TO DATA-FLAG.
             PERFORM PROCESS THRU PROCESS-EX
                 UNTIL NO-DATA.
             CLOSE IN-FILE, RPT-FILE.
             MOVE 0 TO RETURN-CODE
             STOP RUN.

         PROCESS.




        ******************************************************************
        * TO MAKE A FUNCTION 2 CALL:                                     *
        *   (1) INITIALIZE WORKAREA 1 TO SPACES                          *
        *   (2) SET WA1'S FUNCTION-CODE TO 2                             *
        *   (3) SET THE PLATFORM INDICATOR SWITCH (NON-IBM-MAINFRAME)    *
        *       TO USE CHARACTER-ONLY WORK AREAS (COWS)                  *
        *   (4) MOVE THE 1ST INPUT BORO TO WA1'S INPUT BORO CODE FIELD   *
        *   (5) MOVE THE 1ST INPUT STREET TO WA1'S INPUT STREET NAME     *
        *       FIELD                                                    *
        *   (6) MOVE THE 2ND INPUT BORO TO WA1'S INPUT BORO CODE 2 FIELD *
        *   (7) MOVE THE 2ND INPUT STREET TO WA1'S INPUT STREET NAME 2   *
        *       FIELD                                                    *
        *   (8) CALL GBI WITH 2 WORKAREAS                                *
        *   (9) CHECK RETURN CODES FOR ERRORS OR WARNINGS                *
        ******************************************************************
             MOVE SPACES TO WORK1.
             MOVE '2 ' TO PIWA1-IN-FUNC-CODE.
             MOVE 'C' TO GEO-WA1-IN-NON-IBM-MAIN-FRAME.
             MOVE IN-BOR1 TO GEO-WA1-IN-BORO   OUT-BOR1.
             MOVE IN-BOR2 TO GEO-WA1-IN-BORO-2 OUT-BOR2.
             MOVE IN-STREET1 TO GEO-WA1-IN-STREET-1 OUT-ST1.
             MOVE IN-STREET2 TO GEO-WA1-IN-STREET-2 OUT-ST2.
             CALL 'GBI' USING WORK1 WORK2.

             IF GEO-WA1-OUT-RETURN-CODE NOT = 00
                MOVE '2' TO ERR-FUNCTION WRN-FUNCTION
                PERFORM PRINT-ERROR-LINE THRU P-E-EX.

             IF (GEO-WA1-OUT-RETURN-CODE = 00) OR
               (GEO-WA1-OUT-RETURN-CODE = 01)
                PERFORM SUCCESSFUL-FUNC2 THRU S-F2-EX
             ELSE
               MOVE SPACES TO OUT-DETAIL
               WRITE RPT-LINE FROM RPT-DATA-LINE1 AFTER ADVANCING 1 LINES.

             READ IN-FILE AT END MOVE 'NO ' TO DATA-FLAG.

         PROCESS-EX.
             EXIT.

         SUCCESSFUL-FUNC2.

        ***********************************************************
        ***** REPLACE CODE BELOW WITH YOUR OWN CODE FOR ***********
        ***** PROCESSING SUCCESSFUL GEOSUPPORT CALLS          *****
        ***********************************************************
             MOVE GEO-WA2-FN2-ZIP            TO OUT-ZIP.
             MOVE GEO-WA2-FN2-COMDIST-NUMBER TO OUT-CD.
             MOVE GEO-WA2-FN2-POL-PRECINCT   TO OUT-NYPD-PCT.
             MOVE GEO-WA2-FN2-SCHOOLDIST     TO OUT-SCHLDIST.
        * PROCESS CROSS STREET** CHECK FOR AT LEAST 1.
             WRITE RPT-LINE FROM RPT-DATA-LINE1 AFTER ADVANCING 2 LINES.

             PERFORM CALL-D THRU CALL-D-EX
                VARYING I FROM 1 BY 1 UNTIL
                    (I > GEO-WA2-FN2-NUM-OF-INTERSECTS).

         S-F2-EX.
             EXIT.

         CALL-D.

        *****************************************************************
        * TO GET STREET NAMES FOR INTERSECTING STREET CODES             *
        * MAKE A FUNCTION D CALL:                                       *
        *   (1) INITIALIZE WORKAREA 1 TO SPACES                         *
        *   (2) SET THE WA1'S FUNCTION CODE FIELD TO D                  *
        *   (3) SET THE PLATFORM INDICATOR SWITCH (NON-IBM-MAINFRAME)   *
        *       TO USE CHARACTER-ONLY WORK AREAS (COWS)                 *
        *   (4) USE THE COMPACT STREET NAMES OPTION TO OBTAIN           *
        *       STREET NAMES FORMATTED FOR DISPLAY                      *
        *   (5) MOVE THE BORO AND STREET CODE                           *
        *       WA1'S INPUT STREET CODE 1 FIELD                         *
        *   (6) CALL GBI WITH 1 WORKAREA                                *
        *   (7) CHECK RETURN CODES FOR ERRORS OR WARNINGS               *
        *****************************************************************
             MOVE SPACES TO WORK1.
      MOVE 'D ' TO PIWA1-IN-FUNC-CODE.
             MOVE 'C' TO GEO-WA1-IN-NON-IBM-MAIN-FRAME.
             MOVE 'C' TO GEO-WA1-IN-COMPACT-NAME-FLAG.
             MOVE '25' TO GEO-WA1-IN-SNL.
             MOVE PIWA2-FN2-INTERSECT-B5SC (I)
                 TO GEO-WA1-IN-10SC-1
             CALL 'GBI' USING WORK1.

             IF GEO-WA1-OUT-RETURN-CODE NOT = 00
                MOVE 'D' TO ERR-FUNCTION WRN-FUNCTION
                PERFORM PRINT-ERROR-LINE THRU P-E-EX.

             IF (GEO-WA1-OUT-RETURN-CODE = 00) OR
                (GEO-WA1-OUT-RETURN-CODE = 01)
                PERFORM SUCCESSFUL-FUNCD THRU S-FD-EX.

         CALL-D-EX.
             EXIT.

         SUCCESSFUL-FUNCD.

               MOVE GEO-WA1-OUT-STREET-1 TO OUT-ST
               IF I = 1
               WRITE RPT-LINE FROM RPT-DATA-LINE2 AFTER ADVANCING 0 LINES
               ELSE
               WRITE RPT-LINE FROM RPT-DATA-LINE2 AFTER ADVANCING 1 LINES.

         S-FD-EX.
             EXIT.


         PRINT-ERROR-LINE.
             MOVE GEO-WA1-OUT-RETURN-CODE TO ERR-GRC WRN-GRC.
             MOVE GEO-WA1-OUT-REASON-CODE TO ERR-REASON WRN-REASON.
             MOVE GEO-WA1-OUT-ERROR-MESSAGE TO OUT-ERR-MSG OUT-WRN-MSG.

             IF GEO-WA1-OUT-RETURN-CODE = 01
        **** INSERT YOUR OWN WARNING ROUTINE HERE  ****
               WRITE RPT-LINE FROM RPT-WRN-LINE AFTER ADVANCING 2 LINES
             ELSE
        **** INSERT YOUR OWN WARNING ROUTINE HERE  ****
               WRITE RPT-LINE FROM RPT-ERR-LINE AFTER ADVANCING 2 LINES.

         P-E-EX.
             EXIT.
  /*
  //LKED.SYSIN DD *
    INCLUDE INCLIB(GBI)
  //LKED.INCLIB   DD DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
  //******************************************************************//
  //*                                                                *//
  //*  AS OF GEOSUPPPORT VERSION 10.0,                               *//
  //*  THE STEPLIB (OR JOBLIB) OF THE GEOSUPPORT EXECUTION STEP      *//
  //*  MUST INCLUDE THE FOLLOWING TWO CONCATENATED DATASETS:         *//
  //*       A030.GEO.SUPPORT.PDSE.LOADLIB                            *//
  //*       A030.GEO.SUPPORT.LOADLIB                                 *//
  //*                                                                *//
  //******************************************************************//
  //GO.STEPLIB DD DSN=A030.GEO.SUPPORT.PDSE.LOADLIB,DISP=SHR
  //           DD DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
  //*
  //******************************************************************//
  //*                                                                *//
  //*  AS OF GEOSUPPPORT VERSION 10.0,                               *//
  //*  DD STATEMENTS FOR GEOSUPPORT DATA FILES (E.G. GRID, PAD, ETC) *//
  //*  ARE NO LONGER NEEDED AND ARE IGNORED.  GEOSUPPORT IS TAILORED *//
  //*  TO USE STANDARD GEOSUPPORT DATA SET NAMES.                    *//
  //*  TO USE NON-STANDARD FILES, SEE YOUR SYSTEMS PROGRAMMER.       *//
  //*                                                                *//
  //******************************************************************//
  //*
  //GO.SYSUDUMP DD SYSOUT=A,OUTLIM=3000
  //GO.SYSOUT   DD SYSOUT=A
  //GO.RPTFILE  DD SYSOUT=A
  //GO.INFILE  DD *
  1 CHAMBERS ST                      1 HUDSON ST
  1 SIXTH AVE                        1 W. 8 ST

  1 DUANE ST                         1 READE ST
  /*
  //

SAMPLE COBOL PROGRAM #2 EXECUTION OUTPUT

        *****----------------- INPUT INTERSECTION ----------------------***** *****------------ SELECTED OUTPUT ITEMS ---*****

         B IN-STREET-NAME-1                 B IN-STREET-NAME-2                   ZIP CD NYPD-PCT SCHLDST INTERSECTING STREET NM
         - -------------------------------- - -------------------------------- ----- -- -------- ------- ----------------------

         1 CHAMBERS ST                      1 HUDSON ST                        10007 01 001      02      CHAMBERS STREET
                                                                                                         HUDSON STREET
                                                                                                         WEST BROADWAY

         1 SIXTH AVE                        1 W. 8 ST                          10014 02 006      02      6 AVENUE
                                                                                                         GREENWICH AVENUE
                                                                                                         WEST 8 STREET

         ***** FUNCTION 2 GRC = 62 REASON CODE =  . READE STREET & DUANE STREET DO NOT INTERSECT
         1 DUANE ST                         1 READE ST

ASSEMBLER SAMPLE PROGRAM #1

- Input Job Stream - MSW
- Input Job Stream - COW
- Output Report

ASSEMBLER SAMPLE PROGRAM #1 –Job Stream-MSW

                //ASMF1SRC JOB   YOUR-JOB-CARD-INFORMATION
                //*
                //********************************************************************
                //**  ASSEMBLER SAMPLE BATCH GEOSUPPORT USER APPLICATION PROGRAM \#1 **
                //**                         MSW FORMAT                             **
                //********************************************************************
                //STEP1  EXEC  ASMACLG,
                //         PARM.ASM='OBJECT,NODECK',
                //         PARM.LKED='XREF,LET,LIST,NCAL'
                //ASM.SYSLIB DD DSN=A030.GEO.COPYLIB2,DISP=SHR
                //           DD DSN=A030.GEO.COPYLIB,DISP=SHR
                //           DD DSN=SYS1.MACLIB,DISP=SHR
                //ASM.SYSIN  DD *
                ASMF1SRC TITLE 'SAMPLE GEOSUPPORT ASSEMBLER PROGRAM 1 - MSW FORMAT'
                ASMF1SRC CSECT
                *****************************************************************
                \* THIS PROGRAM MAKES FUNCTION 1 AND D CALLS TO GEOSUPPORT USING *
                \* BORO, HOUSENUMBER, & STREET NAME SUPPLIED BY AN INSTREAM FILE.*
                \* FUNCTION 1 RETURNS GEOGRAPHIC INFORMATION FOR AN ADDRESS.     *
                \* FUNCTION D TRANSLATES AN INPUT STREET CODE TO A STREET NAME.  *
                \* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
                \* NOTE: IF THE CROSS STREET NAMES FLAG WERE USED IN THE         *
                \*       ORIGINAL CALL TO FUNCTION 1, ALL THE CROSS STREET NAMES *
                \*       WOULD HAVE BEEN RETURNED BY FUNCTION 1.                 *
                *****************************************************************
                *
                ***********************************************************************
                \*                                                                     *
                \*  This program will do the following:                                *
                \*                                                                     *
                \*     * Read an instream record containing a house number,            *
                \*       street name, and borough code                                 *
                \*                                                                     *
                \*     * Build Work Area 1 for a Function 1 call                       *
                \*                                                                     *
                \*     * Call Function 1                                               *
                \*                                                                     *
                \*     * Get ZIP code, community district, police precinct, school     *
                \*       district, and lists of street codes of streets intersecting   *
                \*       at the low and high ends of the input street address's block. *
                \*       These will be displayed along with the input address which    *
                \*       consists of borough code, house number, and street name.      *
                \*                                                                     *
                \*     * Call Function D to get the street names of the first          *
                \*       intersecting street on both low and high ends.                *
                \*                                                                     *
                \*     * Print the information                                         *
                \*                                                                     *
                \* NOTE that after each Geosupport call, the Return Code is checked.   *
                \*      If it is greater than 01, an error message is printed, and     *
                \*      the next input record, if any, is read.                        *
                \*      If it is 01, a warning message is printed, the input record is *
                \*      processed, and the next record is read.                        *
                \*      If it is zero, the input record is processed, and the next     *
                \*      record is read.                                                *
                \*                                                                     *
                ***********************************************************************
                         SPACE
                  STM   R14,R12,12(R13)   Save caller's registers
                         LR    R3,R15
                         LA    R12,4095(,R3)     (second base register
                         LA    R12,1(,R12)        to accomodate Work Areas 1 and 2)
                   USING ASMF1SRC,R3,R12
                \* Chain save areas
                         LA    R4,MYSAVE
                         ST    R13,4(,R4)    Save caller's savearea address
                         ST    R4,8(,R13)    Save pgm's savearea adr in caller savearea
                         LR    R13,R4        Ensure that R13 points to pgm's savearea
                         SPACE 2
                         XR    R15,R15                 (set OS return code to zero)
                \* Open input and output files
                         OPEN  (INFILE,,OUTFILE,(OUTPUT))
                         TM    INFILE+48,X'10'   Did input file open successfully?
                         BNO   INOPNERR             (no..)
                         TM    OUTFILE+48,X'10'  Did output file open successfully?
                         BNO   OUTOPNER             (no..)
                \* Print page and report header lines
                         SPACE
                         PUT   OUTFILE,HDR1
                         PUT   OUTFILE,HDR2
                         PUT   OUTFILE,HDR3
                         PUT   OUTFILE,HDR4
                         B     NEXTREC
                         SPACE 2
                         TITLE 'READ IN-STREAM INPUT AND PREPARE FUNCTION 1 CALL'
                \* Read (next) input record
                NEXTREC  DS    0H
                         GET   INFILE,INREC
                \* Move input data to output record for display
                         MVC   DBORO,INBORO                   borough code
                         MVC   DHSE(L'W1IHSE#),INHOUSE        house number
                         MVC   DSTRT,INSTREET                 street name
                         SPACE
                *****************************************************************
                \* TO MAKE A FUNCTION 1 CALL:                                    *
                \*   (1) INITIALIZE WORKAREA 1 TO SPACES                         *
                \*   (2) SET WA1'S FUNCTION CODE FIELD TO 1                      *
                \*   (3) MOVE THE INPUT BORO TO WA1'S INPUT BORO CODE FIELD      *
                \*   (4) MOVE THE INPUT HOUSE NUMBER TO WA1'S INPUT HOUSE NUMBER *
                \*       FIELD                                                   *
                \*   (5) MOVE THE INPUT STREET TO WA1'S INPUT STREET NAME FIELD  *
                \*   (6) CALL GBI WITH 2 WORKAREAS                               *
                \*   (7) CHECK RETURN CODES FOR ERRORS OR WARNINGS               *
                *****************************************************************
                 \* Clear WA1 to blanks
                         LA    R8,W1BAL    "To" address for MVCL
                         LA    R9,W1LENGTH     "To" length
                         XR    R11,R11       for blanking out std WA1,
                         ICM   R11,B'1000',=C' '  rather than moving data
                \* ...since if the "from" length reg. has lo-order zeroes, MVCL will
                \* pad the target area with the pad character of the "from" register
                \* and do nothing else (the "from" address register is not used).
                         MVCL  R8,R10
                         SPACE
                \* Prime Work Area 1 for Function 1 call

                         MVC   W1IFUNC,=CL2'1 '              Get function code
                         MVC   W1IBORO1,INBORO                   borough code
                         MVC   W1IHSE#(L'W1IHSE#),INHOUSE        house number
                         MVC   W1ISTRT1,INSTREET                 street name
                         MVC   W1ISNL(L'W1ISNL),=C'25'    Normalized street name length

                ** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
                \*                                                                     *
                \*        As of Geosupport Version 10.1,                               *
                \*        to receive roadbed-specific information,                     *
                \*        set the Roadbed Request Switch to 'R', as follows:           *
                \*        MVC   W1IRBRQS,C'R'                                          *
                \*                                                                     *
                \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
                *
                \* Call Function 1 (2-Work-Area call)
                         CALL  GBI,(W1BAL,W2BAL),VL
                \* Check Return code
                         CLC   W1ORC(2),=C'00'         Good return?
                         BE    PROCESS                     Yes, process returned data
                \* Handle errors and warnings
                ERREXIT  DS    0H
                         CLC   W1ORC(2),=C'01'         Warning condition?
                         BE    PUTWARN                    Yes, process warning
                \*                                              and then process input;
                \*                                         otherwise, process error
                         MVC   ERINPUT,DSPLYIN    Boro code, hse no., street name
                         MVC   ERFUNC,W1IFUNC              function code
                         MVC   ERRET(L'W1ORC),W1ORC        return code
                         MVC   ERREAS(L'W1OREASN),W1OREASN reason code
                         PUT   OUTFILE,ERR1            Print error messages 1
                         B     PUTMSG                                   and 2
                PUTWARN  DS    0H
                         MVC   WRINPUT,DSPLYIN    Boro code, hse no., street name
                         MVC   WRFUNC,W1IFUNC              function code
                         MVC   WRRET(L'W1ORC),W1ORC        return code
                         MVC   WRREAS(L'W1OREASN),W1OREASN reason code
                         PUT   OUTFILE,WRN1            Print warning messages 1
                PUTMSG   DS    0H                                         and 2
                         MVC   ERRWRN(L'W1OERROR),W1OERROR
                         PUT   OUTFILE,ERRWRN2         Print error/warning message 2
                         CLC   W1ORC(2),=C'01'         Warning condition?
                         BNE   NEXTREC                  No, get next record, if any
                         MVI   OINPUT,C' '              Yes,
                         MVC   OINPUT+1(L'OINPUT-1),OINPUT  ensure input NOT displayd
                         MVI   OUTVALID,C' '     ensure single-spacing after warning
                         B     GETZIP            and continue normal processing
                         SPACE
                \* Handle successful Geosupport calls (Return Code <= 01)
                PROCESS  DS    0H
                         MVC   OINPUT,DSPLYIN    Boro code, hse no., street name
                         MVI   OUTVALID,C'0'     Ensure double-spacing
                GETZIP   DS    0H
                         MVC   OZIP,W2F1ZIP      ZIP code
                         MVC   OCOMM,W2F1CDN     community district number
                         MVC   OPCT,W2F1POP      police precinct
                         MVC   OSCHL,W2F1SCH     school district
                ASSEMBLER SAMPLE PROGRAM #1- Job stream- MSW (continue


                ***** At this point, clear WA1 again, call Function D, and move ******
                ***** its reported Low and High Instersecting Street Names to output *
                         TITLE 'GET LOW, HIGH INTERSECTING STREETS, USING FUNCTION D'
                         SPACE 2
                *************************************************************
                \* THIS PROGRAM ASSUMES THERE EXISTS AT LEAST ONE HIGH AND   *
                \* ONE LOW CROSS STREET.  TO GET THE STREET NAMES OF THE     *
                \* FIRST-LISTED HIGH AND FIRST-LISTED LOW CROSS STREETS      *
                \* FROM THE HIGH AND LOW STREET CODE LISTS CALL FUNCTION D:  *
                \*   (1) INITIALIZE WORKAREA 1 TO SPACES                     *
                \*   (2) SET WA1'S FUNCTION CODE FIELD TO D                  *
                \*   (3) SET WA1'S STREET NAME LENGTH FIELD TO DESIRED       *
                \*       VALUE (IN THIS CASE 25 BECAUSE THE REPORT LINE      *
                \*              HAS SPACE FOR ONLY 25 CHARACTERS)            *
                \*   (4) USE THE COMPACT STREET NAMES OPTION TO OBTAIN       *
                \*       STREET NAMES FORMATTED FOR DISPLAY                  *
                \*   (5) MOVE WA2'S LOW PBSC FIELD TO WA1'S INPUT STREET     *
                \*       CODE 1 FIELD                                        *
                \*   (6) MOVE WA2'S HIGH PBSC FIELD TO WA1'S INPUT STREET    *
                \*       CODE 2 FIELD                                        *
                \*   (7) CALL GBI WITH 1 WORKAREA                            *
                \*   (8) CHECK RETURN CODES FOR ERRORS OR WARNINGS           *
                *************************************************************
                         SPACE
                \* Clear WA1 to blanks
                         LA    R8,W1BAL    "To" address for MVCL
                         LA    R9,W1LENGTH     "To" length
                         XR    R11,R11       for blanking out std WA1,
                         ICM   R11,B'1000',=C' '  rather than moving data
                \* ...since if the "from" length reg. has lo-order zeroes, MVCL will
                \* pad the target area with the pad character of the "from" register
                \* and do nothing else (the "from" address register is not used).
                         MVCL  R8,R10
                         MVC   W1ICDE1,W2F1CDEL
                         MVC   W1ICDE2,W2F1CDEH
                         MVC   W1IFUNC(2),=CL2'D '
                   MVC   W1ISNL(L'W1ISNL),=C'25'    normalized street name length
                         MVI   W1ICMPCT,C'C'              streets to be compacted
                         CALL  GBI,W1BAL,VL   Call Function D
                \* Check Return code
                         CLC   W1ORC(2),=C'00'         Good return?
                         BNE   ERREXIT                     No, error or warning
                \*                                          Yes, complete the record
                \*                                               and write it out
                PUTREC   DS    0H
                         MVC   OLOSTRT,W1OSTRT1
                         MVC   OHISTRT,W1OSTRT2
                \* Print an output record and get the next input record, if any
                         PUT   OUTFILE,OUTVALID
                         B     NEXTREC
                EXIT     DS    0H
                OUTOPNER DS    0H
                         CLOSE (INFILE)
                         TM    OUTFILE+48,X'10'   Did OUTFILE open successfully?
                         BNO   INOPNERR              No, bypass closing it
                         CLOSE (OUTFILE)
                ASSEMBLER SAMPLE PROGRAM #1- Job stream- MSW (continue)

                INOPNERR DS    0H
                         L     R13,4(,R13)
                         L     R14,12(,R13)
                         LM    R0,R12,20(R13)
                         BR    R14
                         SPACE 2
                PARAMERR DS    0H       parameter error, missing or invalid
                         LA    R15,8    rc=8
                         B     EXIT
                         TITLE 'DATA SECTION - REGISTER ASSIGNMENTS'
                R0       EQU   0
                R1       EQU   1
                R2       EQU   2
                R3       EQU   3
                R4       EQU   4
                R5       EQU   5
                R6       EQU   6
                R7       EQU   7
                R8       EQU   8
                R9       EQU   9
                R10      EQU   10
                R11      EQU   11
                R12      EQU   12
                R13      EQU   13
                R14      EQU   14
                R15      EQU   15
                         TITLE 'FILE AND RECORD DEFINITIONS'
                         PUSH  PRINT
                         PRINT NOGEN
                INFILE   DCB   DSORG=PS,MACRF=(GM),DDNAME=INFILE,                      *
                               RECFM=FB,LRECL=80,BLKSIZE=400,EODAD=EXIT
                         SPACE
                OUTFILE  DCB   DSORG=PS,MACRF=(PM),DDNAME=SYSPRINT,                    *
                               RECFM=FBA,LRECL=133,BLKSIZE=1330
                *
                         POP PRINT
                         SPACE
                INREC    DS    0CL80              Input record
                INBORO   DS    CL1                    Borough code
                INHOUSE  DS    CL12                   House number
                INSTREET DS    CL32                   Street name
                         DC    35C' '                 filler
                         SPACE
                \* Output records: error, warning, and normal
                ERR1     DS    0CL133
                         DC    C'0'
                ERINPUT  DS    CL48
                         DC    C'*** FUNCTION '
                ERFUNC   DS    CL2
                         DC    C' GRC = '
                ERRET    DS    CL2
                         DC    C' REASON CODE = '
                ERREAS   DS    CL1
                         DC    CL(133-89)' '
                         SPACE
                WRN1     DS    0CL133
                         DC    C'0'
                WRINPUT  DS    CL48
                         DC    C'*** FUNCTION '
                WRFUNC   DS    CL2
                         DC    C' WARNING, GRC = '
                WRRET    DS    CL2
                         DC    C' REASON CODE = '
                WRREAS   DS    CL1
                         DC    CL(133-98)' '
                         SPACE
                ERRWRN2  DS    0CL133
                         DC    C' '
                         DC    48C' '          Boro Code, House Number, Street Name
                         DC    CL4'*** '
                ERRWRN   DS    CL80            Error/Warning message
                         SPACE
                HDR1     DC    CL133'1SAMPLE ASSEMBLER \#1 EXECUTION OUTPUT             *
                                  '
                HDR2     DC    CL133'0*****---------- INPUT ADDRESS ------------***** \*C
                               ****--------------------- SELECTED OUTPUT ITEMS --------C
                        ----------------------*****'
                HDR3     DC    CL133'0B HOUSE NUMBER IN-STREET-NAME                    *
                                ZIP CD NYPD-PCT SCHLDST LOW CROSS STREET          HIGH *
                               CROSS STREET               '
                HDR4     DC    CL133' - ------------ -------------------------------- -*
                               ---- -- -------- ------- ------------------------- -----*
                               ---------------------------'
                OUTVALID DS    0CL133
                \* Borough code, house number, and street name are from input record
                         DC    C'0'
                OINPUT   DS    CL48
                OZIP     DS    CL5
                         DC    C' '
                OCOMM    DS    CL2
                         DC    C' '
                OPCT     DS    CL3
                         DC    6C' '
                OSCHL    DS    CL2
                         DC    6C' '
                OLOSTRT  DS    CL25  Normalized name of intersecting street at low end
                         DC    C' '
                OHISTRT  DS    CL25  Normalized name of intersecting street at high end
                         DC    7C' '
                         TITLE 'WORKING VARIABLES, VALUES, ETC.'
                MYSAVE   DC    18F'0'
                ***********************************************************************
                ***** USE OF GEOSUPPORT COPY LIBRARIES (REFERENCED BELOW BY THE     ***
                ***** COPY STATEMENTS) IS STRONGLY ENCOURAGED.                      ***
                ***********************************************************************
                         COPY  W1BAL              COPY WORK AREA 1
                         EJECT
                         COPY  W2BAL              COPY WORK AREA 2
                         EJECT
                         SPACE 2
                DSPLYIN  DS    0CL48
                DBORO    DS    CL1
                         DC    C' '
                DHSE     DS    CL12
                         DC    C' '
                DSTRT    DS    CL32
                  DC    C' '
                         SPACE 2
                         TITLE 'CONSTANTS AND LITERAL POOL'
                         SPACE 2
                         LTORG
                         END   ASMF1SRC
                //LKED.SYSIN  DD  *
                 INCLUDE INCLIB(GBI)
                /*
                //LKED.INCLIB   DD  DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
                //*                                                             \*//
                //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
                //*                                                             \*//
                //*  AS OF GEOSUPPORT VERSION 10.0,                             \*//
                //*  THE STEPLIB (OR JOBLIB) OF THE GEOSUPPORT EXECUTION STEP   \*//
                //*  MUST INCLUDE THE FOLLOWING TWO CONCATENATED DATASETS:      \*//
                //*       A030.GEO.SUPPORT.PDSE.LOADLIB                         \*//
                //*       A030.GEO.SUPPORT.LOADLIB                              \*//
                //*                                                             \*//
                //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
                //GO.STEPLIB  DD  DSN=A030.GEO.SUPPORT.PDSE.LOADLIB,DISP=SHR
                //*           DD  DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
                //*
                //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
                //*                                                             \*//
                //*   AS OF GEOSUPPORT VERSION 10.0,                            \*//
                //*   DD STATEMENTS FOR GEOSUPPORT DATA FILES (E.G. GRID, PAD,  \*//
                //*   ETC) ARE NO LONGER NEEDED AND ARE IGNORED. GEOSUPPORT     \*//
                //*   IS TAILORED TO USE STANDARD GEOSUPPORT DATA SET NAMES.    \*//
                //*   TO USE NON-STANDARD FILES, SEE YOUR SYSTEMS PROGRAMMER    \*//
                //*                                                             \*//
                //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
                //*
                //SYSUDUMP DD  SYSOUT=\*,OUTLIM=2000
                //SYSPRINT DD  SYSOUT=*
                //INFILE   DD  *
                122          READE ST
                1500         DUANE ST
                12-4         BROADWAY
                4165-100     BAISLEY BLVD
                4165-1000    BAISLEY BLVD
                /*
                //

ASSEMBLER SAMPLE PROGRAM #1 –Job Stream-MSW

          //ASMC1SRC JOB   YOUR-JOB-CARD-INFORMATION
          //*
          //********************************************************************
          //**  ASSEMBLER SAMPLE BATCH GEOSUPPORT USER APPLICATION PROGRAM \#1 **
          //**                         COW FORMAT                             **
          //********************************************************************
          //STEP1  EXEC  ASMACLG,
          //         PARM.ASM='OBJECT,NODECK',
          //         PARM.LKED='XREF,LET,LIST,NCAL'
          //ASM.SYSLIB DD DSN=A030.GEO.COPYLIB2,DISP=SHR
          //           DD DSN=A030.GEO.COPYLIB,DISP=SHR
          //           DD DSN=SYS1.MACLIB,DISP=SHR
          //ASM.SYSIN  DD *
          ASMC1SRC TITLE 'SAMPLE GEOSUPPORT ASSEMBLER PROGRAM 1 - COW FORMAT'
          ASMC1SRC CSECT
          *****************************************************************
          \* THIS PROGRAM MAKES FUNCTION 1 AND D CALLS TO GEOSUPPORT USING *
          \* BORO, HOUSENUMBER, & STREET NAME SUPPLIED BY AN INSTREAM FILE.*
          \* FUNCTION 1 RETURNS GEOGRAPHIC INFORMATION FOR AN ADDRESS.     *
          \* FUNCTION D TRANSLATES AN INPUT STREET CODE TO A STREET NAME.  *
          \* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
          \* NOTE: IF THE CROSS STREET NAMES FLAG WERE USED IN THE         *
          \*       ORIGINAL CALL TO FUNCTION 1, ALL THE CROSS STREET NAMES *
          \*       WOULD HAVE BEEN RETURNED BY FUNCTION 1.                 *
          *****************************************************************
          *
          ***********************************************************************
          \*                                                                     *
          \*  This program will do the following:                                *
          \*                                                                     *
          \*     * Read an instream record containing a house number,            *
          \*       street name, and borough code                                 *
          \*                                                                     *
          \*     * Build Work Area 1 for a Function 1 call                       *
          \*                                                                     *
          \*     * Call Function 1                                               *
          \*                                                                     *
          \*     * Get ZIP code, community district, police precinct, school     *
          \*       district, and lists of street codes of streets intersecting   *
          \*       at the low and high ends of the input street address's block. *
          \*       These will be displayed along with the input address which    *
          \*       consists of borough code, house number, and street name.      *
          \*                                                                     *
          \*     * Call Function D to get the street names of the first          *
          \*       intersecting street on both low and high ends.                *
          \*                                                                     *
          \*     * Print the information                                         *
          \*                                                                     *
          \* NOTE that after each Geosupport call, the Return Code is checked.   *
          \*      If it is greater than 01, an error message is printed, and     *
          \*      the next input record, if any, is read.                        *
          \*      If it is 01, a warning message is printed, the input record is *
          \*      processed, and the next record is read.                        *
          \*      If it is zero, the input record is processed, and the next     *
          \*      record is read.                                                *
          \*                                                                     *
          ***********************************************************************
                   SPACE
                   STM   R14,R12,12(R13)   Save caller's registers
                   LR    R3,R15
                   LA    R12,4095(,R3)     (second base register
                   LA    R12,1(,R12)        to accomodate Work Areas 1 and 2)
                   USING ASMC1SRC,R3,R12
          \* Chain save areas
                   LA    R4,MYSAVE
                   ST    R13,4(,R4)    Save caller's savearea address
                   ST    R4,8(,R13)    Save pgm's savearea adr in caller savearea
                   LR    R13,R4        Ensure that R13 points to pgm's savearea
                   SPACE 2
                   XR    R15,R15                 (set OS return code to zero)
          \* Open input and output files
                   OPEN  (INFILE,,OUTFILE,(OUTPUT))
                   TM    INFILE+48,X'10'   Did input file open successfully?
                   BNO   INOPNERR             (no..)
                   TM    OUTFILE+48,X'10'  Did output file open successfully?
                   BNO   OUTOPNER             (no..)
          \* Print page and report header lines
                   SPACE
                   PUT   OUTFILE,HDR1
                   PUT   OUTFILE,HDR2
                   PUT   OUTFILE,HDR3
                   PUT   OUTFILE,HDR4
                   B     NEXTREC
                   SPACE 2
                   TITLE 'READ IN-STREAM INPUT AND PREPARE FUNCTION 1 CALL'
          \* Read (next) input record
          NEXTREC  DS    0H
                   GET   INFILE,INREC
          \* Move input data to output record for display
                   MVC   DBORO,INBORO                   borough code
                   MVC   DHSE(L'INHOUSE),INHOUSE        house number
                   MVC   DSTRT,INSTREET                 street name
                   SPACE
          *****************************************************************
          \* TO MAKE A FUNCTION 1 CALL:                                    *
          \*   (1) INITIALIZE WORKAREA 1 TO SPACES                         *
          \*   (2) SET WA1'S FUNCTION CODE FIELD TO 1                      *
          \*   (3) MOVE THE INPUT BORO TO WA1'S INPUT BORO CODE FIELD      *
          \*   (4) MOVE THE INPUT HOUSE NUMBER TO WA1'S INPUT HOUSE NUMBER *
          \*       FIELD                                                   *
          \*   (5) MOVE THE INPUT STREET TO WA1'S INPUT STREET NAME FIELD  *
          \*   (6) CALL GBI WITH 2 WORKAREAS                               *
          \*   (7) CHECK RETURN CODES FOR ERRORS OR WARNINGS               *
          *****************************************************************
          \* Clear WA1 to blanks
                   LA    R8,P1BAL    "To" address for MVCL
                   LA    R9,P1LENGTH     "To" length
                   XR    R11,R11       for blanking out std WA1,
                   ICM   R11,B'1000',=C' '  rather than moving data
          \* ...since if the "from" length reg. has lo-order zeroes, MVCL will
          \* pad the target area with the pad character of the "from" register
          \* and do nothing else (the "from" address register is not used).
                   MVCL  R8,R10
                   SPACE
          \* Prime Work Area 1 for Function 1 call
                   MVI   P1IPLIND,C'C'                Set Work Area Format to COW
                   MVC   P1IFUNC,=CL2'1 '              Get function code
                   MVC   P1IBORO1,INBORO                   borough code
          *
          \* Note COW - MSW: Display House # - P1IHSE# is a 16-byte field
          \*                                   W1IHSE# is a 12-byte field
          *
                   MVC   P1IHSE#(L'INHOUSE),INHOUSE        house number
                   MVC   P1ISTRT1,INSTREET                 street name
          *

          \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
          \*                                                                     *
          \*        As of Geosupport Version 10.1,                               *
          \*        to receive roadbed-specific information,                     *
          \*        set the Roadbed Request Switch to 'R', as follows:           *
          \*        MVC   P1IRBRQS,C'R'                                          *
          \*                                                                     *
          \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
          *
                   MVC   P1ISNL(L'P1ISNL),=C'25'    Normalized street name length
          \* Call Function 1 (2-Work-Area call)
                   CALL  GBI,(P1BAL,P2BAL),VL
          \* Check Return code
                   CLC   P1ORC(2),=C'00'         Good return?
                   BE    PROCESS                     Yes, process returned data
          \* Handle errors and warnings
          ERREXIT  DS    0H
                   CLC   P1ORC(2),=C'01'         Warning condition?
                   BE    PUTWARN                    Yes, process warning
          \*                                              and then process input;
          \*                                         otherwise, process error
                   MVC   ERINPUT,DSPLYIN    Boro code, hse no., street name
                   MVC   ERFUNC,P1IFUNC              function code
                   MVC   ERRET(L'P1ORC),P1ORC        return code
                   MVC   ERREAS(L'P1OREASN),P1OREASN reason code
                   PUT   OUTFILE,ERR1            Print error messages 1
                   B     PUTMSG                                   and 2
          PUTWARN  DS    0H
                   MVC   WRINPUT,DSPLYIN    Boro code, hse no., street name
                   MVC   WRFUNC,P1IFUNC              function code
                   MVC   WRRET(L'P1ORC),P1ORC        return code
            MVC   WRREAS(L'P1OREASN),P1OREASN reason code
                   PUT   OUTFILE,WRN1            Print warning messages 1
          PUTMSG   DS    0H                                         and 2
                   MVC   ERRWRN(L'P1OERROR),P1OERROR
                   PUT   OUTFILE,ERRWRN2         Print error/warning message 2
                   CLC   P1ORC(2),=C'01'         Warning condition?
                   BNE   NEXTREC                  No, get next record, if any
                   MVI   OINPUT,C' '              Yes,
                   MVC   OINPUT+1(L'OINPUT-1),OINPUT  ensure input NOT displayd
                   MVI   OUTVALID,C' '     ensure single-spacing after warning
                   B     GETZIP            and continue normal processing
                   SPACE
          \* Handle successful Geosupport calls (Return Code <= 01)
          PROCESS  DS    0H
                   MVC   OINPUT,DSPLYIN    Boro code, hse no., street name
                   MVI   OUTVALID,C'0'     Ensure double-spacing
          GETZIP   DS    0H
                   MVC   OZIP,P2F1ZIP      ZIP code
                   MVC   OCOMM,P2F1CDN     community district number
                   MVC   OPCT,P2F1POP      police precinct
                   MVC   OSCHL,P2F1SCH     school district
          ***** At this point, clear WA1 again, call Function D, and move ******
          ***** its reported Low and High Intersecting Street Names to output *
                   TITLE 'GET LOW, HIGH INTERSECTING STREETS, USING FUNCTION D'
                   SPACE 2
          *************************************************************
          \* THIS PROGRAM ASSUMES THERE EXISTS AT LEAST ONE HIGH AND   *
          \* ONE LOW CROSS STREET.  TO GET THE STREET NAMES OF THE     *
          \* FIRST-LISTED HIGH AND FIRST-LISTED LOW CROSS STREETS      *
          \* FROM THE HIGH AND LOW STREET CODE LISTS CALL FUNCTION D:  *
          \*   (1) INITIALIZE WORKAREA 1 TO SPACES                     *
          \*   (2) SET WA1'S FUNCTION CODE FIELD TO D                  *
          \*   (3) SET WA1'S STREET NAME LENGTH FIELD TO DESIRED       *
          \*       VALUE (IN THIS CASE 25 BECAUSE THE REPORT LINE      *
          \*              HAS SPACE FOR ONLY 25 CHARACTERS)            *
          \*   (4) USE THE COMPACT STREET NAMES OPTION TO OBTAIN       *
          \*       STREET NAMES FORMATTED FOR DISPLAY                  *
          \*   (5) MOVE WA2'S LOW B5SC FIELD TO WA1'S INPUT STREET     *
          \*       CODE 1 FIELD                                        *
          \*   (6) MOVE WA2'S HIGH B5SC FIELD TO WA1'S INPUT STREET    *
          \*       CODE 2 FIELD                                        *
          \*   (7) CALL GBI WITH 1 WORKAREA                            *
          \*   (8) CHECK RETURN CODES FOR ERRORS OR WARNINGS           *
          *************************************************************
                   SPACE
          \* Clear WA1 to blanks
                   LA    R8,P1BAL    "To" address for MVCL
                   LA    R9,P1LENGTH     "To" length
                   XR    R11,R11       for blanking out std WA1,
                   ICM   R11,B'1000',=C' '  rather than moving data
          \* ...since if the "from" length reg. has lo-order zeroes, MVCL will
          \* pad the target area with the pad character of the "from" register
          and do nothing else (the "from" address register is not used).
                   MVCL  R8,R10
                   MVI   P1IPLIND,C'C'                Set Work Area Format to COW
          *
          \* Note  COW - MSW: P1ICDEx is the 10-digit street code (no boro)
          \*                  P1IBCDx is the Boro and 10-digit street code
          \*                  W1ICDEx is the packed Boro and 5-digit street code
          \*                  P2F1CDEx is Boro and 5-digit street code list
          \*                  W2F1CDEx is packed Boro and 5-digit street code list
          *
                   MVC   P1IBCD1(6),P2F1CDEL
                   MVC   P1IBCD2(6),P2F1CDEH
                   MVC   P1IFUNC(2),=CL2'D '
                   MVC   P1ISNL(L'P1ISNL),=C'25'    normalized street name length
                   MVI   P1ICMPCT,C'C'              streets to be compacted
                   CALL  GBI,P1BAL,VL   Call Function D
          \* Check Return code
                   CLC   P1ORC(2),=C'00'         Good return?
                   BNE   ERREXIT                     No, error or warning
          \*                                          Yes, complete the record
          \*                                               and write it out
          PUTREC   DS    0H
                   MVC   OLOSTRT,P1OSTRT1
                   MVC   OHISTRT,P1OSTRT2
          \* Print an output record and get the next input record, if any
                   PUT   OUTFILE,OUTVALID
                   B     NEXTREC
          EXIT     DS    0H
          OUTOPNER DS    0H
                   CLOSE (INFILE)
                   TM    OUTFILE+48,X'10'   Did OUTFILE open successfully?
                   BNO   INOPNERR              No, bypass closing it
                   CLOSE (OUTFILE)
          INOPNERR DS    0H
                   L     R13,4(,R13)
                   L     R14,12(,R13)
                   LM    R0,R12,20(R13)
                   BR    R14
                   SPACE 2
          PARAMERR DS    0H       parameter error, missing or invalid
                   LA    R15,8    rc=8
                   B     EXIT
                   TITLE 'DATA SECTION - REGISTER ASSIGNMENTS'
          R0       EQU   0
          R1       EQU   1
          R2       EQU   2
          R3       EQU   3
          R4       EQU   4
          R5       EQU   5
          R6       EQU   6
          R7       EQU   7
          R8       EQU   8
          R9       EQU   9
          R10      EQU   10
          R11      EQU   11
          R12      EQU   12
          R13      EQU   13
          R14      EQU   14
          R15      EQU   15
                   TITLE 'FILE AND RECORD DEFINITIONS'
                   PUSH  PRINT
                   PRINT NOGEN
          INFILE   DCB   DSORG=PS,MACRF=(GM),DDNAME=INFILE,                      *
                         RECFM=FB,LRECL=80,BLKSIZE=400,EODAD=EXIT
                   SPACE
          OUTFILE  DCB   DSORG=PS,MACRF=(PM),DDNAME=SYSPRINT,                    *
                         RECFM=FBA,LRECL=133,BLKSIZE=1330
          *
                   POP PRINT
                   SPACE
          INREC    DS    0CL80              Input record
          INBORO   DS    CL1                    Borough code
          INHOUSE  DS    CL12                   House number
          INSTREET DS    CL32                   Street name
                   DC    35C' '                 filler
                   SPACE
          \* Output records: error, warning, and normal
          ERR1     DS    0CL133
                   DC    C'0'
          ERINPUT  DS    CL48
                   DC    C'*** FUNCTION '
          ERFUNC   DS    CL2
                   DC    C' GRC = '
          ERRET    DS    CL2
                   DC    C' REASON CODE = '
          ERREAS   DS    CL1
                   DC    CL(133-89)' '
                   SPACE
          WRN1     DS    0CL133
                   DC    C'0'
          WRINPUT  DS    CL48
                   DC    C'*** FUNCTION '
          WRFUNC   DS    CL2
                   DC    C' WARNING, GRC = '
          WRRET    DS    CL2
                   DC    C' REASON CODE = '
          WRREAS   DS    CL1
                   DC    CL(133-98)' '
                   SPACE
          ERRWRN2  DS    0CL133
                   DC    C' '
                   DC    48C' '          Boro Code, House Number, Street Name
                   DC    CL4'*** '
          ERRWRN   DS    CL80            Error/Warning message
                   SPACE
          HDR1     DC    CL133'1SAMPLE ASSEMBLER \#1 EXECUTION OUTPUT             *
                                                    '
          HDR2     DC    CL133'0*****---------- INPUT ADDRESS ------------***** \*C
                         ****--------------------- SELECTED OUTPUT ITEMS --------C
                         ----------------------*****'
          HDR3     DC    CL133'0B HOUSE NUMBER IN-STREET-NAME                    *
                          ZIP CD NYPD-PCT SCHLDST LOW CROSS STREET          HIGH *
                         CROSS STREET               '
          HDR4     DC    CL133' - ------------ -------------------------------- -*
                         ---- -- -------- ------- ------------------------- -----*
                         ---------------------------'
          OUTVALID DS    0CL133
          \* Borough code, house number, and street name are from input record
                   DC    C'0'
          OINPUT   DS    CL48
          OZIP     DS    CL5
                   DC    C' '
          OCOMM    DS    CL2
                   DC    C' '
          OPCT     DS    CL3
                   DC    6C' '
          OSCHL    DS    CL2
                   DC    6C' '
          OLOSTRT  DS    CL25  Normalized name of intersecting street at low end
                   DC    C' '
          OHISTRT  DS    CL25  Normalized name of intersecting street at high end
                   DC    7C' '
                   TITLE 'WORKING VARIABLES, VALUES, ETC.'
          MYSAVE   DC    18F'0'
          ***********************************************************************
          ***** USE OF GEOSUPPORT COPY LIBRARIES (REFERENCED BELOW BY THE     ***
          ***** COPY STATEMENTS) IS STRONGLY ENCOURAGED.                      ***
          ***********************************************************************
                   COPY  P1BAL              COPY WORK AREA 1
                   EJECT
                   COPY  P2BAL              COPY WORK AREA 2
                   EJECT
                   SPACE 2
          DSPLYIN  DS    0CL48
          DBORO    DS    CL1
                   DC    C' '
          DHSE     DS    CL12
                   DC    C' '
          DSTRT    DS    CL32
                   DC    C' '
                   SPACE 2
                   TITLE 'CONSTANTS AND LITERAL POOL'
                   SPACE 2
                   LTORG
                   END   ASMC1SRC
          //LKED.SYSIN  DD  *
           INCLUDE INCLIB(GBI)
          /*
          //LKED.INCLIB   DD  DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
          //*                                                            \*//
          //*     AS OF GEOSUPPORT VERSION 10.0,                         \*//
          //*     GEO.SUPPORT.PDSE.LOADLIB AND GEO.SUPPORT.LOADLIB       \*//
          //*     ARE REQUIRED IN THE STEPLIB (OR JOBLIB) OF THE         \*//
          //*     GEOSUPPORT EXECUTION STEP.                             \*//
          //*                                                            \*//
          //GO.STEPLIB  DD  DSN=A030.GEO.SUPPORT.PDSE.LOADLIB,DISP=SHR
          //*           DD  DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
          //*                                                            \*//
          //*   AS OF GEOSUPPORT VERSION 10.0,                           \*//
          //*   DD STATEMENTS ARE NO LONGER USED TO DEFINE?              \*//
          //*   GEOSUPPORT DATA FILES.                                   \*//
          //*   DD STATEMENTS ARE NO LONGER INCLUDED FOR THE             \*//
          //*   GEOSUPPORT FOREGROUND FILES.                             \*//
          //*   TO USE NON-STANDARD FILES, SEE YOUR SYSTEMS PROGRAMMER   \*//
          //*                                                            \*//
          //SYSUDUMP DD  SYSOUT=\*,OUTLIM=2000
          //SYSPRINT DD  SYSOUT=*
          //INFILE   DD  *
          122          READE ST
          1500         DUANE ST
          12-4         BROADWAY
          4165-100     BAISLEY BLVD
          4165-1000    BAISLEY BLVD
          /*
          //


          <center><b>ASSEMBLER SAMPLE PROGRAM \#1 –Job Stream-COW</b></center>

          //ASMC1SRC JOB   YOUR-JOB-CARD-INFORMATION
          //*
          //********************************************************************
          //**  ASSEMBLER SAMPLE BATCH GEOSUPPORT USER APPLICATION PROGRAM \#1 **
          //**                         COW FORMAT                             **
          //********************************************************************
          //STEP1  EXEC  ASMACLG,
          //         PARM.ASM='OBJECT,NODECK',
          //         PARM.LKED='XREF,LET,LIST,NCAL'
          //ASM.SYSLIB DD DSN=A030.GEO.COPYLIB2,DISP=SHR
          //           DD DSN=A030.GEO.COPYLIB,DISP=SHR
          //           DD DSN=SYS1.MACLIB,DISP=SHR
          //ASM.SYSIN  DD *
          ASMC1SRC TITLE 'SAMPLE GEOSUPPORT ASSEMBLER PROGRAM 1 - COW FORMAT'
          ASMC1SRC CSECT
          *****************************************************************
          \* THIS PROGRAM MAKES FUNCTION 1 AND D CALLS TO GEOSUPPORT USING *
          \* BORO, HOUSENUMBER, & STREET NAME SUPPLIED BY AN INSTREAM FILE.*
          \* FUNCTION 1 RETURNS GEOGRAPHIC INFORMATION FOR AN ADDRESS.     *
          \* FUNCTION D TRANSLATES AN INPUT STREET CODE TO A STREET NAME.  *
          \* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
          \* NOTE: IF THE CROSS STREET NAMES FLAG WERE USED IN THE         *
          \*       ORIGINAL CALL TO FUNCTION 1, ALL THE CROSS STREET NAMES *
          \*       WOULD HAVE BEEN RETURNED BY FUNCTION 1.                 *
          *****************************************************************
          *
          ***********************************************************************
          \*                                                                     *
          \*  This program will do the following:                                *
          \*                                                                     *
          \*     * Read an instream record containing a house number,            *
          \*       street name, and borough code                                 *
          \*                                                                     *
          \*     * Build Work Area 1 for a Function 1 call                       *
          \*                                                                     *
          \*     * Call Function 1                                               *
          \*                                                                     *
          \*     * Get ZIP code, community district, police precinct, school     *
          \*       district, and lists of street codes of streets intersecting   *
          \*       at the low and high ends of the input street address's block. *
          \*       These will be displayed along with the input address which    *
          \*       consists of borough code, house number, and street name.      *
          \*                                                                     *
          \*     * Call Function D to get the street names of the first          *
          \*       intersecting street on both low and high ends.                *
          \*                                                                     *
          \*     * Print the information                                         *
          \*                                                                     *
          \* NOTE that after each Geosupport call, the Return Code is checked.   *
          \*      If it is greater than 01, an error message is printed, and     *
          \*      the next input record, if any, is read.                        *
          \*      If it is 01, a warning message is printed, the input record is *
          \*      processed, and the next record is read.                        *
          \*      If it is zero, the input record is processed, and the next     *
          \*      record is read.                                                *
          \*                                                                     *
          ***********************************************************************
                   SPACE
                   STM   R14,R12,12(R13)   Save caller's registers
                   LR    R3,R15
                   LA    R12,4095(,R3)     (second base register
                   LA    R12,1(,R12)        to accomodate Work Areas 1 and 2)
                   USING ASMC1SRC,R3,R12
          \* Chain save areas
                   LA    R4,MYSAVE
                   ST    R13,4(,R4)    Save caller's savearea address
                   ST    R4,8(,R13)    Save pgm's savearea adr in caller savearea
                   LR    R13,R4        Ensure that R13 points to pgm's savearea
                   SPACE 2
                   XR    R15,R15                 (set OS return code to zero)
          \* Open input and output files
                   OPEN  (INFILE,,OUTFILE,(OUTPUT))
                   TM    INFILE+48,X'10'   Did input file open successfully?
                   BNO   INOPNERR             (no..)
                   TM    OUTFILE+48,X'10'  Did output file open successfully?
                   BNO   OUTOPNER             (no..)
          \* Print page and report header lines
                   SPACE
                   PUT   OUTFILE,HDR1
                   PUT   OUTFILE,HDR2
                   PUT   OUTFILE,HDR3
                   PUT   OUTFILE,HDR4
                   B     NEXTREC
                   SPACE 2
                   TITLE 'READ IN-STREAM INPUT AND PREPARE FUNCTION 1 CALL'
          \* Read (next) input record
          NEXTREC  DS    0H
                   GET   INFILE,INREC
          \* Move input data to output record for display
                   MVC   DBORO,INBORO                   borough code
                   MVC   DHSE(L'INHOUSE),INHOUSE        house number
                   MVC   DSTRT,INSTREET                 street name
                   SPACE
          *****************************************************************
          \* TO MAKE A FUNCTION 1 CALL:                                    *
          \*   (1) INITIALIZE WORKAREA 1 TO SPACES                         *
          \*   (2) SET WA1'S FUNCTION CODE FIELD TO 1                      *
          \*   (3) MOVE THE INPUT BORO TO WA1'S INPUT BORO CODE FIELD      *
          \*   (4) MOVE THE INPUT HOUSE NUMBER TO WA1'S INPUT HOUSE NUMBER *
          \*       FIELD                                                   *
          \*   (5) MOVE THE INPUT STREET TO WA1'S INPUT STREET NAME FIELD  *
          \*   (6) CALL GBI WITH 2 WORKAREAS                               *
          \*   (7) CHECK RETURN CODES FOR ERRORS OR WARNINGS               *
          *****************************************************************
          \* Clear WA1 to blanks
                   LA    R8,P1BAL    "To" address for MVCL
                   LA    R9,P1LENGTH     "To" length
                   XR    R11,R11       for blanking out std WA1,
                   ICM   R11,B'1000',=C' '  rather than moving data
          \* ...since if the "from" length reg. has lo-order zeroes, MVCL will
          \* pad the target area with the pad character of the "from" register
          \* and do nothing else (the "from" address register is not used).
                   MVCL  R8,R10
                   SPACE
          \* Prime Work Area 1 for Function 1 call
                   MVI   P1IPLIND,C'C'                Set Work Area Format to COW
                   MVC   P1IFUNC,=CL2'1 '              Get function code
                   MVC   P1IBORO1,INBORO                   borough code
          *
          \* Note COW - MSW: Display House # - P1IHSE# is a 16-byte field
          \*                                   W1IHSE# is a 12-byte field
          *
                   MVC   P1IHSE#(L'INHOUSE),INHOUSE        house number
                   MVC   P1ISTRT1,INSTREET                 street name
          *

          \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
          \*                                                                     *
          \*        As of Geosupport Version 10.1,                               *
          \*        to receive roadbed-specific information,                     *
          \*        set the Roadbed Request Switch to 'R', as follows:           *
          \*        MVC   P1IRBRQS,C'R'                                          *
          \*                                                                     *
          \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
          *
                   MVC   P1ISNL(L'P1ISNL),=C'25'    Normalized street name length
          \* Call Function 1 (2-Work-Area call)
                   CALL  GBI,(P1BAL,P2BAL),VL
          \* Check Return code
                   CLC   P1ORC(2),=C'00'         Good return?
                   BE    PROCESS                     Yes, process returned data
          \* Handle errors and warnings
          ERREXIT  DS    0H
                   CLC   P1ORC(2),=C'01'         Warning condition?
                   BE    PUTWARN                    Yes, process warning
          \*                                              and then process input;
          \*                                         otherwise, process error
                   MVC   ERINPUT,DSPLYIN    Boro code, hse no., street name
                   MVC   ERFUNC,P1IFUNC              function code
                   MVC   ERRET(L'P1ORC),P1ORC        return code
                   MVC   ERREAS(L'P1OREASN),P1OREASN reason code
                   PUT   OUTFILE,ERR1            Print error messages 1
                   B     PUTMSG                                   and 2
          PUTWARN  DS    0H
                   MVC   WRINPUT,DSPLYIN    Boro code, hse no., street name
                   MVC   WRFUNC,P1IFUNC              function code
                   MVC   WRRET(L'P1ORC),P1ORC        return code
            MVC   WRREAS(L'P1OREASN),P1OREASN reason code
                   PUT   OUTFILE,WRN1            Print warning messages 1
          PUTMSG   DS    0H                                         and 2
                   MVC   ERRWRN(L'P1OERROR),P1OERROR
                   PUT   OUTFILE,ERRWRN2         Print error/warning message 2
                   CLC   P1ORC(2),=C'01'         Warning condition?
                   BNE   NEXTREC                  No, get next record, if any
                   MVI   OINPUT,C' '              Yes,
                   MVC   OINPUT+1(L'OINPUT-1),OINPUT  ensure input NOT displayd
                   MVI   OUTVALID,C' '     ensure single-spacing after warning
                   B     GETZIP            and continue normal processing
                   SPACE
          \* Handle successful Geosupport calls (Return Code <= 01)
          PROCESS  DS    0H
                   MVC   OINPUT,DSPLYIN    Boro code, hse no., street name
                   MVI   OUTVALID,C'0'     Ensure double-spacing
          GETZIP   DS    0H
                   MVC   OZIP,P2F1ZIP      ZIP code
                   MVC   OCOMM,P2F1CDN     community district number
                   MVC   OPCT,P2F1POP      police precinct
                   MVC   OSCHL,P2F1SCH     school district
          ***** At this point, clear WA1 again, call Function D, and move ******
          ***** its reported Low and High Intersecting Street Names to output *
                   TITLE 'GET LOW, HIGH INTERSECTING STREETS, USING FUNCTION D'
                   SPACE 2
          *************************************************************
          \* THIS PROGRAM ASSUMES THERE EXISTS AT LEAST ONE HIGH AND   *
          \* ONE LOW CROSS STREET.  TO GET THE STREET NAMES OF THE     *
          \* FIRST-LISTED HIGH AND FIRST-LISTED LOW CROSS STREETS      *
          \* FROM THE HIGH AND LOW STREET CODE LISTS CALL FUNCTION D:  *
          \*   (1) INITIALIZE WORKAREA 1 TO SPACES                     *
          \*   (2) SET WA1'S FUNCTION CODE FIELD TO D                  *
          \*   (3) SET WA1'S STREET NAME LENGTH FIELD TO DESIRED       *
          \*       VALUE (IN THIS CASE 25 BECAUSE THE REPORT LINE      *
          \*              HAS SPACE FOR ONLY 25 CHARACTERS)            *
          \*   (4) USE THE COMPACT STREET NAMES OPTION TO OBTAIN       *
          \*       STREET NAMES FORMATTED FOR DISPLAY                  *
          \*   (5) MOVE WA2'S LOW B5SC FIELD TO WA1'S INPUT STREET     *
          \*       CODE 1 FIELD                                        *
          \*   (6) MOVE WA2'S HIGH B5SC FIELD TO WA1'S INPUT STREET    *
          \*       CODE 2 FIELD                                        *
          \*   (7) CALL GBI WITH 1 WORKAREA                            *
          \*   (8) CHECK RETURN CODES FOR ERRORS OR WARNINGS           *
          *************************************************************
                   SPACE
          \* Clear WA1 to blanks
                   LA    R8,P1BAL    "To" address for MVCL
                   LA    R9,P1LENGTH     "To" length
                   XR    R11,R11       for blanking out std WA1,
                   ICM   R11,B'1000',=C' '  rather than moving data
          \* ...since if the "from" length reg. has lo-order zeroes, MVCL will
          \* pad the target area with the pad character of the "from" register
          and do nothing else (the "from" address register is not used).
                   MVCL  R8,R10
                   MVI   P1IPLIND,C'C'                Set Work Area Format to COW
          *
          \* Note  COW - MSW: P1ICDEx is the 10-digit street code (no boro)
          \*                  P1IBCDx is the Boro and 10-digit street code
          \*                  W1ICDEx is the packed Boro and 5-digit street code
          \*                  P2F1CDEx is Boro and 5-digit street code list
          \*                  W2F1CDEx is packed Boro and 5-digit street code list
          *
                   MVC   P1IBCD1(6),P2F1CDEL
                   MVC   P1IBCD2(6),P2F1CDEH
                   MVC   P1IFUNC(2),=CL2'D '
                   MVC   P1ISNL(L'P1ISNL),=C'25'    normalized street name length
                   MVI   P1ICMPCT,C'C'              streets to be compacted
                   CALL  GBI,P1BAL,VL   Call Function D
          \* Check Return code
                   CLC   P1ORC(2),=C'00'         Good return?
                   BNE   ERREXIT                     No, error or warning
          \*                                          Yes, complete the record
          \*                                               and write it out
          PUTREC   DS    0H
                   MVC   OLOSTRT,P1OSTRT1
                   MVC   OHISTRT,P1OSTRT2
          \* Print an output record and get the next input record, if any
                   PUT   OUTFILE,OUTVALID
                   B     NEXTREC
          EXIT     DS    0H
          OUTOPNER DS    0H
                   CLOSE (INFILE)
                   TM    OUTFILE+48,X'10'   Did OUTFILE open successfully?
                   BNO   INOPNERR              No, bypass closing it
                   CLOSE (OUTFILE)
          INOPNERR DS    0H
                   L     R13,4(,R13)
                   L     R14,12(,R13)
                   LM    R0,R12,20(R13)
                   BR    R14
                   SPACE 2
          PARAMERR DS    0H       parameter error, missing or invalid
                   LA    R15,8    rc=8
                   B     EXIT
                   TITLE 'DATA SECTION - REGISTER ASSIGNMENTS'
          R0       EQU   0
          R1       EQU   1
          R2       EQU   2
          R3       EQU   3
          R4       EQU   4
          R5       EQU   5
          R6       EQU   6
          R7       EQU   7
          R8       EQU   8
          R9       EQU   9
          R10      EQU   10
          R11      EQU   11
          R12      EQU   12
          R13      EQU   13
          R14      EQU   14
          R15      EQU   15
                   TITLE 'FILE AND RECORD DEFINITIONS'
                   PUSH  PRINT
                   PRINT NOGEN
          INFILE   DCB   DSORG=PS,MACRF=(GM),DDNAME=INFILE,                      *
                         RECFM=FB,LRECL=80,BLKSIZE=400,EODAD=EXIT
                   SPACE
          OUTFILE  DCB   DSORG=PS,MACRF=(PM),DDNAME=SYSPRINT,                    *
                         RECFM=FBA,LRECL=133,BLKSIZE=1330
          *
                   POP PRINT
                   SPACE
          INREC    DS    0CL80              Input record
          INBORO   DS    CL1                    Borough code
          INHOUSE  DS    CL12                   House number
          INSTREET DS    CL32                   Street name
                   DC    35C' '                 filler
                   SPACE
          \* Output records: error, warning, and normal
          ERR1     DS    0CL133
                   DC    C'0'
          ERINPUT  DS    CL48
                   DC    C'*** FUNCTION '
          ERFUNC   DS    CL2
                   DC    C' GRC = '
          ERRET    DS    CL2
                   DC    C' REASON CODE = '
          ERREAS   DS    CL1
                   DC    CL(133-89)' '
                   SPACE
          WRN1     DS    0CL133
                   DC    C'0'
          WRINPUT  DS    CL48
                   DC    C'*** FUNCTION '
          WRFUNC   DS    CL2
                   DC    C' WARNING, GRC = '
          WRRET    DS    CL2
                   DC    C' REASON CODE = '
          WRREAS   DS    CL1
                   DC    CL(133-98)' '
                   SPACE
          ERRWRN2  DS    0CL133
                   DC    C' '
                   DC    48C' '          Boro Code, House Number, Street Name
                   DC    CL4'*** '
          ERRWRN   DS    CL80            Error/Warning message
                   SPACE
          HDR1     DC    CL133'1SAMPLE ASSEMBLER \#1 EXECUTION OUTPUT             *
                                                    '
          HDR2     DC    CL133'0*****---------- INPUT ADDRESS ------------***** \*C
                         ****--------------------- SELECTED OUTPUT ITEMS --------C
                         ----------------------*****'
          HDR3     DC    CL133'0B HOUSE NUMBER IN-STREET-NAME                    *
                          ZIP CD NYPD-PCT SCHLDST LOW CROSS STREET          HIGH *
                         CROSS STREET               '
          HDR4     DC    CL133' - ------------ -------------------------------- -*
                         ---- -- -------- ------- ------------------------- -----*
                         ---------------------------'
          OUTVALID DS    0CL133
          \* Borough code, house number, and street name are from input record
                   DC    C'0'
          OINPUT   DS    CL48
          OZIP     DS    CL5
                   DC    C' '
          OCOMM    DS    CL2
                   DC    C' '
          OPCT     DS    CL3
                   DC    6C' '
          OSCHL    DS    CL2
                   DC    6C' '
          OLOSTRT  DS    CL25  Normalized name of intersecting street at low end
                   DC    C' '
          OHISTRT  DS    CL25  Normalized name of intersecting street at high end
                   DC    7C' '
                   TITLE 'WORKING VARIABLES, VALUES, ETC.'
          MYSAVE   DC    18F'0'
          ***********************************************************************
          ***** USE OF GEOSUPPORT COPY LIBRARIES (REFERENCED BELOW BY THE     ***
          ***** COPY STATEMENTS) IS STRONGLY ENCOURAGED.                      ***
          ***********************************************************************
                   COPY  P1BAL              COPY WORK AREA 1
                   EJECT
                   COPY  P2BAL              COPY WORK AREA 2
                   EJECT
                   SPACE 2
          DSPLYIN  DS    0CL48
          DBORO    DS    CL1
                   DC    C' '
          DHSE     DS    CL12
                   DC    C' '
          DSTRT    DS    CL32
                   DC    C' '
                   SPACE 2
                   TITLE 'CONSTANTS AND LITERAL POOL'
                   SPACE 2
                   LTORG
                   END   ASMC1SRC
          //LKED.SYSIN  DD  *
           INCLUDE INCLIB(GBI)
          /*
          //LKED.INCLIB   DD  DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
          //*                                                            \*//
          //*     AS OF GEOSUPPORT VERSION 10.0,                         \*//
          //*     GEO.SUPPORT.PDSE.LOADLIB AND GEO.SUPPORT.LOADLIB       \*//
          //*     ARE REQUIRED IN THE STEPLIB (OR JOBLIB) OF THE         \*//
          //*     GEOSUPPORT EXECUTION STEP.                             \*//
          //*                                                            \*//
          //GO.STEPLIB  DD  DSN=A030.GEO.SUPPORT.PDSE.LOADLIB,DISP=SHR
          //*           DD  DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
          //*                                                            \*//
          //*   AS OF GEOSUPPORT VERSION 10.0,                           \*//
          //*   DD STATEMENTS ARE NO LONGER USED TO DEFINE?              \*//
          //*   GEOSUPPORT DATA FILES.                                   \*//
          //*   DD STATEMENTS ARE NO LONGER INCLUDED FOR THE             \*//
          //*   GEOSUPPORT FOREGROUND FILES.                             \*//
          //*   TO USE NON-STANDARD FILES, SEE YOUR SYSTEMS PROGRAMMER   \*//
          //*                                                            \*//
          //SYSUDUMP DD  SYSOUT=\*,OUTLIM=2000
          //SYSPRINT DD  SYSOUT=*
          //INFILE   DD  *
          122          READE ST
          1500         DUANE ST
          12-4         BROADWAY
          4165-100     BAISLEY BLVD
          4165-1000    BAISLEY BLVD
          /*
          //

ASSEMBLER SAMPLE PROGRAM #1 –Job Stream-COW

          //ASMC1SRC JOB   YOUR-JOB-CARD-INFORMATION
          //*
          //********************************************************************
          //**  ASSEMBLER SAMPLE BATCH GEOSUPPORT USER APPLICATION PROGRAM \#1 **
          //**                         COW FORMAT                             **
          //********************************************************************
          //STEP1  EXEC  ASMACLG,
          //         PARM.ASM='OBJECT,NODECK',
          //         PARM.LKED='XREF,LET,LIST,NCAL'
          //ASM.SYSLIB DD DSN=A030.GEO.COPYLIB2,DISP=SHR
          //           DD DSN=A030.GEO.COPYLIB,DISP=SHR
          //           DD DSN=SYS1.MACLIB,DISP=SHR
          //ASM.SYSIN  DD *
          ASMC1SRC TITLE 'SAMPLE GEOSUPPORT ASSEMBLER PROGRAM 1 - COW FORMAT'
          ASMC1SRC CSECT
          *****************************************************************
          \* THIS PROGRAM MAKES FUNCTION 1 AND D CALLS TO GEOSUPPORT USING *
          \* BORO, HOUSENUMBER, & STREET NAME SUPPLIED BY AN INSTREAM FILE.*
          \* FUNCTION 1 RETURNS GEOGRAPHIC INFORMATION FOR AN ADDRESS.     *
          \* FUNCTION D TRANSLATES AN INPUT STREET CODE TO A STREET NAME.  *
          \* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
          \* NOTE: IF THE CROSS STREET NAMES FLAG WERE USED IN THE         *
          \*       ORIGINAL CALL TO FUNCTION 1, ALL THE CROSS STREET NAMES *
          \*       WOULD HAVE BEEN RETURNED BY FUNCTION 1.                 *
          *****************************************************************
          *
          ***********************************************************************
          \*                                                                     *
          \*  This program will do the following:                                *
          \*                                                                     *
          \*     * Read an instream record containing a house number,            *
          \*       street name, and borough code                                 *
          \*                                                                     *
          \*     * Build Work Area 1 for a Function 1 call                       *
          \*                                                                     *
          \*     * Call Function 1                                               *
          \*                                                                     *
          \*     * Get ZIP code, community district, police precinct, school     *
          \*       district, and lists of street codes of streets intersecting   *
          \*       at the low and high ends of the input street address's block. *
          \*       These will be displayed along with the input address which    *
          \*       consists of borough code, house number, and street name.      *
          \*                                                                     *
          \*     * Call Function D to get the street names of the first          *
          \*       intersecting street on both low and high ends.                *
          \*                                                                     *
          \*     * Print the information                                         *
          \*                                                                     *
          \* NOTE that after each Geosupport call, the Return Code is checked.   *
          \*      If it is greater than 01, an error message is printed, and     *
          \*      the next input record, if any, is read.                        *
          \*      If it is 01, a warning message is printed, the input record is *
          \*      processed, and the next record is read.                        *
          \*      If it is zero, the input record is processed, and the next     *
          \*      record is read.                                                *
          \*                                                                     *
          ***********************************************************************
                   SPACE
                   STM   R14,R12,12(R13)   Save caller's registers
                   LR    R3,R15
                   LA    R12,4095(,R3)     (second base register
                   LA    R12,1(,R12)        to accomodate Work Areas 1 and 2)
                   USING ASMC1SRC,R3,R12
          \* Chain save areas
                   LA    R4,MYSAVE
                   ST    R13,4(,R4)    Save caller's savearea address
                   ST    R4,8(,R13)    Save pgm's savearea adr in caller savearea
                   LR    R13,R4        Ensure that R13 points to pgm's savearea
                   SPACE 2
                   XR    R15,R15                 (set OS return code to zero)
          \* Open input and output files
                   OPEN  (INFILE,,OUTFILE,(OUTPUT))
                   TM    INFILE+48,X'10'   Did input file open successfully?
                   BNO   INOPNERR             (no..)
                   TM    OUTFILE+48,X'10'  Did output file open successfully?
                   BNO   OUTOPNER             (no..)
          \* Print page and report header lines
                   SPACE
                   PUT   OUTFILE,HDR1
                   PUT   OUTFILE,HDR2
                   PUT   OUTFILE,HDR3
                   PUT   OUTFILE,HDR4
                   B     NEXTREC
                   SPACE 2
                   TITLE 'READ IN-STREAM INPUT AND PREPARE FUNCTION 1 CALL'
          \* Read (next) input record
          NEXTREC  DS    0H
                   GET   INFILE,INREC
          \* Move input data to output record for display
                   MVC   DBORO,INBORO                   borough code
                   MVC   DHSE(L'INHOUSE),INHOUSE        house number
                   MVC   DSTRT,INSTREET                 street name
                   SPACE
          *****************************************************************
          \* TO MAKE A FUNCTION 1 CALL:                                    *
          \*   (1) INITIALIZE WORKAREA 1 TO SPACES                         *
          \*   (2) SET WA1'S FUNCTION CODE FIELD TO 1                      *
          \*   (3) MOVE THE INPUT BORO TO WA1'S INPUT BORO CODE FIELD      *
          \*   (4) MOVE THE INPUT HOUSE NUMBER TO WA1'S INPUT HOUSE NUMBER *
          \*       FIELD                                                   *
          \*   (5) MOVE THE INPUT STREET TO WA1'S INPUT STREET NAME FIELD  *
          \*   (6) CALL GBI WITH 2 WORKAREAS                               *
          \*   (7) CHECK RETURN CODES FOR ERRORS OR WARNINGS               *
          *****************************************************************
          \* Clear WA1 to blanks
                   LA    R8,P1BAL    "To" address for MVCL
                   LA    R9,P1LENGTH     "To" length
                   XR    R11,R11       for blanking out std WA1,
                   ICM   R11,B'1000',=C' '  rather than moving data
          \* ...since if the "from" length reg. has lo-order zeroes, MVCL will
          \* pad the target area with the pad character of the "from" register
          \* and do nothing else (the "from" address register is not used).
                   MVCL  R8,R10
                   SPACE
          \* Prime Work Area 1 for Function 1 call
                   MVI   P1IPLIND,C'C'                Set Work Area Format to COW
                   MVC   P1IFUNC,=CL2'1 '              Get function code
                   MVC   P1IBORO1,INBORO                   borough code
          *
          \* Note COW - MSW: Display House # - P1IHSE# is a 16-byte field
          \*                                   W1IHSE# is a 12-byte field
          *
                   MVC   P1IHSE#(L'INHOUSE),INHOUSE        house number
                   MVC   P1ISTRT1,INSTREET                 street name
          *

          \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
          \*                                                                     *
          \*        As of Geosupport Version 10.1,                               *
          \*        to receive roadbed-specific information,                     *
          \*        set the Roadbed Request Switch to 'R', as follows:           *
          \*        MVC   P1IRBRQS,C'R'                                          *
          \*                                                                     *
          \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
          *
                   MVC   P1ISNL(L'P1ISNL),=C'25'    Normalized street name length
          \* Call Function 1 (2-Work-Area call)
                   CALL  GBI,(P1BAL,P2BAL),VL
          \* Check Return code
                   CLC   P1ORC(2),=C'00'         Good return?
                   BE    PROCESS                     Yes, process returned data
          \* Handle errors and warnings
          ERREXIT  DS    0H
                   CLC   P1ORC(2),=C'01'         Warning condition?
                   BE    PUTWARN                    Yes, process warning
          \*                                              and then process input;
          \*                                         otherwise, process error
                   MVC   ERINPUT,DSPLYIN    Boro code, hse no., street name
                   MVC   ERFUNC,P1IFUNC              function code
                   MVC   ERRET(L'P1ORC),P1ORC        return code
                   MVC   ERREAS(L'P1OREASN),P1OREASN reason code
                   PUT   OUTFILE,ERR1            Print error messages 1
                   B     PUTMSG                                   and 2
          PUTWARN  DS    0H
                   MVC   WRINPUT,DSPLYIN    Boro code, hse no., street name
                   MVC   WRFUNC,P1IFUNC              function code
                   MVC   WRRET(L'P1ORC),P1ORC        return code
            MVC   WRREAS(L'P1OREASN),P1OREASN reason code
                   PUT   OUTFILE,WRN1            Print warning messages 1
          PUTMSG   DS    0H                                         and 2
                   MVC   ERRWRN(L'P1OERROR),P1OERROR
                   PUT   OUTFILE,ERRWRN2         Print error/warning message 2
                   CLC   P1ORC(2),=C'01'         Warning condition?
                   BNE   NEXTREC                  No, get next record, if any
                   MVI   OINPUT,C' '              Yes,
                   MVC   OINPUT+1(L'OINPUT-1),OINPUT  ensure input NOT displayd
                   MVI   OUTVALID,C' '     ensure single-spacing after warning
                   B     GETZIP            and continue normal processing
                   SPACE
          \* Handle successful Geosupport calls (Return Code <= 01)
          PROCESS  DS    0H
                   MVC   OINPUT,DSPLYIN    Boro code, hse no., street name
                   MVI   OUTVALID,C'0'     Ensure double-spacing
          GETZIP   DS    0H
                   MVC   OZIP,P2F1ZIP      ZIP code
                   MVC   OCOMM,P2F1CDN     community district number
                   MVC   OPCT,P2F1POP      police precinct
                   MVC   OSCHL,P2F1SCH     school district
          ***** At this point, clear WA1 again, call Function D, and move ******
          ***** its reported Low and High Intersecting Street Names to output *
                   TITLE 'GET LOW, HIGH INTERSECTING STREETS, USING FUNCTION D'
                   SPACE 2
          *************************************************************
          \* THIS PROGRAM ASSUMES THERE EXISTS AT LEAST ONE HIGH AND   *
          \* ONE LOW CROSS STREET.  TO GET THE STREET NAMES OF THE     *
          \* FIRST-LISTED HIGH AND FIRST-LISTED LOW CROSS STREETS      *
          \* FROM THE HIGH AND LOW STREET CODE LISTS CALL FUNCTION D:  *
          \*   (1) INITIALIZE WORKAREA 1 TO SPACES                     *
          \*   (2) SET WA1'S FUNCTION CODE FIELD TO D                  *
          \*   (3) SET WA1'S STREET NAME LENGTH FIELD TO DESIRED       *
          \*       VALUE (IN THIS CASE 25 BECAUSE THE REPORT LINE      *
          \*              HAS SPACE FOR ONLY 25 CHARACTERS)            *
          \*   (4) USE THE COMPACT STREET NAMES OPTION TO OBTAIN       *
          \*       STREET NAMES FORMATTED FOR DISPLAY                  *
          \*   (5) MOVE WA2'S LOW B5SC FIELD TO WA1'S INPUT STREET     *
          \*       CODE 1 FIELD                                        *
          \*   (6) MOVE WA2'S HIGH B5SC FIELD TO WA1'S INPUT STREET    *
          \*       CODE 2 FIELD                                        *
          \*   (7) CALL GBI WITH 1 WORKAREA                            *
          \*   (8) CHECK RETURN CODES FOR ERRORS OR WARNINGS           *
          *************************************************************
                   SPACE
          \* Clear WA1 to blanks
                   LA    R8,P1BAL    "To" address for MVCL
                   LA    R9,P1LENGTH     "To" length
                   XR    R11,R11       for blanking out std WA1,
                   ICM   R11,B'1000',=C' '  rather than moving data
          \* ...since if the "from" length reg. has lo-order zeroes, MVCL will
          \* pad the target area with the pad character of the "from" register
          and do nothing else (the "from" address register is not used).
                   MVCL  R8,R10
                   MVI   P1IPLIND,C'C'                Set Work Area Format to COW
          *
          \* Note  COW - MSW: P1ICDEx is the 10-digit street code (no boro)
          \*                  P1IBCDx is the Boro and 10-digit street code
          \*                  W1ICDEx is the packed Boro and 5-digit street code
          \*                  P2F1CDEx is Boro and 5-digit street code list
          \*                  W2F1CDEx is packed Boro and 5-digit street code list
          *
                   MVC   P1IBCD1(6),P2F1CDEL
                   MVC   P1IBCD2(6),P2F1CDEH
                   MVC   P1IFUNC(2),=CL2'D '
                   MVC   P1ISNL(L'P1ISNL),=C'25'    normalized street name length
                   MVI   P1ICMPCT,C'C'              streets to be compacted
                   CALL  GBI,P1BAL,VL   Call Function D
          \* Check Return code
                   CLC   P1ORC(2),=C'00'         Good return?
                   BNE   ERREXIT                     No, error or warning
          \*                                          Yes, complete the record
          \*                                               and write it out
          PUTREC   DS    0H
                   MVC   OLOSTRT,P1OSTRT1
                   MVC   OHISTRT,P1OSTRT2
          \* Print an output record and get the next input record, if any
                   PUT   OUTFILE,OUTVALID
                   B     NEXTREC
          EXIT     DS    0H
          OUTOPNER DS    0H
                   CLOSE (INFILE)
                   TM    OUTFILE+48,X'10'   Did OUTFILE open successfully?
                   BNO   INOPNERR              No, bypass closing it
                   CLOSE (OUTFILE)
          INOPNERR DS    0H
                   L     R13,4(,R13)
                   L     R14,12(,R13)
                   LM    R0,R12,20(R13)
                   BR    R14
                   SPACE 2
          PARAMERR DS    0H       parameter error, missing or invalid
                   LA    R15,8    rc=8
                   B     EXIT
                   TITLE 'DATA SECTION - REGISTER ASSIGNMENTS'
          R0       EQU   0
          R1       EQU   1
          R2       EQU   2
          R3       EQU   3
          R4       EQU   4
          R5       EQU   5
          R6       EQU   6
          R7       EQU   7
          R8       EQU   8
          R9       EQU   9
          R10      EQU   10
          R11      EQU   11
          R12      EQU   12
          R13      EQU   13
          R14      EQU   14
          R15      EQU   15
                   TITLE 'FILE AND RECORD DEFINITIONS'
                   PUSH  PRINT
                   PRINT NOGEN
          INFILE   DCB   DSORG=PS,MACRF=(GM),DDNAME=INFILE,                      *
                         RECFM=FB,LRECL=80,BLKSIZE=400,EODAD=EXIT
                   SPACE
          OUTFILE  DCB   DSORG=PS,MACRF=(PM),DDNAME=SYSPRINT,                    *
                         RECFM=FBA,LRECL=133,BLKSIZE=1330
          *
                   POP PRINT
                   SPACE
          INREC    DS    0CL80              Input record
          INBORO   DS    CL1                    Borough code
          INHOUSE  DS    CL12                   House number
          INSTREET DS    CL32                   Street name
                   DC    35C' '                 filler
                   SPACE
          \* Output records: error, warning, and normal
          ERR1     DS    0CL133
                   DC    C'0'
          ERINPUT  DS    CL48
                   DC    C'*** FUNCTION '
          ERFUNC   DS    CL2
                   DC    C' GRC = '
          ERRET    DS    CL2
                   DC    C' REASON CODE = '
          ERREAS   DS    CL1
                   DC    CL(133-89)' '
                   SPACE
          WRN1     DS    0CL133
                   DC    C'0'
          WRINPUT  DS    CL48
                   DC    C'*** FUNCTION '
          WRFUNC   DS    CL2
                   DC    C' WARNING, GRC = '
          WRRET    DS    CL2
                   DC    C' REASON CODE = '
          WRREAS   DS    CL1
                   DC    CL(133-98)' '
                   SPACE
          ERRWRN2  DS    0CL133
                   DC    C' '
                   DC    48C' '          Boro Code, House Number, Street Name
                   DC    CL4'*** '
          ERRWRN   DS    CL80            Error/Warning message
                   SPACE
          HDR1     DC    CL133'1SAMPLE ASSEMBLER \#1 EXECUTION OUTPUT             *
                                                    '
          HDR2     DC    CL133'0*****---------- INPUT ADDRESS ------------***** \*C
                         ****--------------------- SELECTED OUTPUT ITEMS --------C
                         ----------------------*****'
          HDR3     DC    CL133'0B HOUSE NUMBER IN-STREET-NAME                    *
                          ZIP CD NYPD-PCT SCHLDST LOW CROSS STREET          HIGH *
                         CROSS STREET               '
          HDR4     DC    CL133' - ------------ -------------------------------- -*
                         ---- -- -------- ------- ------------------------- -----*
                         ---------------------------'
          OUTVALID DS    0CL133
          \* Borough code, house number, and street name are from input record
                   DC    C'0'
          OINPUT   DS    CL48
          OZIP     DS    CL5
                   DC    C' '
          OCOMM    DS    CL2
                   DC    C' '
          OPCT     DS    CL3
                   DC    6C' '
          OSCHL    DS    CL2
                   DC    6C' '
          OLOSTRT  DS    CL25  Normalized name of intersecting street at low end
                   DC    C' '
          OHISTRT  DS    CL25  Normalized name of intersecting street at high end
                   DC    7C' '
                   TITLE 'WORKING VARIABLES, VALUES, ETC.'
          MYSAVE   DC    18F'0'
          ***********************************************************************
          ***** USE OF GEOSUPPORT COPY LIBRARIES (REFERENCED BELOW BY THE     ***
          ***** COPY STATEMENTS) IS STRONGLY ENCOURAGED.                      ***
          ***********************************************************************
                   COPY  P1BAL              COPY WORK AREA 1
                   EJECT
                   COPY  P2BAL              COPY WORK AREA 2
                   EJECT
                   SPACE 2
          DSPLYIN  DS    0CL48
          DBORO    DS    CL1
                   DC    C' '
          DHSE     DS    CL12
                   DC    C' '
          DSTRT    DS    CL32
                   DC    C' '
                   SPACE 2
                   TITLE 'CONSTANTS AND LITERAL POOL'
                   SPACE 2
                   LTORG
                   END   ASMC1SRC
          //LKED.SYSIN  DD  *
           INCLUDE INCLIB(GBI)
          /*
          //LKED.INCLIB   DD  DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
          //*                                                            \*//
          //*     AS OF GEOSUPPORT VERSION 10.0,                         \*//
          //*     GEO.SUPPORT.PDSE.LOADLIB AND GEO.SUPPORT.LOADLIB       \*//
          //*     ARE REQUIRED IN THE STEPLIB (OR JOBLIB) OF THE         \*//
          //*     GEOSUPPORT EXECUTION STEP.                             \*//
          //*                                                            \*//
          //GO.STEPLIB  DD  DSN=A030.GEO.SUPPORT.PDSE.LOADLIB,DISP=SHR
          //*           DD  DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
          //*                                                            \*//
          //*   AS OF GEOSUPPORT VERSION 10.0,                           \*//
          //*   DD STATEMENTS ARE NO LONGER USED TO DEFINE?              \*//
          //*   GEOSUPPORT DATA FILES.                                   \*//
          //*   DD STATEMENTS ARE NO LONGER INCLUDED FOR THE             \*//
          //*   GEOSUPPORT FOREGROUND FILES.                             \*//
          //*   TO USE NON-STANDARD FILES, SEE YOUR SYSTEMS PROGRAMMER   \*//
          //*                                                            \*//
          //SYSUDUMP DD  SYSOUT=\*,OUTLIM=2000
          //SYSPRINT DD  SYSOUT=*
          //INFILE   DD  *
          122          READE ST
          1500         DUANE ST
          12-4         BROADWAY
          4165-100     BAISLEY BLVD
          4165-1000    BAISLEY BLVD
          /*
          //

SAMPLE ASSEMBLER #1 EXECUTION OUTPUT

          *****---------- INPUT ADDRESS ------------***** *****--------------------- SELECTED OUTPUT ITEMS ----------------*****

           B HOUSE NUMBER IN-STREET-NAME                     ZIP CD NYPD-PCT SCHLDST LOW CROSS STREET          HIGH CROSS STREET
           - ------------ -------------------------------- ----- -- -------- ------- ------------------------- ------------------

           1 22           READE ST                         10007 01 005      02      ELK STREET                BROADWAY

           1 500          DUANE ST                         *** FUNCTION 1  GRC = 42 REASON CODE =
                                                           *** ADDRESS NUMBER OUT OF RANGE

           1 2-4          BROADWAY                         *** FUNCTION 1  WARNING, GRC = 01 REASON CODE = 1
                                                           *** ADDR NUMBER ALTERED: RANGE ASSUMED. USING DIGITS BEFORE DASH ONLY
                                                           10004 01 001      02      STONE STREET              BOWLING GREEN

           4 165-100      BAISLEY BLVD                     11434 12 113      28      GUY R BREWER BOULEVARD    BEDELL STREET

           4 165-1000     BAISLEY BLVD                     *** FUNCTION 1  GRC = 13 REASON CODE = 2
                                                           *** ADDRESS NBR 165-1000  HAS MORE THAN 3 DIGITS AFTER THE DASH.

ASSEMBLER SAMPLE PROGRAM #1

- Input Job Stream - MSW
- Input Job Stream - COW
- Output Report

ASSEMBLER SAMPLE PROGRAM #2- Job Stream -MSW

            //ASMF2SRC JOB   YOUR-JOB-CARD-INFORMATION
            //*
            //********************************************************************
            //**  ASSEMBLER SAMPLE BATCH GEOSUPPORT USER APPLICATION PROGRAM \#2 **
            //**                           MSW FORMAT                           **
            //********************************************************************
            //STEP1  EXEC  ASMACLG,
            //         PARM.ASM='OBJECT,NODECK',
            //         PARM.LKED='XREF,LET,LIST,NCAL'
            //ASM.SYSLIB DD DSN=A030.GEO.COPYLIB2,DISP=SHR
            //           DD DSN=A030.GEO.COPYLIB,DISP=SHR
            //           DD DSN=SYS1.MACLIB,DISP=SHR
            //ASM.SYSIN  DD *
            ASMF2SRC TITLE 'SAMPLE GEOSUPPORT ASSEMBLER PROGRAM 2 - MSW FORMAT'
            ASMF2SRC CSECT
            ******************************************************************
            \* THIS PROGRAM MAKES FUNCTION 2 AND D CALLS TO GEOSUPPORT USING  *
            \* TWO BOROS AND TWO STREET NAMES SUPPLIED BY AN INSTREAM FILE.   *
            \* FUNCTION 2 RETURNS GEOGRAPHIC INFORMATION FOR AN INTERSECTION. *
            \* FUNCTION D TRANSLATES AN INPUT STREET CODE TO A STREET NAME.   *
            \* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  *
            \* NOTE: IF THE CROSS STREET NAMES FLAG WERE USED IN THE          *
            \*       ORIGINAL CALL TO FUNCTION 2, ALL THE CROSS STREET NAMES  *
            \*       WOULD HAVE BEEN RETURNED BY FUNCTION 2.                  *
            ******************************************************************
            *
            ***********************************************************************
            \*                                                                     *
            \*  This program will do the following:                                *
            \*     * Read an instream record containing 2 borough codes            *
            \*       and two street names                                          *
            \*                                                                     *
            \*     * Build Work Area 1 for a Function 2 call                       *
            \*                                                                     *
            \*     * Call Function 2                                               *
            \*                                                                     *
            \*     * Get ZIP code, community district, police precinct, school     *
            \*       district, and lists of intersecting street codes.             *
            \*       These will be displayed along with the input intersection     *
            \*       which consists of 2 borough codes, and 2 street names.        *
            \*                                                                     *
            \*     * Call Function D to get the street names of all intersecting   *
            \*       streets.                                                      *
            \*                                                                     *
            \*      If it is greater than 01, an error message is printed, and     *
            \*      the next input record, if any, is read.                        *
            \*      If it is 01, a warning message is printed, the input record is *
            \*      processed, and the next record is read.                        *
            \*      If it is zero, the input record is processed, and the next     *
            \*      record is read.                                                *
            \*                                                                     *
            ***********************************************************************
             SPACE
                     STM   R14,R12,12(R13)   Save caller's registers
                     LR    R3,R15
                     LA    R12,4095(,R3)     (second base register
                     LA    R12,1(,R12)        to accommodate Work Areas 1 and 2)
                     USING ASMF2SRC,R3,R12
            \* Chain save areas
                     LA    R4,MYSAVE
                     ST    R13,4(,R4)    Save caller's savearea address
                     ST    R4,8(,R13)    Save pgm's savearea adr in caller savearea
                     LR    R13,R4        Ensure that R13 points to pgm's savearea
                     SPACE 2
                     XR    R15,R15                 (set OS return code to zero)
            \* Open input and output files
                     OPEN  (INFILE,,OUTFILE,(OUTPUT))
                     TM    INFILE+48,X'10'   Did input file open successfully?
                     BNO   INOPNERR             (no..)
                     TM    OUTFILE+48,X'10'  Did output file open successfully?
                     BNO   OUTOPNER             (no..)
            \* Print report header lines
                     SPACE
                     PUT   OUTFILE,HDR1
                     PUT   OUTFILE,HDR2
                     PUT   OUTFILE,HDR3
                     PUT   OUTFILE,HDR4
                     B     NEXTREC
                     SPACE 2
                     TITLE 'READ IN-STREAM INPUT AND PREPARE FUNCTION 2 CALL'
            \* Read (next) input record
            NEXTREC  DS    0H
                     GET   INFILE,INREC
            \* Move input data to output record for display
                     MVC   DBORO1,INBORO1          First borough code
                     MVC   DSTRT1,INSTRT1          First street name
                     MVC   DBORO2,INBORO2          Second borough code
                     MVC   DSTRT2,INSTRT2          Second street name
                     SPACE
            ******************************************************************
            \* TO MAKE A FUNCTION 2 CALL:                                     *
            \*   (1) INITIALIZE WORKAREA 1 TO SPACES                          *
            \*   (2) SET WA1'S FUNCTION CODE FIELD TO 2                       *
            \*   (3) MOVE THE 1ST INPUT BORO TO WA1'S INPUT BORO CODE FIELD   *
            \*   (4) MOVE THE 1ST INPUT STREET TO WA1'S INPUT STREET NAME     *
            \*   (5) MOVE THE 2ND INPUT BORO TO WA1'S INPUT BORO CODE 2 FIELD *
            \*   (6) MOVE THE 2ND INPUT STREET TO WA1'S INPUT STREET NAME 2   *
            \*   (7) CALL GBI WITH 2 WORKAREAS                                *
            \*   (8) CHECK RETURN CODES FOR ERRORS OR WARNINGS                *
            ******************************************************************
            \* Clear WA1 to blanks
                     LA    R8,W1BAL    "To" address for MVCL
                     LA    R9,W1LENGTH     "To" length
                     XR    R11,R11       for blanking out std WA1,
                     ICM   R11,B'1000',=C' '  rather than moving data
            \* ...since if the "from" length reg. has lo-order zeroes, MVCL will
            \* pad the target area with the pad character of the "from" register
            \* and do nothing else (the "from" address register is not used).
                     MVCL  R8,R10
                     SPACE
            \* Prime Work Area 1 for Function 2 call
                     MVC   W1IFUNC,=CL2'2 '              Get function code
                     MVC   W1IBORO1,INBORO1                  borough code 1
                     MVC   W1ISTRT1,INSTRT1                  street name  1
                     MVC   W1IBORO2,INBORO2                  borough code 2
                     MVC   W1ISTRT2,INSTRT2                  street name  2
                     MVC   W1ISNL(L'W1ISNL),=C'25'    Normalized street name length
            \* Call Function 2 (2-Work-Area call)
                     CALL  GBI,(W1BAL,W2BAL),VL
            \* Check Return code
                     CLC   W1ORC(2),=C'00'         Good return?
                     BE    PROCESS                     Yes, process returned data
            \* Handle errors and warnings
            ERREXIT  DS    0H
                     CLC   W1ORC(2),=C'01'         Warning condition?
                     BE    PUTWARN                    Yes, process warning
            \*                                              and then process input;
            \*                                         otherwise, process error
                     MVC   ERFUNC,W1IFUNC              function code
                     MVC   ERRET(L'W1ORC),W1ORC        return code
                     MVC   ERREAS(L'W1OREASN),W1OREASN reason code
                     MVC   ERRMSG(L'W1OERROR),W1OERROR Geosupport error message
                     PUT   OUTFILE,ERR1            Print error message 1
                     MVC   ERINPUT,DSPLYIN    2 boro codes and 2 street names
                     PUT   OUTFILE,ERR2            Print error message 2
                     B     NEXTREC
            PUTWARN  DS    0H
                     MVC   WRFUNC,W1IFUNC              function code
                     MVC   WRRET(L'W1ORC),W1ORC        return code
                     MVC   WRREAS(L'W1OREASN),W1OREASN reason code
                     MVC   WRNMSG(L'W1OERROR),W1OERROR Geosupport warning message
                     PUT   OUTFILE,WARN            Print warning message
                     SPACE
            \* Handle successful Geosupport calls (Return Code <= 01)
            PROCESS  DS    0H
                     MVI   OUTFIXED,C'0'      Init. carriage control to dbl-space
                     CLC   W1ORC(2),=C'01'    Was a warning issued?
                     BNE   MOVEOUT               No..
                     MVI   OUTFIXED,C' '         Yes, single-space output instead
            MOVEOUT  DS    0H
                     MVC   OINPUT,DSPLYIN    Pair of boro codes and street names
                     MVC   OZIP,W2F2ZIP      ZIP code
                     MVC   OCOMM,W2F2CDN     community district number
                     MVC   OPCT,W2F2POP      police precinct
                     MVC   OSCHL,W2F2SCH     school district
            ***** At this point, clear WA1 again, call Function D, and move ******
            ***** all reported Intersecting Street Names to output          ******
                     TITLE 'GET INTERSECTING STREET NAMES, USING FUNCTION D'
                     SPACE 2
            *************************************************************
            \* TO GET THE STREET NAMES FOR INTERSECTING STREET CODES     *
            \* MAKE A FUNCTION D CALL:                                   *
            \*   (1) INITIALIZE WORKAREA 1 TO SPACES                     *
            \*   (2) SET THE WA1'S FUNCTION CODE FIELD TO D              *
            \*   (3) USE THE COMPACT STREET NAMES OPTION TO OBTAIN       *
            \*       STREET NAMES FORMATTED FOR DISPLAY                  *
            \*   (4) MOVE THE PACKED BORO AND STREET CODE TO             *
            \*       WA1'S INPUT STREET CODE 1 FIELD                     *
            \*   (5) CALL GBI WITH 1 WORKAREA                            *
            \*   (6) CHECK RETURN CODES FOR ERRORS OR WARNINGS           *
            *************************************************************
                     SPACE
            \* For each street code of intersecting streets, including those input,
            \* call Function D to get the corresponding street name
                     XR    R4,R4
                     MVC   INTWK,W2F2#INT   get count of intersecting streets.
                     NI    INTWK,X'0F'      remove zone, leaving numeric
                     IC    R4,INTWK         count of intersecting streets.
                     LA    R5,W2F2CODE      point to street code(s).
                     SPACE
            INTRLOOP DS    0H
            \* Clear WA1 to blanks
                     LA    R8,W1BAL    "To" address for MVCL
                     LA    R9,W1LENGTH     "To" length
                     XR    R11,R11       for blanking out std WA1,
                     ICM   R11,B'1000',=C' '  rather than moving data
            \* ...since if the "from" length reg. has lo-order zeroes, MVCL will
            \* pad the target area with the pad character of the "from" register
            \* and do nothing else (the "from" address register is not used).
                     MVCL  R8,R10
                     SPACE
                     MVC   W1IFUNC(2),=CL2'D '
                     MVC   W1ISNL(L'W1ISNL),=C'25'    normalized street name length
                     MVI   W1ICMPCT,C'C'              streets to be compacted
                     MVC   W1ICDE1(L'W1ICDE1),0(R5)   Intersecting street code
                     CALL  GBI,W1BAL,VL   Call Function D
            \* Check Return code
                     CLC   W1ORC(2),=C'00'         Good return?
                     BNE   ERREXIT                     No, error or warning
            \*                                          Yes, complete the record
            \*                                               and write it out
            PFIX     NOP   PVAR
                     OI    PFIX+1,X'F0'
                     MVC   OINTRSC1,W1OSTRT1
            \*  put out the initial output including the first intersecting street
                     PUT   OUTFILE,OUTFIXED
                     B     NEXTSC     Now get the rest of the street codes, if any
            PVAR     DS    0H
                    MVC   OINTRSCN,W1OSTRT1
            \* Print an output record and get the next intersecting street, if any
                     PUT   OUTFILE,OUTVAR
            NEXTSC   DS    0H
                     LA    R5,4(,R5)    point to next intersecting street code
                     BCT   R4,INTRLOOP  if any, and process it;
                     NI    PFIX+1,X'0F'    reset 1st-time (fixed/variable) switch
                     B     NEXTREC      then, process next input record, if any
                     SPACE
            EXIT     DS    0H
            OUTOPNER DS    0H
                     CLOSE (INFILE)
                     TM    OUTFILE+48,X'10'   Did OUTFILE open successfully?
                     BNO   INOPNERR              No, bypass closing it
                     CLOSE (OUTFILE)
            INOPNERR DS    0H
                     L     R13,4(,R13)
                     L     R14,12(,R13)
                     LM    R0,R12,20(R13)
                     BR    R14
            SPACE 2
            PARAMERR DS    0H       parameter error, missing or invalid
                     LA    R15,8    rc=8
                     B     EXIT
                     TITLE 'DATA SECTION - REGISTER ASSIGNMENTS'
            R0       EQU   0
            R1       EQU   1
            R2       EQU   2
            R3       EQU   3
            R4       EQU   4
            R5       EQU   5
            R6       EQU   6
            R7       EQU   7
            R8       EQU   8
            R9       EQU   9
            R10      EQU   10
            R11      EQU   11
            R12      EQU   12
            R13      EQU   13
            R14      EQU   14
            R15      EQU   15
                     TITLE 'FILE AND RECORD DEFINITIONS'
                     PUSH  PRINT
                     PRINT NOGEN
            INFILE   DCB   DSORG=PS,MACRF=(GM),DDNAME=INFILE,                      *
                           RECFM=FB,LRECL=80,BLKSIZE=400,EODAD=EXIT
                     SPACE
            OUTFILE  DCB   DSORG=PS,MACRF=(PM),DDNAME=SYSPRINT,                    *
                           RECFM=FBA,LRECL=133,BLKSIZE=1330
            *
                     POP PRINT
                     SPACE
            INREC    DS    0CL80              Input record
            INBORO1  DS    CL1                    First borough code
            INSTRT1  DS    CL32                   First street name
            INBORO2  DS    CL1                    Second borough code
            INSTRT2  DS    CL32                   Second street name
                     DC    14C' '                 filler
                     SPACE
            \* Output records: header, normal, warning, and error

                     SPACE
            \* header records
            HDR1     DC    CL133'1SAMPLE ASSEMBLER \#2 EXECUTION OUTPUT             *
                                                                                   *
                                                      '
            HDR2     DC    CL133'0*****----------------- INPUT INTERSECTION -------C
                           --------------***** *****--------------- SELECTED OUTPUT*
                            ITEMS ---------------*****'
            HDR3     DC    CL133'0B IN-STREET-NAME-1                 B IN-STREET-NA*
                           ME-2                  ZIP CD NYPD-PCT SCHLDST INTERSECTI*
                           NG STREET NAMES            '
            HDR4     DC    CL133' - -------------------------------- - ------------*
                           ------------------- ----- -- -------- ------- ----------*
                           ---------------------------'
                     SPACE
            \* normal records, i.e., output for valid data
            OUTFIXED DS    0CL133                Fixed output
            \* Borough codes and street names for each of 2 streets are from input
                     DC    C'0'
            OINPUT   DS    CL69
            OZIP     DS    CL5
                     DC    C' '
            OCOMM    DS    CL2
                     DC    C' '
            OPCT     DS    CL3
                     DC    6C' '
            OSCHL    DS    CL2
                     DC    6C' '
            OINTRSC1 DS    CL25  Normalized name of first intersecting street
                     SPACE
            OUTVAR   DS    0CL133 Output line repeated per No. of Intersecting Sts.
                     DC    C' '
                     DC    95C' '
            OINTRSCN DS    CL25  Normalized name of additional intersecting street
                     DC    (133-121)C' '
                     SPACE
            \* warning record
            WARN     DS    0CL133
                     DC    C'0'
                     DC    C'**** FUNCTION '
            WRFUNC   DS    CL2
                     DC    C' WARNING, GRC = '
            WRRET    DS    CL2
                     DC    C' REASON CODE = '
            WRREAS   DS    CL1
                     DC    C'. '
            WRNMSG   DS    CL80            Warning message
                     SPACE
            \* error records
            ERR1     DS    0CL133
                     DC    C'0'
                     DC    C'***** FUNCTION '
            ERFUNC   DS    CL2
                     DC    C' GRC = '
            ERRET    DS    CL2
                     DC    C' REASON = '
            ERREAS   DS    CL1
                     DC    C'. '
            ERRMSG   DS    CL80            Error message
                     DC    CL(133-120)' '
                     SPACE
            ERR2     DS    0CL133
                     DC    C' '
            ERINPUT  DS    CL69
                     DC    CL(133-70)' '
                     TITLE 'WORKING VARIABLES, VALUES, ETC.'
            #INTER   DS    D        Working field for no. of intersecting streets
            MYSAVE   DC    18F'0'
            ***********************************************************************
            ***** USE OF GEOSUPPORT COPY LIBRARIES (REFERENCED BELOW BY THE     ***
            ***** COPY STATEMENTS) IS STRONGLY ENCOURAGED.                      ***
            ***********************************************************************
                     COPY  W1BAL              COPY WORK AREA 1
                     EJECT
                     COPY  W2BAL              COPY WORK AREA 2
                     EJECT
                     SPACE 2
            DSPLYIN  DS    0CL69
            DBORO1   DS    CL1
                     DC    C' '
            DSTRT1   DS    CL32
                     DC    C' '
            DBORO2   DS    CL1
                     DC    C' '
            DSTRT2   DS    CL32
                     SPACE 2
            INTWK    DS    XL1      work field for number of intersecting streets
                     TITLE 'CONSTANTS AND LITERAL POOL'
                     SPACE 2
                     LTORG
                     END   ASMF2SRC
            //LKED.SYSIN  DD  *
             INCLUDE INCLIB(GBI)
            /*
            //LKED.INCLIB   DD  DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
            //*                                                             \*//
            //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
            //*                                                             \*//
            //*  AS OF GEOSUPPORT VERSION 10.0,                             \*//
            //*  THE STEPLIB (OR JOBLIB) OF THE GEOSUPPORT EXECUTION STEP   \*//
            //*  MUST INCLUDE THE FOLLOWING TWO CONCATENATED DATASETS:      \*//
            //*       A030.GEO.SUPPORT.PDSE.LOADLIB                         \*//
            //*       A030.GEO.SUPPORT.LOADLIB                              \*//
            //*                                                             \*//
            //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
            //GO.STEPLIB DD DSN=A030.GEO.SUPPORT.PDSE.LOADLIB,DISP=SHR
            //           DD DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
            //*
            //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
            //*                                                             \*//
            //*   AS OF GEOSUPPORT VERSION 10.0,                            \*//
            //*   DD STATEMENTS FOR GEOSUPPORT DATA FILES (E.G. GRID, PAD,  \*//
            //*   ETC) ARE NO LONGER NEEDED AND ARE IGNORED. GEOSUPPORT     \*//
            //*   IS TAILORED TO USE STANDARD GEOSUPPORT DATA SET NAMES.    \*//
            //*   TO USE NON-STANDARD FILES, SEE YOUR SYSTEMS PROGRAMMER.   \*//
            //*                                                             \*//
            //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
            //*
            //SYSUDUMP DD  SYSOUT=\*,OUTLIM=2000
            //SYSPRINT DD  SYSOUT=*
            //INFILE   DD  *
            1CHAMBERS ST                     1HUDSON ST
            1SIXTH AVE                       1W. 8 ST
            1DUANE ST                        1READE ST
            /*
            //

ASSEMBLER SAMPLE PROGRAM #2- Job Stream - COW

            //ASMC2SRC JOB   YOUR-JOB-CARD-INFORMATION
            //*
            //********************************************************************
            //**  ASSEMBLER SAMPLE BATCH GEOSUPPORT USER APPLICATION PROGRAM \#2 **
            //**                           COW FORMAT                           **
            //********************************************************************
            //STEP1  EXEC  ASMACLG,
            //         PARM.ASM='OBJECT,NODECK',
            //         PARM.LKED='XREF,LET,LIST,NCAL'
            //ASM.SYSLIB DD DSN=A030.GEO.COPYLIB2,DISP=SHR
            //           DD DSN=A030.GEO.COPYLIB,DISP=SHR
            //           DD DSN=SYS1.MACLIB,DISP=SHR
            //ASM.SYSIN  DD *
            ASMC2SRC TITLE 'SAMPLE GEOSUPPORT ASSEMBLER PROGRAM 2 - COW FORMAT'
            ASMC2SRC CSECT
            ******************************************************************
            \* THIS PROGRAM MAKES FUNCTION 2 AND D CALLS TO GEOSUPPORT USING  *
            \* TWO BOROS AND TWO STREET NAMES SUPPLIED BY AN INSTREAM FILE.   *
            \* FUNCTION 2 RETURNS GEOGRAPHIC INFORMATION FOR AN INTERSECTION. *
            \* FUNCTION D TRANSLATES AN INPUT STREET CODE TO A STREET NAME.   *
            \* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  *
            \* NOTE: IF THE CROSS STREET NAMES FLAG WERE USED IN THE          *
            \*       ORIGINAL CALL TO FUNCTION 2, ALL THE CROSS STREET NAMES  *
            \*       WOULD HAVE BEEN RETURNED BY FUNCTION 2.                  *
            ******************************************************************
            *
            ***********************************************************************
            \*                                                                     *
            \*  This program will do the following:                                *
            \*     * Read an instream record containing 2 borough codes            *
            \*       and two street names                                          *
            \*                                                                     *
            \*     * Build Work Area 1 for a Function 2 call                       *
            \*                                                                     *
            \*     * Call Function 2                                               *
            \*                                                                     *
            \*     * Get ZIP code, community district, police precinct, school     *
            \*       district, and lists of intersecting street codes.             *
            \*       These will be displayed along with the input intersection     *
            \*       which consists of 2 borough codes, and 2 street names.        *
            \*                                                                     *
            \*     * Call Function D to get the street names of all intersecting   *
            \*       streets.                                                      *
            \*                                                                     *
            \*      If it is greater than 01, an error message is printed, and     *
            \*      the next input record, if any, is read.                        *
            \*      If it is 01, a warning message is printed, the input record is *
            \*      processed, and the next record is read.                        *
            \*      If it is zero, the input record is processed, and the next     *
            \*      record is read.                                                *
            \*                                                                     *
            ***********************************************************************
            SPACE
                     STM   R14,R12,12(R13)   Save caller's registers
                     LR    R3,R15
                     LA    R12,4095(,R3)     (second base register
                     LA    R12,1(,R12)        to accommodate Work Areas 1 and 2)
                     USING ASMC2SRC,R3,R12
            \* Chain save areas
                     LA    R4,MYSAVE
                     ST    R13,4(,R4)    Save caller's savearea address
                     ST    R4,8(,R13)    Save pgm's savearea adr in caller savearea
                     LR    R13,R4        Ensure that R13 points to pgm's savearea
                     SPACE 2
                     XR    R15,R15                 (set OS return code to zero)
            \* Open input and output files
                     OPEN  (INFILE,,OUTFILE,(OUTPUT))
                     TM    INFILE+48,X'10'   Did input file open successfully?
                     BNO   INOPNERR             (no..)
                     TM    OUTFILE+48,X'10'  Did output file open successfully?
                     BNO   OUTOPNER             (no..)
            \* Print report header lines
                     SPACE
                     PUT   OUTFILE,HDR1
                     PUT   OUTFILE,HDR2
                     PUT   OUTFILE,HDR3
                     PUT   OUTFILE,HDR4
                     B     NEXTREC
                     SPACE 2
                     TITLE 'READ IN-STREAM INPUT AND PREPARE FUNCTION 2 CALL'
            \* Read (next) input record
            NEXTREC  DS    0H
                     GET   INFILE,INREC
            \* Move input data to output record for display
                     MVC   DBORO1,INBORO1          First borough code
                     MVC   DSTRT1,INSTRT1          First street name
                     MVC   DBORO2,INBORO2          Second borough code
                     MVC   DSTRT2,INSTRT2          Second street name
                     SPACE
            ******************************************************************
            \* TO MAKE A COW FORMAT FUNCTION 2 CALL:                          *
            \*   (1) INITIALIZE WORKAREA 1 TO SPACES                          *
            \*       AND SET WORK AREA FORMAT FLAG TO 'C'                     *
            \*   (2) SET WA1'S FUNCTION CODE FIELD TO 2                       *
            \*   (3) MOVE THE 1ST INPUT BORO TO WA1'S INPUT BORO CODE FIELD   *
            \*   (4) MOVE THE 1ST INPUT STREET TO WA1'S INPUT STREET NAME     *
            \*   (5) MOVE THE 2ND INPUT BORO TO WA1'S INPUT BORO CODE 2 FIELD *
            \*   (6) MOVE THE 2ND INPUT STREET TO WA1'S INPUT STREET NAME 2   *
            \*   (7) CALL GBI WITH 2 WORKAREAS                                *
            \*   (8) CHECK RETURN CODES FOR ERRORS OR WARNINGS                *
            ******************************************************************
            \* Clear WA1 to blanks
                     LA    R8,P1BAL    "To" address for MVCL
                     LA    R9,P1LENGTH     "To" length
                     XR    R11,R11       for blanking out std WA1,
                     ICM   R11,B'1000',=C' '  rather than moving data
            \* ...since if the "from" length reg. has lo-order zeroes, MVCL will
            \* pad the target area with the pad character of the "from" register
            \* and do nothing else (the "from" address register is not used).
                     MVCL  R8,R10
            *
                     MVI   P1IPLIND,C'C'  set work area format indicator to COW
            *
                     SPACE
            \* Prime Work Area 1 for Function 2 call
                     MVC   P1IFUNC,=CL2'2 '              Get function code
                     MVC   P1IBORO1,INBORO1                  borough code 1
                     MVC   P1ISTRT1,INSTRT1                  street name  1
                     MVC   P1IBORO2,INBORO2                  borough code 2
                     MVC   P1ISTRT2,INSTRT2                  street name  2
                     MVC   P1ISNL(L'P1ISNL),=C'25'    Normalized street name length
            \* Call Function 2 (2-Work-Area call)
                     CALL  GBI,(P1BAL,P2BAL),VL
            \* Check Return code
                     CLC   P1ORC(2),=C'00'         Good return?
                     BE    PROCESS                     Yes, process returned data
            \* Handle errors and warnings
            ERREXIT  DS    0H
                     CLC   P1ORC(2),=C'01'         Warning condition?
                     BE    PUTWARN                    Yes, process warning
            \*                                              and then process input;
            \*                                         otherwise, process error
                     MVC   ERFUNC,P1IFUNC              function code
                     MVC   ERRET(L'P1ORC),P1ORC        return code
                     MVC   ERREAS(L'P1OREASN),P1OREASN reason code
                     MVC   ERRMSG(L'P1OERROR),P1OERROR Geosupport error message
                     PUT   OUTFILE,ERR1            Print error message 1
                     MVC   ERINPUT,DSPLYIN    2 boro codes and 2 street names
                     PUT   OUTFILE,ERR2            Print error message 2
                     B     NEXTREC
            PUTWARN  DS    0H
                     MVC   WRFUNC,P1IFUNC              function code
                     MVC   WRRET(L'P1ORC),P1ORC        return code
                     MVC   WRREAS(L'P1OREASN),P1OREASN reason code
                     MVC   WRNMSG(L'P1OERROR),P1OERROR Geosupport warning message
                     PUT   OUTFILE,WARN            Print warning message
                     SPACE
            \* Handle successful Geosupport calls (Return Code <= 01)
            PROCESS  DS    0H
                     MVI   OUTFIXED,C'0'      Init. carriage control to dbl-space
                     CLC   P1ORC(2),=C'01'    Was a warning issued?
                     BNE   MOVEOUT               No..
                     MVI   OUTFIXED,C' '         Yes, single-space output instead
            MOVEOUT  DS    0H
                     MVC   OINPUT,DSPLYIN    Pair of boro codes and street names
                     MVC   OZIP,P2F2ZIP      ZIP code
             MVC   OCOMM,P2F2CDN     community district number
                     MVC   OPCT,P2F2POP      police precinct
                     MVC   OSCHL,P2F2SCH     school district
            ***** At this point, clear WA1 again, call Function D, and move ******
            ***** all reported Intersecting Street Names to output          ******
                     TITLE 'GET INTERSECTING STREET NAMES, USING FUNCTION D'
                     SPACE 2
            *************************************************************
            \* TO GET THE STREET NAMES FOR INTERSECTING STREET CODES     *
            \* MAKE A FUNCTION D CALL:                                   *
            \*   (1) INITIALIZE WORKAREA 1 TO SPACES                     *
            \*       AND SET WORK AREA FORMAT FLAG TO 'C'                *
            \*   (2) SET THE WA1'S FUNCTION CODE FIELD TO D              *
            \*   (3) USE THE COMPACT STREET NAMES OPTION TO OBTAIN       *
            \*       STREET NAMES FORMATTED FOR DISPLAY                  *
            \*   (4) MOVE THE PACKED BORO AND STREET CODE TO             *
            \*       WA1'S INPUT STREET CODE 1 FIELD                     *
            \*   (5) CALL GBI WITH 1 WORKAREA                            *
            \*   (6) CHECK RETURN CODES FOR ERRORS OR WARNINGS           *
            *************************************************************
                     SPACE
            \* For each street code of intersecting streets, including those input,
            \* call Function D to get the corresponding street name
                     XR    R4,R4
                     MVC   INTWK,P2F2#INT   get count of intersecting streets.
                     NI    INTWK,X'0F'      remove zone, leaving numeric
                     IC    R4,INTWK         count of intersecting streets.
                     LA    R5,P2F2CODE      point to street code(s).
                     SPACE
            INTRLOOP DS    0H
            \* Clear WA1 to blanks
                     LA    R8,P1BAL    "To" address for MVCL
                     LA    R9,P1LENGTH     "To" length
                     XR    R11,R11       for blanking out std WA1,
                     ICM   R11,B'1000',=C' '  rather than moving data
            \* ...since if the "from" length reg. has lo-order zeroes, MVCL will
            \* pad the target area with the pad character of the "from" register
            \* and do nothing else (the "from" address register is not used).
                     MVCL  R8,R10
            *
                     MVI   P1IPLIND,C'C'  set work area format indicator to COW
            *
                     SPACE
                     MVC   P1IFUNC(2),=CL2'D '
                     MVC   P1ISNL(L'P1ISNL),=C'25'    normalized street name length
                     MVI   P1ICMPCT,C'C'              streets to be compacted
            *
            \* Note  COW - MSW: P1ICDEx is the 10-digit street code (no boro)
            \*                  P1IBCDx is the Boro and 10-digit street code
            \*                  W1ICDEx is the packed Boro and 5-digit street code
            \*                  P2F2CODE is Boro and 5-digit street code list
            \*                  W2F2CODE is packed Boro and 5-digit street code list
            *
                     MVC   P1IBCD1(LB5SC),0(R5)   Intersecting boro and street code
                     CALL  GBI,P1BAL,VL   Call Function D
            \* Check Return code
                     CLC   P1ORC(2),=C'00'         Good return?
                     BNE   ERREXIT                     No, error or warning
            \*                                          Yes, complete the record
            \*                                               and write it out
            PFIX     NOP   PVAR
                     OI    PFIX+1,X'F0'
                     MVC   OINTRSC1,P1OSTRT1
            \*  put out the initial output including the first intersecting street
                     PUT   OUTFILE,OUTFIXED
                     B     NEXTSC     Now get the rest of the street codes, if any
            PVAR     DS    0H
                     MVC   OINTRSCN,P1OSTRT1
            \* Print an output record and get the next intersecting street, if any
                     PUT   OUTFILE,OUTVAR
            NEXTSC   DS    0H
                     LA    R5,LB5SC(,R5) point to next intersecting street code
                     BCT   R4,INTRLOOP  if any, and process it;
                     NI    PFIX+1,X'0F'    reset 1st-time (fixed/variable) switch
                     B     NEXTREC      then, process next input record, if any
                     SPACE
            EXIT     DS    0H
            OUTOPNER DS    0H
                     CLOSE (INFILE)
                     TM    OUTFILE+48,X'10'   Did OUTFILE open successfully?
                     BNO   INOPNERR              No, bypass closing it
                     CLOSE (OUTFILE)
            INOPNERR DS    0H
                     L     R13,4(,R13)
                     L     R14,12(,R13)
                     LM    R0,R12,20(R13)
                     BR    R14
                     SPACE 2
            PARAMERR DS    0H       parameter error, missing or invalid
                     LA    R15,8    rc=8
                     B     EXIT
                     TITLE 'DATA SECTION - REGISTER ASSIGNMENTS'
            R0       EQU   0
            R1       EQU   1
            R2       EQU   2
            R3       EQU   3
            R4       EQU   4
            R5       EQU   5
            R6       EQU   6
            R7       EQU   7
            R8       EQU   8
            R9       EQU   9
            R10      EQU   10
            R11      EQU   11
            R12      EQU   12
            R13      EQU   13
            R14      EQU   14
            R15      EQU   15
                     TITLE 'FILE AND RECORD DEFINITIONS'
                     PUSH  PRINT
                     PRINT NOGEN
            INFILE   DCB   DSORG=PS,MACRF=(GM),DDNAME=INFILE,                      *
                           RECFM=FB,LRECL=80,BLKSIZE=400,EODAD=EXIT
                     SPACE
            OUTFILE  DCB   DSORG=PS,MACRF=(PM),DDNAME=SYSPRINT,                    *
                           RECFM=FBA,LRECL=133,BLKSIZE=1330
            *
                     POP PRINT
                     SPACE
            INREC    DS    0CL80              Input record
            INBORO1  DS    CL1                    First borough code
            INSTRT1  DS    CL32                   First street name
            INBORO2  DS    CL1                    Second borough code
            INSTRT2  DS    CL32                   Second street name
                     DC    14C' '                 filler
                     SPACE
            \* Output records: header, normal, warning, and error
                     SPACE
            \* header records
            HDR1     DC    CL133'1SAMPLE ASSEMBLER \#2 EXECUTION OUTPUT             *
                                                                                   *
                                                      '
            HDR2     DC    CL133'0*****----------------- INPUT INTERSECTION -------C
                           --------------***** *****--------------- SELECTED OUTPUT*
                            ITEMS ---------------*****'
            HDR3     DC    CL133'0B IN-STREET-NAME-1                 B IN-STREET-NA*
                           ME-2                  ZIP CD NYPD-PCT SCHLDST INTERSECTI*
                           NG STREET NAMES            '
            HDR4     DC    CL133' - -------------------------------- - ------------*
                           ------------------- ----- -- -------- ------- ----------*
                           ---------------------------'
                     SPACE
            \* normal records, i.e., output for valid data
            OUTFIXED DS    0CL133                Fixed output
            \* Borough codes and street names for each of 2 streets are from input
                     DC    C'0'
            OINPUT   DS    CL69
            OZIP     DS    CL5
                     DC    C' '
            OCOMM    DS    CL2
                     DC    C' '
            OPCT     DS    CL3
                     DC    6C' '
            OSCHL    DS    CL2
                               DC    6C' '
            OINTRSC1 DS    CL25  Normalized name of first intersecting street
                     SPACE
            OUTVAR   DS    0CL133 Output line repeated per No. of Intersecting Sts.
                     DC    C' '
                     DC    95C' '
            OINTRSCN DS    CL25  Normalized name of additional intersecting street
                     DC    (133-121)C' '
                     SPACE
            \* warning record
            WARN     DS    0CL133
                     DC    C'0'
                     DC    C'**** FUNCTION '
            WRFUNC   DS    CL2
                     DC    C' WARNING, GRC = '
            WRRET    DS    CL2
                     DC    C' REASON CODE = '
            WRREAS   DS    CL1
                     DC    C'. '
            WRNMSG   DS    CL80            Warning message
                     SPACE
            \* error records
            ERR1     DS    0CL133
                     DC    C'0'
                     DC    C'***** FUNCTION '
            ERFUNC   DS    CL2
                     DC    C' GRC = '
            ERRET    DS    CL2
                     DC    C' REASON = '
            ERREAS   DS    CL1
                     DC    C'. '
            ERRMSG   DS    CL80            Error message
                     DC    CL(133-120)' '
                     SPACE
            ERR2     DS    0CL133
                     DC    C' '
            ERINPUT  DS    CL69
                     DC    CL(133-70)' '
                     TITLE 'WORKING VARIABLES, VALUES, ETC.'
            #INTER   DS    D        Working field for no. of intersecting streets
            MYSAVE   DC    18F'0'
            ***********************************************************************
            ***** USE OF GEOSUPPORT COPY LIBRARIES (REFERENCED BELOW BY THE     ***
            ***** COPY STATEMENTS) IS STRONGLY ENCOURAGED.                      ***
            ***********************************************************************
                     COPY  P1BAL              COPY WORK AREA 1
                     EJECT
                     COPY  P2BAL              COPY WORK AREA 2
                     EJECT
                     SPACE 2
            DSPLYIN  DS    0CL69
            DBORO1   DS    CL1
                     DC    C' '
            DSTRT1   DS    CL32
                     DC    C' '
            DBORO2   DS    CL1
                     DC    C' '
            DSTRT2   DS    CL32
                     SPACE 2
            INTWK    DS    XL1      work field for number of intersecting streets
            LB5SC    EQU   6        length of Boro and 5-digit street code
                     TITLE 'CONSTANTS AND LITERAL POOL'
                     SPACE 2
                     LTORG
                     END   ASMC2SRC
            //LKED.SYSIN  DD  *
             INCLUDE INCLIB(GBI)
            /*
            //LKED.INCLIB   DD  DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
            //*                                                             \*//


            //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
            //*                                                             \*//
            //*  AS OF GEOSUPPORT VERSION 10.0,                             \*//
            //*  THE STEPLIB (OR JOBLIB) OF THE GEOSUPPORT EXECUTION STEP   \*//
            //*  MUST INCLUDE THE FOLLOWING TWO CONCATENATED DATASETS:      \*//
            //*       A030.GEO.SUPPORT.PDSE.LOADLIB                         \*//
            //*       A030.GEO.SUPPORT.LOADLIB                              \*//
            //*                                                             \*//
            //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
            //GO.STEPLIB DD DSN=A030.GEO.SUPPORT.PDSE.LOADLIB,DISP=SHR
            //           DD DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
            //*
            //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
            //*                                                             \*//
            //*   AS OF GEOSUPPORT VERSION 10.0,                            \*//
            //*   DD STATEMENTS FOR GEOSUPPORT DATA FILES (E.G. GRID, PAD,  \*//
            //*   ETC) ARE NO LONGER NEEDED AND ARE IGNORED. GEOSUPPORT     \*//
            //*   IS TAILORED TO USE STANDARD GEOSUPPORT DATA SET NAMES.    \*//
            //*   TO USE NON-STANDARD FILES, SEE YOUR SYSTEMS PROGRAMMER.   \*//
            //*                                                             \*//
            //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
            //*
            //SYSUDUMP DD  SYSOUT=\*,OUTLIM=2000
            //SYSPRINT DD  SYSOUT=*
            //INFILE   DD  *
            1CHAMBERS ST                     1HUDSON ST
            1SIXTH AVE                       1W. 8 ST
            1DUANE ST                        1READE ST
            /*
            //

SAMPLE ASSEMBLER #2 EXECUTION OUTPUT

           *****----------------- INPUT INTERSECTION ---------------------***** *****--------------- SELECTED OUTPUT ITEMS ---------------*****

           B IN-STREET-NAME-1                 B IN-STREET-NAME-2                  ZIP CD NYPD-PCT SCHLDST INTERSECTING STREET NAMES
           \- -------------------------------- - ------------------------------- ----- -- -------- ------- -------------------------------------

           1 CHAMBERS ST                      1 HUDSON ST                       10007 01 001      02      CHAMBERS STREET
                                                                                                          HUDSON STREET
                                                                                                          WEST BROADWAY

           1 SIXTH AVE                        1 W. 8 ST                         10014 02 006      02      6 AVENUE
                                                                                                          GREENWICH AVENUE
                                                                                                          WEST 8 STREET

           ***** FUNCTION 2  GRC = 62 REASON =  . READE STREET & DUANE STREET DO NOT INTERSECT
           1 DUANE ST                         1 READE ST

PL/1 SAMPLE PROGRAM #1

- Input Job Stream - MSW
- Input Job Stream - COW
- Output Report

PL/1 SAMPLE PROGRAM #1 – Job Stream - MSW

        //PL1F1BAT  JOB YOUR-JOB-CARD-INFORMATION
        //*
        //********************************************************************
        //***  PL1 SAMPLE BATCH GEOSUPPORT USER APPLICATION PROGRAM \#1. ******
        //***                   (MSW FORMAT)                            ******
        //********************************************************************
        //STEP1      EXEC IBMZCPLG,REGION=0M,GOPGM='PL1F1SC',
        //           PARM.PLI='S,GS,INCLUDE',
        //           PARM.LKED='AMODE(31)'
        //PLI.SYSLIB DD DSN=A030.GEO.COPYLIB2,DISP=SHR
        //           DD DSN=A030.GEO.COPYLIB,DISP=SHR
        //SYSIN      DD *
         PL1F1SC:    PROC OPTIONS(MAIN);
           /*****************************************************************/
           /* THIS PROGRAM MAKES FUNCTION 1 AND D CALLS TO GEOSUPPORT USING \*/
           /* BORO, HOUSENUMBER, & STREET NAME SUPPLIED BY AN INSTREAM FILE.\*/
           /* FUNCTION 1 RETURNS GEOGRAPHIC INFORMATION FOR AN ADDRESS.     \*/
           /* FUNCTION D TRANSLATES AN INPUT STREET CODE TO A STREET NAME.  \*/
           /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*/
           /* NOTE: IF THE CROSS STREET NAMES FLAG WERE USED IN THE         \*/
           /*       ORIGINAL CALL TO FUNCTION 1, ALL THE CROSS STREET       \*/
           /*       NAMES WOULD HAVE BEEN RETURNED BY FUNCTION 1.           \*/
           /*****************************************************************/

         DCL EOF                      BIT(1)  INIT('0'B),
             YES                      BIT(1)  INIT('1'B),
             NO                       BIT(1)  INIT('0'B),
             ADDR                     BUILTIN,
             (I,J)                    FIXED BIN(15) INIT(0);

         /*******************************************************************/
         /**************   GBI DECLARATION BELOW IS REQUIRED   **************/
         /*** USE OF GEOSUPPORT COPY LIBRARIES (REFERENCED BELOW BY THE *****/
         /*** %INCLUDE STATEMENTS) IS STRONGLY ENCOURAGED.            *******/
         /*******************************************************************/
         DCL GBI                      ENTRY OPTIONS(ASM,INTER);
         %INCLUDE W1PL1;
         %INCLUDE W2PL1;

         /***** REPLACE CODE BELOW WITH YOUR OWN INPUT FILE DECLARATION *****/
         DCL INFILE FILE STREAM INPUT;
         DCL IN_BORO                  CHAR(01),
             IN_HOUSENUM              CHAR(12),
             IN_STREET_NAME           CHAR(32);

         /******** REPLACE CODE BELOW WITH YOUR OWN REPORT LAYOUT *********/
         DCL SYSPRINT FILE STREAM OUTPUT PRINT;
         ON ENDPAGE(SYSPRINT)
           PUT EDIT('SAMPLE PL1 PROGRAM \#1 EXECUTION OUTPUT',
              '*****---------- INPUT ADDRESS ------------***** '||
              '*****---------------------'||
              ' SELECTED OUTPUT ITEMS -----------------------*****',
              'B HOUSE NUMBER IN-STREET-NAME                   '||
              '  ZIP CD NYPD-PCT SCHLDST '||
              'LOW CROSS STREET          HIGH CROSS STREET        ',
              '_ ____________ '||(32)'_'||' '||
              '_____ __ ________ _______ '||
              (25)'_'||' '||(25)'_')
             (PAGE,COL(1),A,SKIP(2),COL(1),A,COL(1),A,SKIP(0),COL(1),A);
         OPEN FILE(SYSPRINT) LINESIZE(133);
         SIGNAL ENDPAGE(SYSPRINT);
         /*****************************************************************/


        ON ENDFILE(INFILE)  BEGIN; EOF=YES; GOTO ENDLOOP;  END;
         OPEN FILE(INFILE);

         DO WHILE (EOF = NO);

           /********** REPLACE CODE BELOW WITH YOUR OWN INPUT *************/
           GET FILE(INFILE) EDIT(IN_BORO,IN_HOUSENUM,IN_STREET_NAME)
                                (COL(1),A(1),X(1),A(12),X(1),A(32));

           /*****************************************************************/
           /* TO MAKE A FUNCTION 1 CALL:                                    \*/
           /*   (1) INITIALIZE WORKAREA 1 TO SPACES                         \*/
           /*   (2) SET WA1'S FUNCTION CODE FIELD TO 1                      \*/
           /*   (3) MOVE THE INPUT BORO TO WA1'S INPUT BORO CODE FIELD      \*/
           /*   (4) MOVE THE INPUT HOUSE NUMBER TO WA1'S INPUT HOUSE NUMBER \*/
           /*       FIELD                                                   \*/
           /*   (5) MOVE THE INPUT STREET TO WA1'S INPUT STREET NAME FIELD  \*/
           /*   (6) CALL GBI WITH 2 WORKAREAS                               \*/
           /*   (7) CHECK RETURN CODES FOR ERRORS OR WARNINGS               \*/
           /*****************************************************************/
           WORK1PL1 = ' ';
           GEO_WA1_IN_FUNCTION_1 = '1';
           GEO_WA1_IN_BORO       = IN_BORO;
           GEO_WA1_IN_HOUSENUM   = IN_HOUSENUM;
           GEO_WA1_IN_STREET_1   = IN_STREET_NAME;

           CALL GBI(W1PL1,W2PL1);

           IF GEO_WA1_OUT_RC_1||GEO_WA1_OUT_RC_2 ¬= '00' &
              GEO_WA1_OUT_RC_1||GEO_WA1_OUT_RC_2 ¬= '01'
           THEN DO;
                  /******** INSERT YOUR OWN ERROR HANDLING ROUTINE HERE *****/
                  PUT EDIT(IN_BORO,IN_HOUSENUM,IN_STREET_NAME,
                           '*** FUNCTION 1 GRC =',
                           GEO_WA1_OUT_RC_1||GEO_WA1_OUT_RC_2,
                           'REASON CODE =',GEO_WA1_OUT_REASON_CODE,
                           '*** ',GEO_WA1_OUT_ERROR_MESSAGE)
                          (SKIP(2),COL(1),(7)(A,X(1)),SKIP(1),COL(49),A,A);
                END;
           ELSE DO;
                  PUT EDIT(IN_BORO,IN_HOUSENUM,IN_STREET_NAME)
                          (SKIP(2),COL(1),(3)(A,X(1)));
                  IF GEO_WA1_OUT_RC_1||GEO_WA1_OUT_RC_2 = '01'
                  THEN DO;
                         /** INSERT YOUR OWN WARNING HANDLING ROUTINE HERE \**/
                         PUT EDIT('*** FUNCTION 1 WARNING, GRC =',
                                  GEO_WA1_OUT_RC_1||GEO_WA1_OUT_RC_2,
                                  'REASON CODE =',GEO_WA1_OUT_REASON_CODE,
                                  '*** ',GEO_WA1_OUT_ERROR_MESSAGE)
                                 (COL(49),(4)(A,X(1)),SKIP(1),COL(49),A,A);
                       END;
                  /****************************************************/
                  /***** REPLACE CODE BELOW WITH YOUR OWN CODE FOR ****/
                  /***** PROCESSING SUCCESSFUL GEOSUPPORT CALLS    ****/
                  /****************************************************/
                  PUT EDIT(GEO_WA2_FN1_ZIP,GEO_WA2_FN1_COMDIST_NUMBER,
                           GEO_WA2_FN1_POL_PRECINCT,GEO_WA2_FN1_SCHOOLDIST)
                          (COL(49),(3)(A,X(1)),X(5),A);
                  /***********************************************************/
                  /* THIS PROGRAM ASSUMES THERE EXISTS AT LEAST ONE HIGH AND \*/


           /* ONE LOW CROSS STREET.  TO GET THE STREET NAMES OF THE   \*/
                  /* FIRST-LISTED HIGH AND FIRST-LISTED LOW CROSS STREETS    \*/
                  /* FROM THE HIGH AND LOW STREET CODE LISTS CALL            \*/
                  /* FUNCTION D:                                             \*/
                  /*   (1) INITIALIZE WORKAREA 1 TO SPACES                   \*/
                  /*   (2) SET WA1'S FUNCTION CODE FIELD TO D                \*/
                  /*   (3) SET WA1'S STREET NAME LENGTH FIELD TO DESIRED     \*/
                  /*       VALUE (IN THIS CASE 25 BECAUSE THE REPORT LINE    \*/
                  /*              HAS SPACE FOR ONLY 25 CHARACTERS)          \*/
                  /*   (4) USE THE COMPACT STREET NAMES OPTION TO OBTAIN     \*/
                  /*       STREET NAMES FORMATTED FOR DISPLAY                \*/
                  /*   (5) MOVE WA2'S LOW PBSC FIELD TO WA1'S INPUT STREET   \*/
                  /*       CODE 1 FIELD                                      \*/
                  /*   (6) MOVE WA2'S HIGH PBSC FIELD TO WA1'S INPUT STREET  \*/
                  /*       CODE 2 FIELD                                      \*/
                  /*   (7) CALL GBI WITH 1 WORKAREA                          \*/
                  /*   (8) CHECK RETURN CODES FOR ERRORS OR WARNINGS         \*/
                  /***********************************************************/
                  WORK1PL1 = ' ';
                  GEO_WA1_IN_FUNCTION_1        = 'D';
                  GEO_WA1_IN_SNL               = '25';
                  GEO_WA1_IN_COMPACT_NAME_FLAG = 'C';
                  GEO_WA1_IN_STREETCODE_1      = GEO_WA2_FN1_LOW_PBSC(1);
                  GEO_WA1_IN_STREETCODE_2      = GEO_WA2_FN1_HI_PBSC(1);
                  CALL GBI(W1PL1);
                  IF GEO_WA1_OUT_RC_1||GEO_WA1_OUT_RC_2 = '00'
                  THEN DO;
                         /******** INSERT YOUR OWN CODE HERE *******/
                         PUT EDIT(GEO_WA1_OUT_STREET_1,GEO_WA1_OUT_STREET_2)
                                 (COL(75),A(25),X(1),A(25));
                       END;
                  ELSE DO;
                         /*** INSERT YOUR OWN ERROR HANDLING ROUTINE HERE \***/
                         PUT EDIT(IN_BORO,IN_HOUSENUM,IN_STREET_NAME,
                                  '*** FUNCTION D GRC =',
                                  GEO_WA1_OUT_RC_1||GEO_WA1_OUT_RC_2,
                                  'REASON CODE =',GEO_WA1_OUT_REASON_CODE,',',
                                  '*** ',GEO_WA1_OUT_ERROR_MESSAGE)
                                 (SKIP(2),COL(1),(8)(A,X(1)),
                                  SKIP(1),COL(49),A,A);
                       END;
                END;
         ENDLOOP:  END;
         CLOSE FILE(INFILE);
         END PL1F1SC;
        /*
        //LKED.SYSIN  DD *
          INCLUDE INCLIB(GBI)
        /*
        //INCLIB      DD DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
        //*
        //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
        //*   AS OF GEOSUPPORT VERSION 10.0,                            \*//
        //*   THE STEPLIB (OR JOBLIB) OF THE GEOSUPPORT EXECUTION STEP  \*//
        //*   MUST INCLUDE THE FOLLOWING TWO CONCATENATED DATASETS:     \*//
        //*        A030.GEO.SUPPORT.PDSE.LOADLIB                        \*//
        //*        A030.GEO.SUPPORT.LOADLIB                             \*//
        //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
        //GO.STEPLIB  DD DSN=A030.GEO.SUPPORT.PDSE.LOADLIB,DISP=SHR
        //            DD DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
        //GO.SYSLMOD  DD DSN=&&GOSET,DISP=(OLD,DELETE)


        //*
        //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
        //*   AS OF GEOSUPPORT VERSION 10.0,                            \*//
        //*   DD STATEMENTS FOR GEOSUPPORT DATA FILES (E.G. GRID, PAD,  \*//
        //*   ETC) ARE NO LONGER NEEDED AND ARE IGNORED. GEOSUPPORT     \*//
        //*   IS TAILORD TO USE STANDARD GEOSUPPORT DATA SET NAMES.     \*//
        //*   TO USE NON-STANDARD FILES, SEE YOUR SYSTEMS PROGRAMMER.   \*//
        //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
        //*
        //GO.SYSPRINT DD SYSOUT=A
        //GO.INFILE   DD *
        1 22           READE ST
        1 500          DUANE ST
        1 2-4          BROADWAY
        4 165-100      BAISLEY BLVD
        4 165-1000     BAISLEY BLVD
        /*
        //

PL/1 SAMPLE PROGRAM #1 – Job Stream - COW

        //PL1C1SRC  JOB YOUR-JOB-CARD-INFORMATION
        //*
        //********************************************************************
        //***  PL1 SAMPLE BATCH GEOSUPPORT USER APPLICATION PROGRAM \#1. ******
        //***                   (COW FORMAT)                            ******
        //********************************************************************
        //STEP1      EXEC IBMZCPLG,REGION=0M,GOPGM='PL1C1SC',
        //           PARM.PLI='S,GS,INCLUDE',
        //           PARM.LKED='AMODE(31),LIST'
        //PLI.SYSLIB DD DSN=A030.GEO.COPYLIB2,DISP=SHR
        //           DD DSN=A030.GEO.COPYLIB,DISP=SHR
        //SYSIN      DD *
         PL1C1SC:   PROC OPTIONS(MAIN);
           /*****************************************************************/
           /* THIS PROGRAM MAKES FUNCTION 1 AND D CALLS TO GEOSUPPORT USING \*/
           /* BORO, HOUSENUMBER, & STREET NAME SUPPLIED BY AN INSTREAM FILE.\*/
           /* FUNCTION 1 RETURNS GEOGRAPHIC INFORMATION FOR AN ADDRESS.     \*/
           /* FUNCTION D TRANSLATES AN INPUT STREET CODE TO A STREET NAME.  \*/
           /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*/
           /* NOTE: IF THE CROSS STREET NAMES FLAG WERE USED IN THE         \*/
           /*       ORIGINAL CALL TO FUNCTION 1, ALL THE CROSS STREET       \*/
           /*       NAMES WOULD HAVE BEEN RETURNED BY FUNCTION 1.           \*/
           /*****************************************************************/

         DCL EOF                      BIT(1)  INIT('0'B),
             YES                      BIT(1)  INIT('1'B),
             NO                       BIT(1)  INIT('0'B),
             ADDR                     BUILTIN,
             (I,J)                    FIXED BIN(15) INIT(0);

         /*******************************************************************/
         /**************   GBI DECLARATION BELOW IS REQUIRED   **************/
         /*** USE OF GEOSUPPORT COPY LIBRARIES (REFERENCED BELOW BY THE *****/
         /*** %INCLUDE STATEMENTS) IS STRONGLY ENCOURAGED.            *******/
         /*******************************************************************/
         DCL GBI                      ENTRY OPTIONS(ASM,INTER);
         %INCLUDE P1PL1;
         %INCLUDE P2PL1;

         /***** REPLACE CODE BELOW WITH YOUR OWN INPUT FILE DECLARATION *****/
         DCL INFILE FILE STREAM INPUT;
         DCL IN_BORO                  CHAR(01),
             IN_HOUSENUM              CHAR(12),
             IN_STREET_NAME           CHAR(32);

         /******** REPLACE CODE BELOW WITH YOUR OWN REPORT LAYOUT *********/
         DCL SYSPRINT FILE STREAM OUTPUT PRINT;
         ON ENDPAGE(SYSPRINT)
           PUT EDIT('SAMPLE PL1 PROGRAM \#1 EXECUTION OUTPUT',
              '*****---------- INPUT ADDRESS ------------***** '||
              '*****---------------------'||
              ' SELECTED OUTPUT ITEMS -----------------------*****',
              'B HOUSE NUMBER IN-STREET-NAME                   '||
              '  ZIP CD NYPD-PCT SCHLDST '||
              'LOW CROSS STREET          HIGH CROSS STREET        ',
              '_ ____________ '||(32)'_'||' '||
              '_____ __ ________ _______ '||
              (25)'_'||' '||(25)'_')
             (PAGE,COL(1),A,SKIP(2),COL(1),A,COL(1),A,SKIP(0),COL(1),A);
         OPEN FILE(SYSPRINT) LINESIZE(133);
         SIGNAL ENDPAGE(SYSPRINT);


        *****************************************************************/

         ON ENDFILE(INFILE)  BEGIN; EOF=YES; GOTO ENDLOOP;  END;
         OPEN FILE(INFILE);

         DO WHILE (EOF = NO);

           /********** REPLACE CODE BELOW WITH YOUR OWN INPUT *************/
           GET FILE(INFILE) EDIT(IN_BORO,IN_HOUSENUM,IN_STREET_NAME)
                                (COL(1),A(1),X(1),A(12),X(1),A(32));

           /*****************************************************************/
           /* TO MAKE A FUNCTION 1 CALL:                                    \*/
           /*   (1) INITIALIZE WORKAREA 1 TO SPACES                         \*/
           /*   (2) SET WA1'S FUNCTION CODE FIELD TO 1                      \*/
           /*   (3) MOVE THE INPUT BORO TO WA1'S INPUT BORO CODE FIELD      \*/
           /*   (4) MOVE THE INPUT HOUSE NUMBER TO WA1'S INPUT HOUSE NUMBER \*/
           /*       FIELD                                                   \*/
           /*   (5) MOVE THE INPUT STREET TO WA1'S INPUT STREET NAME FIELD  \*/
           /*   (6) CALL GBI WITH 2 WORKAREAS                               \*/
           /*   (7) CHECK RETURN CODES FOR ERRORS OR WARNINGS               \*/
           /*****************************************************************/
           WORK1PL1 = ' ';
           PIWA1_IN_FUNCTION_1 = '1';
           PIWA1_IN_BORO_1     = IN_BORO;
            /* for cow format the field house_number has length=16 \*/
           PIWA1_IN_HOUSENUM_DISPLAY  = IN_HOUSENUM;
           PIWA1_IN_STREET_1   = IN_STREET_NAME;
           PIWA1_IN_PLATFORM_INDICATOR = 'C';
           /***************************************************************/
           /***************************************************************/
           /* AS OF GEOSUPPORT 10.1,                                      \*/
           /* TO RECEIVE ROADBED-SPECIFIC INFORMATION,                    \*/
           /* SET THE ROADBED REQUEST SWITCH TO 'R', AS FOLLOWS:          \*/
           /* PIWA1_IN_ROADBED_REQ_SWITCH = 'R';                          \*/
           /***************************************************************/

           CALL GBI(P1PL1,P2PL1);

           IF PIWA1_OUT_RETURN_CODE ¬= '00' & PIWA1_OUT_RETURN_CODE ¬= '01'
           THEN DO;
                  /******** INSERT YOUR OWN ERROR HANDLING ROUTINE HERE *****/
                  PUT EDIT(IN_BORO,IN_HOUSENUM,IN_STREET_NAME,
                           '*** FUNCTION 1 GRC =',PIWA1_OUT_RETURN_CODE,
                           'REASON CODE =',PIWA1_OUT_REASON_CODE,
                           '*** ',PIWA1_OUT_ERROR_MESSAGE)
                          (SKIP(2),COL(1),(7)(A,X(1)),SKIP(1),COL(49),A,A);
                END;
           ELSE DO;
                  PUT EDIT(IN_BORO,IN_HOUSENUM,IN_STREET_NAME)
                          (SKIP(2),COL(1),(3)(A,X(1)));
                  IF PIWA1_OUT_RETURN_CODE = '01'
                  THEN DO;
                         /** INSERT YOUR OWN WARNING HANDLING ROUTINE HERE \**/
                         PUT EDIT('*** FUNCTION 1 WARNING, GRC =',
                                  PIWA1_OUT_RETURN_CODE,
                                  'REASON CODE =',PIWA1_OUT_REASON_CODE,
                                  '*** ',PIWA1_OUT_ERROR_MESSAGE)
                                 (COL(49),(4)(A,X(1)),SKIP(1),COL(49),A,A);
                       END;

                  /****************************************************/
                  /***** REPLACE CODE BELOW WITH YOUR OWN CODE FOR ****/
                  /***** PROCESSING SUCCESSFUL GEOSUPPORT CALLS    ****/
                  /****************************************************/
                  PUT EDIT(PIWA2_FN1_ZIP,PIWA2_FN1_COM_DIST_NUM,
                           PIWA2_FN1_POL_PRECINCT,PIWA2_FN1_SCHL_DIST)
                          (COL(49),(3)(A,X(1)),X(5),A);
                  /***********************************************************/
                  /* THIS PROGRAM ASSUMES THERE EXISTS AT LEAST ONE HIGH AND \*/
                  /* ONE LOW CROSS STREET.  TO GET THE STREET NAMES OF THE   \*/
                  /* FIRST-LISTED HIGH AND FIRST-LISTED LOW CROSS STREETS    \*/
                  /* FROM THE HIGH AND LOW STREET CODE LISTS CALL            \*/
                  /* FUNCTION D:                                             \*/
                  /*   (1) INITIALIZE WORKAREA 1 TO SPACES                   \*/
                  /*   (2) SET WA1'S FUNCTION CODE FIELD TO D                \*/
                  /*   (3) SET WA1'S STREET NAME LENGTH FIELD TO DESIRED     \*/
                  /*       VALUE (IN THIS CASE 25 BECAUSE THE REPORT LINE    \*/
                  /*              HAS SPACE FOR ONLY 25 CHARACTERS)          \*/
                  /*   (4) USE THE COMPACT STREET NAMES OPTION TO OBTAIN     \*/
                  /*       STREET NAMES FORMATTED FOR DISPLAY                \*/
                  /*   (5) MOVE WA2'S LOW B5SC FIELD TO WA1'S INPUT STREET   \*/
                  /*       CODE 1 FIELD                                      \*/
                  /*   (6) MOVE WA2'S HIGH B5SC FIELD TO WA1'S INPUT STREET  \*/
                  /*       CODE 2 FIELD                                      \*/
                  /*   (7) CALL GBI WITH 1 WORKAREA                          \*/
                  /*   (8) CHECK RETURN CODES FOR ERRORS OR WARNINGS         \*/
                  /***********************************************************/
                  WORK1PL1 = ' ';
                  PIWA1_IN_PLATFORM_INDICATOR = 'C';
                  PIWA1_IN_FUNCTION_1        = 'D';
                  PIWA1_IN_SNL               = '25';
                  PIWA1_IN_SN_NORM_FORMAT    = 'C';

                  PIWA1_IN_BORO_1  = SUBSTR(PIWA2_FN1_LOW_B5SC(1),1,1);
                  PIWA1_IN_10SC_1  = SUBSTR(PIWA2_FN1_LOW_B5SC(1),2,5);
                  PIWA1_IN_BORO_2  = SUBSTR(PIWA2_FN1_HI_B5SC(1),1,1);
                  PIWA1_IN_10SC_2  = SUBSTR(PIWA2_FN1_HI_B5SC(1),2,5);


                  CALL GBI(P1PL1);
                  IF PIWA1_OUT_RETURN_CODE = '00'
                  THEN DO;
                         /******** INSERT YOUR OWN CODE HERE *******/
                         PUT EDIT(PIWA1_OUT_STREET_1,PIWA1_OUT_STREET_2)
                                 (COL(75),A(25),X(1),A(25));
                       END;
                  ELSE DO;
                         /*** INSERT YOUR OWN ERROR HANDLING ROUTINE HERE \***/
                         PUT EDIT(IN_BORO,IN_HOUSENUM,IN_STREET_NAME,
                                  '*** FUNCTION D GRC =',
                                  PIWA1_OUT_RETURN_CODE,
                                  'REASON CODE =',PIWA1_OUT_REASON_CODE,',',
                                  '*** ',PIWA1_OUT_ERROR_MESSAGE)
                                 (SKIP(2),COL(1),(8)(A,X(1)),
                                  SKIP(1),COL(49),A,A);
                       END;
                END;
         ENDLOOP:  END;
         CLOSE FILE(INFILE);
         END PL1C1SC;
        /*
        //LKED.SYSIN  DD *
        INCLUDE INCLIB(GBI)
        /*
        //INCLIB      DD DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
        //*
        //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
        //*   AS OF GEOSUPPORT VERSION 10.0,                            \*//
        //*   THE STEPLIB (OR JOBLIB) OF THE GEOSUPPORT EXECUTION STEP  \*//
        //*   MUST INCLUDE THE FOLLOWING TWO CONCATENATED DATASETS:     \*//
        //*        A030.GEO.SUPPORT.PDSE.LOADLIB                        \*//
        //*        A030.GEO.SUPPORT.LOADLIB                             \*//
        //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
        //GO.STEPLIB  DD DSN=A030.GEO.SUPPORT.PDSE.LOADLIB,DISP=SHR
        //            DD DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
        //GO.SYSLMOD  DD DSN=&&GOSET,DISP=(OLD,DELETE)
        //*
        //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
        //*   AS OF GEOSUPPORT VERSION 10.0,                            \*//
        //*   DD STATEMENTS FOR GEOSUPPORT DATA FILES (E.G. GRID, PAD,  \*//
        //*   ETC) ARE NO LONGER NEEDED AND ARE IGNORED. GEOSUPPORT     \*//
        //*   IS TAILORD TO USE STANDARD GEOSUPPORT DATA SET NAMES.     \*//
        //*   TO USE NON-STANDARD FILES, SEE YOUR SYSTEMS PROGRAMMER.   \*//
        //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
        //*
        //GO.SYSPRINT DD SYSOUT=A
        //GO.INFILE   DD *
        1 22           READE ST
        1 500          DUANE ST
        1 2-4          BROADWAY
        4 165-100      BAISLEY BLVD
        4 165-1000     BAISLEY BLVD
        /*
        //

SAMPLE PL/1 PROGRAM #1 EXECUTION OUTPUT

        *****---------- INPUT ADDRESS ------------***** *****--------------------- SELECTED OUTPUT ITEMS -----------------------*****

         B HOUSE NUMBER IN-STREET-NAME                     ZIP CD NYPD-PCT SCHLDST LOW CROSS STREET          HIGH CROSS STREET
         - ------------ -------------------------------- ----- -- -------- ------- ------------------------- -------------------------

         1 22           READE ST                         10007 01 005      02      ELK STREET                BROADWAY

         1 500          DUANE ST                         *** FUNCTION 1 GRC = 42 REASON CODE =
                                                         *** ADDRESS NUMBER OUT OF RANGE

         1 2-4          BROADWAY                         *** FUNCTION 1 WARNING, GRC = 01 REASON CODE = 1
                                                         *** ADDR NUMBER ALTERED: RANGE ASSUMED. USING DIGITS BEFORE DASH ONLY
                                                         10004 01 001      02      STONE STREET              BOWLING GREEN

         4 165-100      BAISLEY BLVD                     11434 12 113      28      GUY R BREWER BOULEVARD    BEDELL STREET

         4 165-1000     BAISLEY BLVD                     *** FUNCTION 1 GRC = 13 REASON CODE = 2
                                                         *** ADDRESS NBR 165-1000  HAS MORE THAN 3 DIGITS AFTER THE DASH.

PL/1 SAMPLE PROGRAM #2

- Input Job Stream - MSW
- Input Job Stream - COW
- Output Report

PL/1 SAMPLE PROGRAM #2 –Job Stream - MSW

          //PL1F2SRC  JOB YOUR-JOB-CARD-INFORMATION
          //*
          //********************************************************************
          //***  PL1 SAMPLE BATCH GEOSUPPORT USER APPLICATION PROGRAM \#2. ******
          //***                   (MSW FORMAT)                            ******
          //********************************************************************
          //STEP1      EXEC IBMZCPLG,REGION=0M,GOPGM='PL1F2SR',
          //           PARM.PLI='S,GS,INCLUDE',
          //           PARM.LKED='AMODE(31)'
          //PLI.SYSLIB DD DSN=A030.GEO.COPYLIB2,DISP=SHR
          //           DD DSN=A030.GEO.COPYLIB,DISP=SHR
          //SYSIN      DD *
           PL1F2SR:    PROC OPTIONS(MAIN);
             /******************************************************************/
             /* THIS PROGRAM MAKES FUNCTION 2 AND D CALLS TO GEOSUPPORT USING  \*/
             /* TWO BOROS AND TWO STREET NAMES SUPPLIED BY AN INSTREAM FILE.   \*/
             /* FUNCTION 2 RETURNS GEOGRAPHIC INFORMATION FOR AN INTERSECTION. \*/
             /* FUNCTION D TRANSLATES AN INPUT STREET CODE TO A STREET NAME.   \*/
             /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *  \*/
             /* NOTE: IF THE CROSS STREET NAMES FLAG WERE USED IN THE          \*/
             /*       ORIGINAL CALL TO FUNCTION 2, ALL THE CROSS STREET        \*/
             /*       NAMES WOULD HAVE BEEN RETURNED BY FUNCTION 2.            \*/
             /******************************************************************/

           DCL EOF                      BIT(1)  INIT('0'B),
               YES                      BIT(1)  INIT('1'B),
               NO                       BIT(1)  INIT('0'B),
               ADDR                     BUILTIN,
               (I,J)                    FIXED BIN(15) INIT(0);

           /**************** GBI DECLARATION BELOW IS REQUIRED ****************/
           DCL GBI                      ENTRY OPTIONS(ASM,INTER);

           /*******************************************************************/
           /** USE OF GEOSUPPORT COPY LIBRARIES (REFERENCED BY THE %INCLUDE  \**/
           /** STATEMENTS) IS STRONGLY ENCOURAGED                            \**/
           /*******************************************************************/
           %INCLUDE W1PL1;
           %INCLUDE W2PL1;

           /***** REPLACE CODE BELOW WITH YOUR OWN INPUT FILE DECLARATION *****/
           DCL INFILE FILE STREAM INPUT;
           DCL IN_BORO1                 CHAR(01),
               IN_STREET_NAME1          CHAR(32),
               IN_BORO2                 CHAR(01),
               IN_STREET_NAME2          CHAR(32);

           /******** REPLACE CODE BELOW WITH YOUR OWN REPORT LAYOUT *********/
           DCL SYSPRINT FILE STREAM OUTPUT PRINT;
           ON ENDPAGE(SYSPRINT)
             PUT EDIT('SAMPLE PL1 PROGRAM \#2 EXECUTION OUTPUT',
                '*****----------------- INPUT INTERSECTION '||(22)'-'||'***** '||
                '*****------------ SELECTED OUTPUT ITEMS -------------*****',
                'B IN-STREET-NAME-1'||(17)' '||'B IN-STREET-NAME-2'||(17)' '||
                '  ZIP CD NYPD-PCT SCHLDST INTERSECTING STREET NAMES        ',
                '_ '||(32)'\_'||' _ '||(32)'\_'||' '||
                '_____ __ ________ _______ '||(32)'\_')
               (PAGE,COL(1),A,SKIP(2),COL(1),A,COL(1),A,SKIP(0),COL(1),A);
           OPEN FILE(SYSPRINT) LINESIZE(133);
           SIGNAL ENDPAGE(SYSPRINT);
           /*****************************************************************/
           ON ENDFILE(INFILE)  BEGIN; EOF=YES; GOTO ENDLOOP;  END;
           OPEN FILE(INFILE);

           DO WHILE (EOF = NO);

             /********** REPLACE CODE BELOW WITH YOUR OWN INPUT *************/
             GET FILE(INFILE) EDIT(IN_BORO1,IN_STREET_NAME1,
                                   IN_BORO2,IN_STREET_NAME2)
                                  (COL(1),A(1),X(1),A(32),X(1),A(1),X(1),A(32));

             /******************************************************************/
             /* TO MAKE A FUNCTION 2 CALL:                                     \*/
             /*   (1) INITIALIZE WORKAREA 1 TO SPACES                          \*/
             /*   (2) SET WA1'S FUNCTION-CODE TO 2                             \*/
             /*   (3) MOVE THE 1ST INPUT BORO TO WA1'S INPUT BORO CODE FIELD   \*/
             /*   (4) MOVE THE 1ST INPUT STREET TO WA1'S INPUT STREET NAME     \*/
             /*       FIELD                                                    \*/
             /*   (5) MOVE THE 2ND INPUT BORO TO WA1'S INPUT BORO CODE 2 FIELD \*/
             /*   (6) MOVE THE 2ND INPUT STREET TO WA1'S INPUT STREET NAME 2   \*/
             /*       FIELD                                                    \*/
             /*   (7) CALL GBI WITH 2 WORKAREAS                                \*/
             /*   (8) CHECK RETURN CODES FOR ERRORS OR WARNINGS                \*/
             /******************************************************************/
             WORK1PL1 = ' ';
             GEO_WA1_IN_FUNCTION_1 = '2';
             GEO_WA1_IN_BORO       = IN_BORO1;
             GEO_WA1_IN_STREET_1   = IN_STREET_NAME1;
             GEO_WA1_IN_BORO_2     = IN_BORO2;
             GEO_WA1_IN_STREET_2   = IN_STREET_NAME2;

             CALL GBI(W1PL1,W2PL1);

             IF GEO_WA1_OUT_RC_1||GEO_WA1_OUT_RC_2 ¬= '00' &
                GEO_WA1_OUT_RC_1||GEO_WA1_OUT_RC_2 ¬= '01'
             THEN DO;
                    /****** INSERT YOUR OWN ERROR HANDLING ROUTINE HERE *******/
                    PUT EDIT('***** FUNCTION 2 GRC =',
                             GEO_WA1_OUT_RC_1||GEO_WA1_OUT_RC_2,
                             'REASON =',GEO_WA1_OUT_REASON_CODE,',',
                             GEO_WA1_OUT_ERROR_MESSAGE,
                             IN_BORO1,IN_STREET_NAME1,IN_BORO2,IN_STREET_NAME2)
                            (SKIP(2),COL(1),(3)(A,X(1)),A,A,X(1),A,
                             SKIP(1),(4)(A,X(1)));
                  END;
             ELSE
                 IF GEO_WA1_OUT_RC_1||GEO_WA1_OUT_RC_2 = '01'
                 THEN DO;
                        /*** INSERT YOUR OWN WARNING HANDLING ROUTINE HERE ****/
                        PUT EDIT('***** FUNCTION 2 WARNING, GRC = '||
                                 GEO_WA1_OUT_RC_1||GEO_WA1_OUT_RC_2||', '||
                                 'REASON CODE = '||GEO_WA1_OUT_REASON_CODE||
                                 ', '||GEO_WA1_OUT_ERROR_MESSAGE,
                                 IN_BORO1,IN_STREET_NAME1,
                                 IN_BORO2,IN_STREET_NAME2)
                                (SKIP(2),COL(1),A,SKIP(1),(4)(A,X(1)));
                      END;

             IF GEO_WA1_OUT_RC_1||GEO_WA1_OUT_RC_2 = '00'|
                GEO_WA1_OUT_RC_1||GEO_WA1_OUT_RC_2 = '01'
             THEN DO;
                    /***********************************************************/
            /***** REPLACE CODE BELOW WITH YOUR OWN CODE FOR ***********/
                    /***** PROCESSING SUCCESSFUL GEOSUPPORT CALLS.         *****/
                    /***********************************************************/
                    PUT EDIT(IN_BORO1,IN_STREET_NAME1,IN_BORO2,IN_STREET_NAME2,
                             GEO_WA2_FN2_ZIP,GEO_WA2_FN2_COMDIST_NUMBER,
                             GEO_WA2_FN2_POL_PRECINCT,GEO_WA2_FN2_SCHOOLDIST)
                            (SKIP(2),COL(1),(7)(A,X(1)),X(5),A);
                    DO J = 1 TO GEO_WA2_FN2_NUM_OF_INTERSECTS;
                      /*******************************************************/
                      /* TO GET STREET NAMES FOR INTERSECTING STREET CODES   \*/
                      /* MAKE A FUNCTION D CALL:                             \*/
                      /*   (1) INITIALIZE WORKAREA 1 TO SPACES               \*/
                      /*   (2) SET THE WA1'S FUNCTION CODE FIELD TO D        \*/
                      /*   (3) USE THE COMPACT STREET NAMES OPTION TO OBTAIN \*/
                      /*       STREET NAMES FORMATTED FOR DISPLAY            \*/
                      /*   (4) MOVE THE PACKED BORO AND STREET CODE TO       \*/
                      /*       WA1'S INPUT STREET CODE 1 FIELD               \*/
                      /*   (5) CALL GBI WITH 1 WORKAREA                      \*/
                      /*   (6) CHECK RETURN CODES FOR ERRORS OR WARNINGS     \*/
                      /*******************************************************/
                      WORK1PL1 = ' ';
                      GEO_WA1_IN_FUNCTION_1        = 'D';
                      GEO_WA1_IN_COMPACT_NAME_FLAG = 'C';
                      GEO_WA1_IN_STREETCODE_1 = GEO_WA2_FN2_INTERSECT_PBSC(J);
                      CALL GBI(W1PL1);
                      IF GEO_WA1_OUT_RC_1||GEO_WA1_OUT_RC_2 = '00'
                      THEN DO;
                             /******** INSERT YOUR OWN CODE HERE *******/
                             PUT EDIT(GEO_WA1_OUT_STREET_1)  (COL(97),A);
                           END;
                      ELSE DO;
                             /** INSERT YOUR OWN ERROR HANDLING ROUTINE HERE \**/
                             PUT EDIT('***** FUNCTION D GRC =',
                                      GEO_WA1_OUT_RC_1||GEO_WA1_OUT_RC_2,
                                      'REASON =',GEO_WA1_OUT_REASON_CODE,',',
                                      GEO_WA1_OUT_ERROR_MESSAGE)
                                     (SKIP(2),COL(1),(6)(A,X(1)));
                           END;
                    END;
                  END;
           ENDLOOP:  END;
           CLOSE FILE(INFILE);
           END PL1F2SR;
          /*
          //LKED.SYSIN  DD *
            INCLUDE INCLIB(GBI)
          /*
          //INCLIB      DD DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
          //*
          //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
          //*   AS OF GEOSUPPORT VERSION 10.0,                            \*//
          //*   THE STEPLIB (OR JOBLIB) OF THE GEOSUPPORT EXECUTION STEP  \*//
          //*   MUST INCLUDE THE FOLLOWING TWO CONCATENATED DATASETS:     \*//
          //*        A030.GEO.SUPPORT.PDSE.LOADLIB                        \*//
          //*        A030.GEO.SUPPORT.LOADLIB                             \*//
          //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
          //GO.STEPLIB  DD DSN=A030.GEO.SUPPORT.PDSE.LOADLIB,DISP=SHR
          //            DD DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
          //GO.SYSLMOD  DD DSN=&&GOSET,DISP=(OLD,DELETE)
          //*
          //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
          //*   AS OF GEOSUPPORT VERSION 10.0,                            \*//
          //*   DD STATEMENTS FOR GEOSUPPORT DATA FILES (E.G. GRID, PAD,  \*//
          //*   ETC) ARE NO LONGER NEEDED AND ARE IGNORED. GEOSUPPORT     \*//
          //*   IS TAILORD TO USE STANDARD GEOSUPPORT DATA SET NAMES.     \*//
          //*   TO USE NON-STANDARD FILES, SEE YOUR SYSTEMS PROGRAMMER.   \*//
          //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
          //*
          //GO.SYSPRINT DD SYSOUT=A
          //GO.INFILE   DD *
          1 CHAMBERS ST                      1 HUDSON ST
          1 SIXTH AVE                        1 W. 8 ST
          1 DUANE ST                         1 READE ST
          /*
          //

SAMPLE PL1 PROGRAM #2 EXECUTION OUTPUT

          *****----------------- INPUT INTERSECTION ----------------------***** *****------------ SELECTED OUTPUT ITEMS -------------*****

           B IN-STREET-NAME-1                 B IN-STREET-NAME-2                   ZIP CD NYPD-PCT SCHLDST INTERSECTING STREET NAMES
           \- -------------------------------- - -------------------------------- ----- -- -------- -------- --------------------------------

           1 CHAMBERS ST                      1 HUDSON ST                        10007 01 001      02       CHAMBERS STREET
                                                                                                            HUDSON STREET
                                                                                                            WEST BROADWAY

           1 SIXTH AVE                        1 W. 8 ST                          10014 02 006      02       6 AVENUE
                                                                                                            GREENWICH AVENUE
                                                                                                            WEST 8 STREET

           ***** FUNCTION 2 GRC = 62 REASON =  , READE STREET & DUANE STREET DO NOT INTERSECT
           1 DUANE ST                         1 READE ST

C SAMPLE PROGRAM #1

- Input Job Stream - MSW
- Input Job Stream - COW
- Output Report

C SAMPLE PROGRAM #1 – Job Stream -MSW

        //CCCF1SRC JOB YOUR-JOB-CARD-INFORMATION
        //*
        //********************************************************************
        //***  C SAMPLE MSW BATCH GEOSUPPORT USER APPLICATION PROGRAM \#1  ****
        //********************************************************************
        //STEP1 EXEC EDCCLG,
        //      CPARM='SS,OPT,OFFSET,SOURCE,XREF,LIST'
        //COMPILE.SYSPRINT DD SYSOUT=A
        //COMPILE.SYSLIB   DD
        //                 DD
        //                 DD  DSNAME=A030.GEO.COPYLIB,DISP=SHR
        //COMPILE.SYSIN    DD *
           /*****************************************************************/
           /* THIS PROGRAM MAKES FUNCTION 1 AND D CALLS TO GEOSUPPORT USING \*/
           /* BORO, HOUSENUMBER, & STREET NAME SUPPLIED BY AN INSTREAM FILE.\*/
           /* FUNCTION 1 RETURNS GEOGRAPHIC INFORMATION FOR AN ADDRESS.     \*/
           /* FUNCTION D TRANSLATES AN INPUT STREET CODE TO A STREET NAME.  \*/
           /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*/
           /* NOTE: IF THE CROSS STREET NAMES FLAG WERE USED IN THE         \*/
           /*       ORIGINAL CALL TO FUNCTION 1, ALL THE CROSS STREET       \*/
           /*       NAMES WOULD HAVE BEEN RETURNED BY FUNCTION 1.           \*/
           /*****************************************************************/

        #include <stdio.h>
        #include <string.h>

         /*********************************************************************/
         /*** USE OF GEOSUPPORT COPY LIBRARIES (REFERENCED BELOW BY THE     \***/
         /*** #INCLUDE STATEMENTS) IS STRONGLY ENCOURAGED.                  \***/
         /*********************************************************************/
        #include <wac.h>

         /**************   GBI OS LINKAGE BELOW IS REQUIRED   **************/
           #pragma linkage (GBI,OS)
           long GBI(void \*, ...);

         /***** THE WORK AREA LAYOUTS MUST BE DECLARED USING THE TYPEDEFS \***/
         /***** IN THE GEOSUPPORT COPY FILE.                              \***/
           C_WA1 wa1;
           C_WA2_F1 wa2_f1;

        void main ()
         {
        /***** REPLACE CODE BELOW WITH YOUR OWN INPUT FILE DECLARATION *****/
            FILE \*inpdat;
            struct tag
              {
               char in_boro;
               char filler1;
               char in_housenum         [12];
               char filler2;
               char in_street_name      [32];
               char filler3             [33];
              } recin ;

            inpdat = fopen("DD:INPDAT","rb");
            if (inpdat ==  NULL)
                {printf("INPDAT Data Set did not open.\n");
                 return;}
         /***** REPLACE CODE BELOW WITH YOUR OWN REPORT LAYOUT  *****/
              printf("\fSAMPLE C PROGRAM \#1 EXECUTION OUTPUT  ");
              printf("\n\n*****---------- INPUT ADDRESS ------------***** \***");
              printf("\**--------------------- SELECTED OUTPUT ITEMS ---------");
              printf("--------------*****");
              printf("\n\nB HOUSE NUMBER IN-STREET-NAME              ");
              printf("       ZIP CD NYPD-PCT SCHLDST LOW CROSS STREET ");
              printf("         HIGH CROSS STREET       ");
              printf("\r_ ____________ ____________________________");
              printf("____ _____ __ ________ _______ _________________");
              printf("________ _________________________");

          /*** REPLACE CODE BELOW WITH YOUR OWN INPUT \***/
          while (fread(&recin,1,sizeof(recin),inpdat))
           {

           /*****************************************************************/
           /* TO MAKE A FUNCTION 1 CALL:                                    \*/
           /*   (1) INITIALIZE WORKAREA 1 TO SPACES                         \*/
           /*   (2) SET WA1'S FUNCTION CODE FIELD TO 1                      \*/
           /*   (3) MOVE THE INPUT BORO TO WA1'S INPUT BORO CODE FIELD      \*/
           /*   (4) MOVE THE INPUT HOUSE NUMBER TO WA1'S INPUT HOUSE NUMBER \*/
           /*       FIELD                                                   \*/
           /*   (5) MOVE THE INPUT STREET TO WA1'S INPUT STREET NAME FIELD  \*/
           /*   (6) CALL GBI WITH 2 WORKAREAS                               \*/
           /*   (7) CHECK RETURN CODES FOR ERRORS OR WARNINGS               \*/
           /*****************************************************************/
             memset(&wa1,' ',sizeof(wa1));
             memcpy(wa1.input.func_code,"1 ",2);
             wa1.input.boro_1 = recin.in_boro ;
             memcpy(wa1.input.street_name_1,recin.in_street_name,32);
             memcpy(wa1.input.hse_nbr_disp,recin.in_housenum,12);
         /*
         /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*/
         /*     As of Geosupport Version 10.1,                              \*/
         /*     to receive roadbed-specific information,                    \*/
         /*     set the Roadbed Request Switch to 'R', as follows:          \*/
         /*     wa1.input.roadbedreq = 'R';                                 \*/
         /*                                                                 \*/
         /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*/
         /*                                                                 \*/
             GBI(&wa1,&wa2_f1);

             if ( (memcmp(wa1.output.ret_code,"01",2)) > 0
             ||   (memcmp(wa1.output.ret_code,"00",2)) < 0 )
                  /******** INSERT YOUR OWN ERROR HANDLING ROUTINE HERE *****/
              {
                printf("\n\n%c %.12s %.32s *** FUNCTION 1 GRC = %.2s"
                       " REASON CODE = %c",
                    recin.in_boro,recin.in_housenum,recin.in_street_name,
                    wa1.output.ret_code,wa1.output.reject_reason_code) ;
                printf ("\n%51.5s %.80s", "\***", wa1.output.msg) ;
              }

             if ( (memcmp(wa1.output.ret_code,"01",2)) == 0 )
                  /******** INSERT YOUR OWN WARNING HANDLING ROUTINE HERE *****/
              {
                printf("\n\n%c %.12s %.32s *** FUNCTION 1 WARNING, GRC = %.2s"
                       " REASON CODE = %c",
                    recin.in_boro,recin.in_housenum,recin.in_street_name,

                wa1.output.ret_code,wa1.output.reject_reason_code) ;
                printf ("\n%51.5s %.80s", "\***", wa1.output.msg) ;
                printf("\n%47.1s %.5s %.2s %.3s      %.2s",
                    " ",wa2_f1.zip_code,
                    wa2_f1.com_dist+1,wa2_f1.police_pre,wa2_f1.com_schl_dist) ;
              }

             if ( (memcmp(wa1.output.ret_code,"00",2)) == 0 )
                  /***********************************************************/
                  /***** REPLACE CODE BELOW WITH YOUR OWN CODE FOR ***********/
                  /***** PROCESSING SUCCESSFUL GEOSUPPORT CALLS          *****/
                  /***********************************************************/
                  printf("\n\n%c %.12s %.31s  %.5s %.2s %.3s      %.2s",
                    recin.in_boro,recin.in_housenum,recin.in_street_name,
                    wa2_f1.zip_code,
                    wa2_f1.com_dist+1,wa2_f1.police_pre,wa2_f1.com_schl_dist) ;

                /************************************************************/
                /* THIS PROGRAM ASSUMES THERE EXISTS AT LEAST ONE HIGH AND  \*/
                /* ONE LOW CROSS STREET.  TO GET THE STREET NAMES OF THE    \*/
                /* FIRST-LISTED HIGH AND FIRST-LISTED LOW CROSS STREETS     \*/
                /* FROM THE HIGH AND LOW STREET CODE LISTS CALL FUNCTION D: \*/
                /*   (1) INITIALIZE WORKAREA 1 TO SPACES                    \*/
                /*   (2) SET WA1'S FUNCTION CODE FIELD TO D                 \*/
                /*   (3) SET WA1'S STREET NAME LENGTH FIELD TO DESIRED      \*/
                /*       VALUE (IN THIS CASE 25 BECAUSE THE REPORT LINE     \*/
                /*              HAS SPACE FOR ONLY 25 CHARACTERS)           \*/
                /*   (4) USE THE COMPACT STREET NAMES OPTION TO OBTAIN      \*/
                /*       STREET NAMES FORMATTED FOR DISPLAY                 \*/
                /*   (5) MOVE WA2'S LOW PBSC FIELD TO WA1'S INPUT STREET    \*/
                /*       CODE 1 FIELD                                       \*/
                /*   (6) MOVE WA2'S HIGH PBSC FIELD TO WA1'S INPUT STREET   \*/
                /*       CODE 2 FIELD                                       \*/
                /*   (7) CALL GBI WITH 1 WORKAREA                           \*/
                /*   (8) CHECK RETURN CODES FOR ERRORS OR WARNINGS          \*/
                /************************************************************/
             if ( (memcmp(wa1.output.ret_code,"00",2)) == 0
             ||   (memcmp(wa1.output.ret_code,"01",2)) == 0 )
              {
                memset(&wa1,' ',sizeof(wa1));  /* Clear Work area 1 \*/
                wa1.input.func_code[0] = 'D' ;
                wa1.input.compact_flag = 'C' ;
                memcpy(wa1.input.snl,"25",2) ;
                memcpy(wa1.input.PB5SC_1,wa2_f1.l_x_sts[0],4) ;
                memcpy(wa1.input.PB5SC_2,wa2_f1.h_x_sts[0],4) ;
                GBI(&wa1);
                if ( (memcmp(wa1.output.ret_code,"00",2)) == 0 )
                  /***** INSERT YOUR OWN CODE HERE ***********/
                  printf("      %.25s %.25s",wa1.output.street_name_1,
                         wa1.output.street_name_2) ;
                else
                  /******** INSERT YOUR OWN ERROR HANDLING ROUTINE HERE *****/
                 {
                  printf("\n\n%c %.12s %.32s *** FUNCTION D GRC = %.2s"
                         " REASON CODE = %c",
                      recin.in_boro,recin.in_housenum,recin.in_street_name,
                      wa1.output.ret_code,wa1.output.reject_reason_code) ;
                  printf ("\n%51.5s %.80s", "\***", wa1.output.msg) ;
                 }

              }
          }

         }
        /*
        //LKED.SYSIN   DD *
            INCLUDE DD1(GBI)
        /*
        //LKED.DD1  DD  DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
        //***************************************************************
        //*
        //*  AS OF GEOSUPPORT VERSION 10.0, THE STEPLIB OR JOBLIB
        //*  STATEMENTS OF THE GEOSUPPORT EXECUTION STEP MUST INCLUDE
        //*  THE FOLLOWING TWO CONCATENATED DATA SETS IN THE SPECIFIED
        //*  ORDER:
        //*                A030.GEO.SUPPORT.PDSE.LOADLIB
        //*                A030.GEO.SUPPORT.LOADLIB
        //*
        //***************************************************************
        //GO.STEPLIB  DD  DSN=A030.GEO.SUPPORT.PDSE.LOADLIB,DISP=SHR
        //            DD  DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
        //***************************************************************
        //*
        //*  AS OF GEOSUPPORT VERSION 10.0, DD STATEMENTS FOR GEOSUPPORT
        //*  DATA FILES (E.G. GRID, PAD, ETC) ARE NO LONGER NEEDED AND
        //*  ARE IGNORED.  GEOSUPPORT IS TAILORED TO USE STANDARD
        //*  GEOSUPPORT DATA SETS.  TO USE NON-STANDARD FILES, SEE YOUR
        //*  SYSTEMS PROGRAMMER.
        //*
        //***************************************************************
        //GO.SYSPRINT DD SYSOUT=A
        //GO.INPDAT DD \*,DCB=LRECL=80
        1 22           READE ST
        1 500          DUANE ST
        1 2-4          BROADWAY
        4 165-100      BAISLEY BLVD
        4 165-1000     BAISLEY BLVD
        /*
        //

C SAMPLE PROGRAM #1 –Job Stream - COW

        //CCCC1SRC JOB YOUR-JOB-CARD-INFORMATION
        //*
        //********************************************************************
        //***  C SAMPLE COW BATCH GEOSUPPORT USER APPLICATION PROGRAM \#1  ****
        //********************************************************************
        //*
        //STEP1 EXEC EDCCLG,
        //      CPARM='SS,OPT,OFFSET,SOURCE,XREF,LIST'
        //COMPILE.SYSPRINT DD SYSOUT=A
        //COMPILE.SYSLIB   DD
        //                 DD
        //                 DD  DSNAME=A030.GEO.COPYLIB,DISP=SHR
        //COMPILE.SYSIN    DD *
           /*****************************************************************/
           /* THIS PROGRAM MAKES FUNCTION 1 AND D CALLS TO GEOSUPPORT USING \*/
           /* BORO, HOUSENUMBER, & STREET NAME SUPPLIED BY AN INSTREAM FILE.\*/
           /* FUNCTION 1 RETURNS GEOGRAPHIC INFORMATION FOR AN ADDRESS.     \*/
           /* FUNCTION D TRANSLATES AN INPUT STREET CODE TO A STREET NAME.  \*/
           /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*/
           /* NOTE: IF THE CROSS STREET NAMES FLAG WERE USED IN THE         \*/
           /*       ORIGINAL CALL TO FUNCTION 1, ALL THE CROSS STREET       \*/
           /*       NAMES WOULD HAVE BEEN RETURNED BY FUNCTION 1.           \*/
           /*****************************************************************/

        #include <stdio.h>
        #include <string.h>

         /*********************************************************************/
         /*** USE OF GEOSUPPORT COPY LIBRARIES (REFERENCED BELOW BY THE     \***/
         /*** #INCLUDE STATEMENTS) IS STRONGLY ENCOURAGED.                  \***/
         /*********************************************************************/
        #include <pac.h>

         /**************   GBI OS LINKAGE BELOW IS REQUIRED   **************/
        #pragma linkage (GBI,OS)
        long GBI(void \*, ...);

         /***** THE WORK AREA LAYOUTS MUST BE DECLARED USING THE TYPEDEFS \***/
         /***** IN THE GEOSUPPORT COPY FILE.                              \***/
           C_WA1 wa1;
           C_WA2_F1 wa2_f1;

        void main ()

         /***** REPLACE CODE BELOW WITH YOUR OWN INPUT FILE DECLARATION *****/
            FILE \*inpdat;
            struct tag
              {
               char in_boro;
               char filler1;
               char in_housenum         [12];
               char filler2;
               char in_street_name      [32];
               char filler3             [33];
              } recin ;

            inpdat = fopen("DD:INPDAT","rb");
            if (inpdat ==  NULL)
                {printf("INPDAT Data Set did not open.\n");
                 return;}
         /***** REPLACE CODE BELOW WITH YOUR OWN REPORT LAYOUT  *****/
              printf("\fSAMPLE C PROGRAM \#1 EXECUTION OUTPUT  ");
              printf("\n\n*****---------- INPUT ADDRESS ------------***** \***");
              printf("\**--------------------- SELECTED OUTPUT ITEMS ---------");
              printf("--------------*****");
              printf("\n\nB HOUSE NUMBER IN-STREET-NAME              ");
              printf("       ZIP CD NYPD-PCT SCHLDST LOW CROSS STREET ");
              printf("         HIGH CROSS STREET       ");
              printf("\r_ ____________ ____________________________");
              printf("____ _____ __ ________ _______ _________________");
              printf("________ _________________________");

          /*** REPLACE CODE BELOW WITH YOUR OWN INPUT \***/
          while (fread(&recin,1,sizeof(recin),inpdat))
           {

           /*****************************************************************/
           /* TO MAKE A FUNCTION 1 CALL:                                    \*/
           /*   (1) INITIALIZE WORKAREA 1 TO SPACES                         \*/
           /*   (2) SET WA1'S FUNCTION CODE FIELD TO 1                      \*/
           /*   (3) MOVE THE INPUT BORO TO WA1'S INPUT BORO CODE FIELD      \*/
           /*   (4) MOVE THE INPUT HOUSE NUMBER TO WA1'S INPUT HOUSE NUMBER \*/
           /*       FIELD                                                   \*/
           /*   (5) MOVE THE INPUT STREET TO WA1'S INPUT STREET NAME FIELD  \*/
           /*   (6) CALL GBI WITH 2 WORKAREAS                               \*/
           /*   (7) CHECK RETURN CODES FOR ERRORS OR WARNINGS               \*/
           /*****************************************************************/

             memset(&wa1,' ',sizeof(wa1));
             memcpy(wa1.input.func_code,"1 ",2);
             wa1.input.sti??(0??).boro = recin.in_boro ;
             memcpy(wa1.input.sti??(0??).Street_name,recin.in_street_name,32);
                    /* Please note that the house number field is actually \*/
                    /* 16 bytes.  If you are only using 12 bytes, it is    \*/
                    /* critical that you blank out the work area before    \*/
                    /* you move in the house number                        \*/
             memcpy(wa1.input.hse_nbr_disp,recin.in_housenum,12);
             wa1.input.platform_ind = 'C';    /* Tells Geosupport that you \*/
                                              /* are using the character   \*/
         /*
         /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*/
         /*     As of Geosupport Version 10.1,                              \*/
         /*     to receive roadbed-specific information,                    \*/
         /*     set the Roadbed Request Switch to 'R', as follows:          \*/
         /*     wa1.input.roadbedrequest = 'R';                             \*/
         /*                                                                 \*/
         /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*/
         /*  \*/


             GBI(&wa1,&wa2_f1);

             if ( (memcmp(wa1.output.ret_code,"01",2)) > 0
             ||   (memcmp(wa1.output.ret_code,"00",2)) < 0 )
                  /******** INSERT YOUR OWN ERROR HANDLING ROUTINE HERE *****/
              {
                printf("\n\n%c %.12s %.32s *** FUNCTION 1 GRC = %.2s"
                       " REASON CODE = %c",
                    recin.in_boro,recin.in_housenum,recin.in_street_name,
                    wa1.output.ret_code,wa1.output.reason_code) ;
                printf ("\n%51.5s %.80s", "\***", wa1.output.msg) ;
              }
             if ( (memcmp(wa1.output.ret_code,"01",2)) == 0 )
                  /******** INSERT YOUR OWN WARNING HANDLING ROUTINE HERE *****/
              {
                printf("\n\n%c %.12s %.32s *** FUNCTION 1 WARNING, GRC = %.2s"
                       " REASON CODE = %c",
                    recin.in_boro,recin.in_housenum,recin.in_street_name,
        wa1.output.ret_code,wa1.output.reason_code) ;
                printf ("\n%51.5s %.80s", "\***", wa1.output.msg) ;
                printf("\n%47.1s %.5s %.2s %.3s      %.2s",
                    " ",wa2_f1.zip_code,
                    wa2_f1.com_dist+1,wa2_f1.police_pre,wa2_f1.com_schl_dist) ;
              }

             if ( (memcmp(wa1.output.ret_code,"00",2)) == 0 )
                  /***********************************************************/
                  /***** REPLACE CODE BELOW WITH YOUR OWN CODE FOR ***********/
                  /***** PROCESSING SUCCESSFUL GEOSUPPORT CALLS          *****/
                  /***********************************************************/
                printf("\n\n%c %.12s %.31s  %.5s %.2s %.3s      %.2s",
                    recin.in_boro,recin.in_housenum,recin.in_street_name,
                    wa2_f1.zip_code,
                    wa2_f1.com_dist+1,wa2_f1.police_pre,wa2_f1.com_schl_dist) ;

                /************************************************************/
                /* THIS PROGRAM ASSUMES THERE EXISTS AT LEAST ONE HIGH AND  \*/
                /* ONE LOW CROSS STREET.  TO GET THE STREET NAMES OF THE    \*/
                /* FIRST-LISTED HIGH AND FIRST-LISTED LOW CROSS STREETS     \*/
                /* FROM THE HIGH AND LOW STREET CODE LISTS CALL FUNCTION D: \*/
                /*   (1) INITIALIZE WORKAREA 1 TO SPACES                    \*/
                /*   (2) SET WA1'S FUNCTION CODE FIELD TO D                 \*/
                /*   (3) SET WA1'S STREET NAME LENGTH FIELD TO DESIRED      \*/
                /*       VALUE (IN THIS CASE 25 BECAUSE THE REPORT LINE     \*/
                /*              HAS SPACE FOR ONLY 25 CHARACTERS)           \*/
                /*   (4) USE THE COMPACT STREET NAMES OPTION TO OBTAIN      \*/
                /*       STREET NAMES FORMATTED FOR DISPLAY                 \*/
                /*   (5) MOVE WA2'S LOW PBSC FIELD TO WA1'S INPUT STREET    \*/
                /*       CODE 1 FIELD                                       \*/
                /*   (6) MOVE WA2'S HIGH PBSC FIELD TO WA1'S INPUT STREET   \*/
                /*       CODE 2 FIELD                                       \*/
                /*   (7) CALL GBI WITH 1 WORKAREA                           \*/
                /*   (8) CHECK RETURN CODES FOR ERRORS OR WARNINGS          \*/
                /************************************************************/
             if ( (memcmp(wa1.output.ret_code,"00",2)) == 0
             ||   (memcmp(wa1.output.ret_code,"01",2)) == 0 )
              {
                memset(&wa1,' ',sizeof(wa1));  /* Clear Work area 1 \*/
                wa1.input.func_code[0] = 'D' ;
                wa1.input.st_name_norm = 'C' ;
                memcpy(wa1.input.snl,"25",2) ;
         wa1.input.platform_ind = 'C';
                wa1.input.sti??(0??).boro=wa2_f1.st??(0??).B5SC??(0??)??(0??);
                memcpy(wa1.input.sti??(0??).SC10,
                       wa2_f1.st??(0??).B5SC??(0??)+1,5);
                wa1.input.sti??(1??).boro=wa2_f1.st??(1??).B5SC??(0??)??(0??);
                memcpy(wa1.input.sti??(1??).SC10,
                       wa2_f1.st??(1??).B5SC??(0??)+1,5);
                GBI(&wa1);
                if ( (memcmp(wa1.output.ret_code,"00",2)) == 0 )
                  /***** INSERT YOUR OWN CODE HERE ***********/
                    printf("      %.25s %.25s",wa1.output.sto??(0??).Street_name,
                         wa1.output.sto??(1??).Street_name) ;
                else
                  /******** INSERT YOUR OWN ERROR HANDLING ROUTINE HERE *****/
                 {
                  printf("\n\n%c %.12s %.32s *** FUNCTION D GRC = %.2s"
                         " REASON CODE = %c",
                      recin.in_boro,recin.in_housenum,recin.in_street_name,
                      wa1.output.ret_code,wa1.output.reason_code) ;
                  printf ("\n%51.5s %.80s", "\***", wa1.output.msg) ;
                 }

              }

           }

         }
        /*
        //LKED.SYSIN   DD *
            INCLUDE DD1(GBI)
        /*
        //LKED.DD1  DD  DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
        //***************************************************************
        //*
        //*  AS OF GEOSUPPORT VERSION 10.0, THE STEPLIB OR JOBLIB
        //*  STATEMENTS OF THE GEOSUPPORT EXECUTION STEP MUST INCLUDE
        //*  THE FOLLOWING TWO CONCATENATED DATA SETS IN THE SPECIFIED
        //*  ORDER:
        //*                A030.GEO.SUPPORT.PDSE.LOADLIB
        //*                A030.GEO.SUPPORT.LOADLIB
        //*
        //***************************************************************
        //GO.STEPLIB  DD  DSN=A030.GEO.SUPPORT.PDSE.LOADLIB,DISP=SHR
        //            DD  DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
        //***************************************************************
        //*
        //*  AS OF GEOSUPPORT VERSION 10.0, DD STATEMENTS FOR GEOSUPPORT
        //*  DATA FILES (E.G. GRID, PAD, ETC) ARE NO LONGER NEEDED AND
        //*  ARE IGNORED.  GEOSUPPORT IS TAILORED TO USE STANDARD
        //*  GEOSUPPORT DATA SETS.  TO USE NON-STANDARD FILES, SEE YOUR
        //*  SYSTEMS PROGRAMMER.
        //*
        //***************************************************************
        //GO.SYSPRINT DD SYSOUT=A
        //GO.INPDAT DD \*,DCB=LRECL=80
        1 22           READE ST
        1 500          DUANE ST
        1 2-4          BROADWAY
        4 165-100      BAISLEY BLVD
        4 165-1000     BAISLEY BLVD
        /*
        //

C SAMPLE PROGRAM #1 – Output Report

     *****---------- INPUT ADDRESS ------------***** *****--------------------- SELECTED OUTPUT ITEMS -----------------------*****

     B HOUSE NUMBER IN-STREET-NAME                     ZIP CD NYPD-PCT SCHLDST LOW CROSS STREET          HIGH CROSS STREET
     \- ------------ -------------------------------- ----- -- -------- ------- ------------------------- -------------------------

     1 22           READE ST                         10007 01 005      02      ELK STREET                BROADWAY

     1 500          DUANE ST                         *** FUNCTION 1 GRC = 42 REASON CODE =
                                                     *** ADDRESS NUMBER OUT OF RANGE

     1 2-4          BROADWAY                         *** FUNCTION 1 WARNING, GRC = 01 REASON CODE = 1
                                                     *** ADDR NUMBER ALTERED: RANGE ASSUMED. USING DIGITS BEFORE DASH ONLY
                                                     10004 01 001      02      STONE STREET              BOWLING GREEN

     4 165-100      BAISLEY BLVD                     11434 12 113      28      GUY R BREWER BOULEVARD    BEDELL STREET

     4 165-1000     BAISLEY BLVD                     *** FUNCTION 1 GRC = 13 REASON CODE = 2
                                                     *** ADDRESS NBR 165-1000  HAS MORE THAN 3 DIGITS AFTER THE DASH.

C SAMPLE PROGRAM #2

- Input Job Stream - MSW
- Input Job Stream - COW
- Output Report

C SAMPLE PROGRAM #2 – Job Stream - MSW

    //CCCF2SRC JOB YOUR-JOB-CARD-INFORMATION
    //*
    //********************************************************************
    //***  C SAMPLE MSW BATCH GEOSUPPORT USER APPLICATION PROGRAM \#2  ****
    //********************************************************************
    //*
    //STEP1 EXEC EDCCLG,
    //      CPARM='SS,OPT,OFFSET,SOURCE,XREF,LIST'
    //COMPILE.SYSPRINT DD SYSOUT=A
    //COMPILE.SYSLIB   DD
    //                 DD
    //                 DD  DSNAME=A030.GEO.COPYLIB,DISP=SHR
    //COMPILE.SYSIN    DD *
       /*****************************************************************/
       /* THIS PROGRAM MAKES FUNCTION 2 AND D CALLS TO GEOSUPPORT USING \*/
       /* TWO BOROS AND TWO STREET NAMES SUPPLIED BY AN INSTREAM FILE.  \*/
       /* FUNCTION 2 RETURNS GEOGRAPHIC INFORMATION FOR AN INTERSECTION.\*/
       /* FUNCTION D TRANSLATES AN INPUT STREET CODE TO A STREET NAME.  \*/
       /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*/
       /* NOTE: IF THE CROSS STREET NAMES FLAG WERE USED IN THE         \*/
       /*       ORIGINAL CALL TO FUNCTION 2, ALL THE CROSS STREET       \*/
       /*       NAMES WOULD HAVE BEEN RETURNED BY FUNCTION 2.           \*/
       /*****************************************************************/

    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>

     /*********************************************************************/
     /*** USE OF GEOSUPPORT COPY LIBRARIES (REFERENCED BELOW BY THE     \***/
     /*** #INCLUDE STATEMENTS) IS STRONGLY ENCOURAGED.                  \***/
     /*********************************************************************/
    #include <wac.h>

     /**************   GBI DECLARATION BELOW IS REQUIRED   **************/
       #pragma linkage (GBI,OS)
       long GBI(void \*, ...);

     /***** THE WORK AREA LAYOUTS MUST BE DECLARED USING THE TYPEDEFS \***/
     /***** IN THE GEOSUPPORT COPY FILE.                              \***/
       C_WA1 wa1;
       C_WA2_F2 wa2_f2;

    void main ()
     {

     /***** REPLACE CODE BELOW WITH YOUR OWN INPUT FILE DECLARATION *****/
        FILE \*infile;
        struct tag
          {
           char in_boro1;
           char filler1;
           char in_street_name1     [32];
           char filler2;
           char in_boro2;
           char filler3;
           char in_street_name2     [32];
           char filler4             [11];
          } recin ;
       short int j, i;
       char temp [2];
        if ((infile = fopen("DD:INFILE","rb")) ==  NULL)

    {printf("INFILE Data Set did not open.\n");
             return;}

     /***** REPLACE CODE BELOW WITH YOUR OWN REPRORT LAYOUT  *****/
          printf("\fSAMPLE C PROGRAM \#2 EXECUTION OUTPUT  ");
          printf("\n\n*****----------------- INPUT INTERSECTION ---------");
          printf("-------------***** *****------------ SELECTED OUTPUT ");
          printf("ITEMS -------------*****");
          printf("\n\nB IN-STREET-NAME-1            ");
          printf("     B IN-STREET-NAME-2                   ZIP CD");
          printf(" NYPD-PCT SCHLDST INTERSECTING STREET NAMES");
          printf(  "\r_ ____________________________");
          printf("____ _ ________________________________ _____ \__");
          printf(" ________ _______ _________________________________");

      /*** REPLACE CODE BELOW WITH YOUR OWN INPUT \***/
      while (fread(&recin,1,sizeof(recin),infile))
       {

       /******************************************************************/
       /* TO MAKE A FUNCTION 2 CALL:                                     \*/
       /*   (1) INITIALIZE WORKAREA 1 TO SPACES                          \*/
       /*   (2) SET WA1'S FUNCTION-CODE TO 2                             \*/
       /*   (3) MOVE THE 1ST INPUT BORO TO WA1'S INPUT BORO CODE FIELD   \*/
       /*   (4) MOVE THE 1ST INPUT STREET TO WA1'S INPUT STREET NAME     \*/
       /*       FIELD                                                    \*/
       /*   (5) MOVE THE 2ND INPUT BORO TO WA1'S INPUT BORO CODE 2 FIELD \*/
       /*   (6) MOVE THE 2ND INPUT STREET TO WA1'S INPUT STREET NAME 2   \*/
       /*       FIELD                                                    \*/
       /*   (7) CALL GBI WITH 2 WORKAREAS                                \*/
       /*   (8) CHECK RETURN CODES FOR ERRORS OR WARNINGS                \*/
       /******************************************************************/

         memset(&wa1,' ',sizeof(wa1));
         memcpy(wa1.input.func_code,"2 ",2);
         wa1.input.boro_1 = recin.in_boro1 ;
         memcpy(wa1.input.street_name_1,recin.in_street_name1,32);
         wa1.input.boro_2 = recin.in_boro2 ;
         memcpy(wa1.input.street_name_2,recin.in_street_name2,32);
         GBI(&wa1,&wa2_f2);

         if ( (memcmp(wa1.output.ret_code,"01",2)) > 0
         ||   (memcmp(wa1.output.ret_code,"00",2)) < 0 )
              /******** INSERT YOUR OWN ERROR HANDLING ROUTINE HERE *****/
          {
            printf("\n\n***** FUNCTION 2 GRC = %.2s"
                   " REASON CODE = %c. %.80s",
                wa1.output.ret_code,wa1.output.reject_reason_code,
                wa1.output.msg) ;
            printf
            ("\n%c %.32s %c %.32s ",
                recin.in_boro1,recin.in_street_name1,recin.in_boro2,
                recin.in_street_name2) ;
          }

         if ( (memcmp(wa1.output.ret_code,"01",2)) == 0 )
              /******** INSERT YOUR OWN WARNING HANDLING ROUTINE HERE *****/
          {
            printf("\n\n***** FUNCTION 2 WARNING GRC = %.2s"
                   " REASON CODE = %c. %.80s",
                wa1.output.ret_code,wa1.output.reject_reason_code,

     wa1.output.msg) ;
            printf
            ("\n%c %.32s %c %.32s ",
                recin.in_boro1,recin.in_street_name1,recin.in_boro2,
                recin.in_street_name2) ;
          }

         if ( (memcmp(wa1.output.ret_code,"00",2)) == 0
         ||   (memcmp(wa1.output.ret_code,"01",2)) == 0 )
              /***********************************************************/
              /***** REPLACE CODE BELOW WITH YOUR OWN CODE FOR ***********/
              /***** PROCESSING SUCCESSFUL GEOSUPPORT CALLS          *****/
              /***********************************************************/
          {
           printf("\n\n%c %.32s %c %.32s %.5s %.2s %.3s      %.2s     ",
                recin.in_boro1,recin.in_street_name1,recin.in_boro2,
                recin.in_street_name2,wa2_f2.zip_code,
                wa2_f2.com_dist+1,wa2_f2.police_pre,wa2_f2.com_schl_dist) ;

           temp [0] = wa2_f2.nbr_x_sts ;
           temp [1] = 0;
           i = atoi(temp) ;
           for (j=0; j<i; j++)
           {
                /*******************************************************/
                /* TO GET STREET NAMES FOR INTERSECTING STREET CODES   \*/
                /* MAKE A FUNCTION D CALL:                             \*/
                /*   (1) INITIALIZE WORKAREA 1 TO SPACES               \*/
                /*   (2) SET THE WA1'S FUNCTION CODE FIELD TO D        \*/
                /*   (3) USE THE COMPACT STREET NAMES OPTION TO OBTAIN \*/
                /*       STREET NAMES FORMATTED FOR DISPLAY            \*/
                /*   (4) MOVE THE PACKED BORO AND STREET CODE TO       \*/
                /*       WA1'S INPUT STREET CODE 1 FIELD               \*/
                /*   (5) CALL GBI WITH 1 WORKAREA                      \*/
                /*   (6) CHECK RETURN CODES FOR ERRORS OR WARNINGS     \*/
                /*******************************************************/
            memset(&wa1,' ',sizeof(wa1));
            wa1.input.func_code[0] = 'D' ;
            wa1.input.compact_flag = 'C' ;
            memcpy(wa1.input.PB5SC_1,wa2_f2.x_sts[j],4) ;
            GBI(&wa1);
            if ( (memcmp(wa1.output.ret_code,"00",2)) == 0 )
             {
              /***** INSERT YOUR OWN CODE HERE ***********/
              if (j==0)
                printf(" %.32s",wa1.output.street_name_1);
              else
                printf("\n%128.32s",wa1.output.street_name_1);
             }
            else
              /******** INSERT YOUR OWN ERROR HANDLING ROUTINE HERE *****/
              printf("\n\n***** FUNCTION D GRC = %.2s"
                   " REASON CODE = %c. %.80s",
                wa1.output.ret_code,wa1.output.reject_reason_code,
                wa1.output.msg) ;
           }

          }

       }

     }

    /*
    //LKED.SYSIN   DD *
        INCLUDE DD1(GBI)
    /*
    //LKED.DD1  DD  DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
    //***************************************************************
    //*
    //*  AS OF GEOSUPPORT VERSION 10.0, THE STEPLIB OR JOBLIB
    //*  STATEMENTS OF THE GEOSUPPORT EXECUTION STEP MUST INCLUDE
    //*  THE FOLLOWING TWO CONCATENATED DATA SETS IN THE SPECIFIED
    //*  ORDER:
    //*                A030.GEO.SUPPORT.PDSE.LOADLIB
    //*                A030.GEO.SUPPORT.LOADLIB
    //*
    //***************************************************************
    //GO.STEPLIB  DD  DSN=A030.GEO.SUPPORT.PDSE.LOADLIB,DISP=SHR
    //            DD  DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
    //***************************************************************
    //*
    //*  AS OF GEOSUPPORT VERSION 10.0, DD STATEMENTS FOR GEOSUPPORT
    //*  DATA FILES (E.G. GRID, PAD, ETC) ARE NO LONGER NEEDED AND
    //*  ARE IGNORED.  GEOSUPPORT IS TAILORED TO USE STANDARD
    //*  GEOSUPPORT DATA SETS.  TO USE NON-STANDARD FILES, SEE YOUR
    //*  SYSTEMS PROGRAMMER.
    //*
    //***************************************************************
    //GO.SYSPRINT DD SYSOUT=A
    //GO.INFILE DD *
    1 CHAMBERS ST                      1 HUDSON ST
    1 SIXTH AVE                        1 W. 8 ST
    1 DUANE ST                         1 READE ST
    /*
    //

C SAMPLE PROGRAM #2 – Job Stream - COW

      //CCCC2SRC JOB   YOUR-JOB-CARD-INFORMATION
      //*
      //********************************************************************
      //***  C SAMPLE COW BATCH GEOSUPPORT USER APPLICATION PROGRAM \#2  ****
      //********************************************************************
      //*
      //STEP1 EXEC EDCCLG,
      //      CPARM='SS,OPT,OFFSET,SOURCE,XREF,LIST'
      //COMPILE.SYSPRINT DD SYSOUT=A
      //COMPILE.SYSLIB   DD
      //                 DD
      //                 DD  DSNAME=A030.GEO.COPYLIB,DISP=SHR
      //COMPILE.SYSIN    DD *
         /*****************************************************************/
         /* THIS PROGRAM MAKES FUNCTION 2 AND D CALLS TO GEOSUPPORT USING \*/
         /* TWO BOROS AND TWO STREET NAMES SUPPLIED BY AN INSTREAM FILE.  \*/
         /* FUNCTION 2 RETURNS GEOGRAPHIC INFORMATION FOR AN INTERSECTION.\*/
         /* FUNCTION D TRANSLATES AN INPUT STREET CODE TO A STREET NAME.  \*/
         /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \*/
         /* NOTE: IF THE CROSS STREET NAMES FLAG WERE USED IN THE         \*/
         /*       ORIGINAL CALL TO FUNCTION 2, ALL THE CROSS STREET       \*/
         /*       NAMES WOULD HAVE BEEN RETURNED BY FUNCTION 2.           \*/
         /*****************************************************************/

      #include <stdio.h>
      #include <stdlib.h>
      #include <string.h>

       /*********************************************************************/
       /*** USE OF GEOSUPPORT COPY LIBRARIES (REFERENCED BELOW BY THE     \***/
       /*** #INCLUDE STATEMENTS) IS STRONGLY ENCOURAGED.                  \***/
       /*********************************************************************/
      #include <pac.h>

       /**************   GBI DECLARATION BELOW IS REQUIRED   **************/
         #pragma linkage (GBI,OS)
         long GBI(void \*, ...);

       /***** THE WORK AREA LAYOUTS MUST BE DECLARED USING THE TYPEDEFS \***/
       /***** IN THE GEOSUPPORT COPY FILE.                              \***/
         C_WA1 wa1;
         C_WA2_F2 wa2_f2;

      void main ()
       {

       /***** REPLACE CODE BELOW WITH YOUR OWN INPUT FILE DECLARATION *****/
          FILE \*infile;
          struct tag
            {
             char in_boro1;
             char filler1;
             char in_street_name1     [32];
             char filler2;
             char in_boro2;
             char filler3;
             char in_street_name2     [32];
             char filler4             [11];
            } recin ;
         short int j, i;
         char temp [2];
          if ((infile = fopen("DD:INFILE","rb")) ==  NULL)
      {printf("INFILE Data Set did not open.\n");
               return;}

       /***** REPLACE CODE BELOW WITH YOUR OWN REPRORT LAYOUT  *****/
            printf("\fSAMPLE C PROGRAM \#2 EXECUTION OUTPUT  ");
            printf("\n\n*****----------------- INPUT INTERSECTION ---------");
            printf("-------------***** *****------------ SELECTED OUTPUT ");
            printf("ITEMS -------------*****");
            printf("\n\nB IN-STREET-NAME-1            ");
            printf("     B IN-STREET-NAME-2                   ZIP CD");
            printf(" NYPD-PCT SCHLDST INTERSECTING STREET NAMES");
            printf(  "\r_ ____________________________");
            printf("____ _ ________________________________ _____ \__");
            printf(" ________ _______ _________________________________");

        /*** REPLACE CODE BELOW WITH YOUR OWN INPUT \***/
        while (fread(&recin,1,sizeof(recin),infile))
         {

         /******************************************************************/
         /* TO MAKE A FUNCTION 2 CALL:                                     \*/
         /*   (1) INITIALIZE WORKAREA 1 TO SPACES                          \*/
         /*   (2) SET WA1'S FUNCTION-CODE TO 2                             \*/
         /*   (3) MOVE THE 1ST INPUT BORO TO WA1'S INPUT BORO CODE FIELD   \*/
         /*   (4) MOVE THE 1ST INPUT STREET TO WA1'S INPUT STREET NAME     \*/
         /*       FIELD                                                    \*/
         /*   (5) MOVE THE 2ND INPUT BORO TO WA1'S INPUT BORO CODE 2 FIELD \*/
         /*   (6) MOVE THE 2ND INPUT STREET TO WA1'S INPUT STREET NAME 2   \*/
         /*       FIELD                                                    \*/
         /*   (7) CALL GBI WITH 2 WORKAREAS                                \*/
         /*   (8) CHECK RETURN CODES FOR ERRORS OR WARNINGS                \*/
         /******************************************************************/

           memset(&wa1,' ',sizeof(wa1));
           memcpy(wa1.input.func_code,"2 ",2);
           wa1.input.sti??(0??).boro = recin.in_boro1 ;
           memcpy(wa1.input.sti??(0??).Street_name,recin.in_street_name1,32);
           wa1.input.sti??(1??).boro = recin.in_boro2 ;
           memcpy(wa1.input.sti??(1??).Street_name,recin.in_street_name2,32);
           wa1.input.platform_ind = 'C';    /* Tells Geosupport that you \*/
                                            /* are using the character   \*/
                                            /* only work areas           \*/
           GBI(&wa1,&wa2_f2);

           if ( (memcmp(wa1.output.ret_code,"01",2)) > 0
           ||   (memcmp(wa1.output.ret_code,"00",2)) < 0 )
                /******** INSERT YOUR OWN ERROR HANDLING ROUTINE HERE *****/
            {
              printf("\n\n***** FUNCTION 2 GRC = %.2s"
                     " REASON CODE = %c. %.80s",
                  wa1.output.ret_code,wa1.output.reason_code,
                  wa1.output.msg) ;
              printf
              ("\n%c %.32s %c %.32s ",
                  recin.in_boro1,recin.in_street_name1,recin.in_boro2,
                  recin.in_street_name2) ;
            }

           if ( (memcmp(wa1.output.ret_code,"01",2)) == 0 )
                /******** INSERT YOUR OWN WARNING HANDLING ROUTINE HERE *****/
            {
              printf("\n\n***** FUNCTION 2 WARNING GRC = %.2s"


                " REASON CODE = %c. %.80s",
                  wa1.output.ret_code,wa1.output.reason_code,
                  wa1.output.msg) ;
              printf
              ("\n%c %.32s %c %.32s ",
                  recin.in_boro1,recin.in_street_name1,recin.in_boro2,
                  recin.in_street_name2) ;
            }

           if ( (memcmp(wa1.output.ret_code,"00",2)) == 0
           ||   (memcmp(wa1.output.ret_code,"01",2)) == 0 )
                /***********************************************************/
                /***** REPLACE CODE BELOW WITH YOUR OWN CODE FOR ***********/
                /***** PROCESSING SUCCESSFUL GEOSUPPORT CALLS          *****/
                /***********************************************************/
            {
             printf("\n\n%c %.32s %c %.32s %.5s %.2s %.3s      %.2s     ",
                  recin.in_boro1,recin.in_street_name1,recin.in_boro2,
                  recin.in_street_name2,wa2_f2.zip_code,
                  wa2_f2.com_dist+1,wa2_f2.police_pre,wa2_f2.com_schl_dist) ;

             temp [0] = wa2_f2.inter.nbr_sts ;
             temp [1] = 0;
             i = atoi(temp) ;
             for (j=0; j<i; j++)
             {
                  /*******************************************************/
                  /* TO GET STREET NAMES FOR INTERSECTING STREET CODES   \*/
                  /* MAKE A FUNCTION D CALL:                             \*/
                  /*   (1) INITIALIZE WORKAREA 1 TO SPACES               \*/
                  /*   (2) SET THE WA1'S FUNCTION CODE FIELD TO D        \*/
                  /*   (3) USE THE COMPACT STREET NAMES OPTION TO OBTAIN \*/
                  /*       STREET NAMES FORMATTED FOR DISPLAY            \*/
                  /*   (4) MOVE THE PACKED BORO AND STREET CODE TO       \*/
                  /*       WA1'S INPUT STREET CODE 1 FIELD               \*/
                  /*   (5) CALL GBI WITH 1 WORKAREA                      \*/
                  /*   (6) CHECK RETURN CODES FOR ERRORS OR WARNINGS     \*/
                  /*******************************************************/
              memset(&wa1,' ',sizeof(wa1));
              wa1.input.func_code[0] = 'D' ;
              wa1.input.st_name_norm = 'C' ;
              wa1.input.platform_ind = 'C';
              wa1.input.sti??(0??).boro = wa2_f2.inter.B5SC??(j??)??(0??);
              memcpy(wa1.input.sti??(0??).SC10,wa2_f2.inter.B5SC??(j??)+1,5);
              GBI(&wa1);
              if ( (memcmp(wa1.output.ret_code,"00",2)) == 0 )
               {
                /***** INSERT YOUR OWN CODE HERE ***********/
                if (j==0)
                  printf(" %.32s",wa1.output.sto??(0??).Street_name);
                else
                  printf("\n%128.32s",wa1.output.sto??(0??).Street_name);
               }
              else
                /******** INSERT YOUR OWN ERROR HANDLING ROUTINE HERE *****/
                printf("\n\n***** FUNCTION D GRC = %.2s"
                     " REASON CODE = %c. %.80s",
                  wa1.output.ret_code,wa1.output.reason_code,
                  wa1.output.msg) ;
             }


           }

         }

       }
      /*
      //LKED.SYSIN   DD *
          INCLUDE DD1(GBI)
      /*
      //LKED.DD1  DD  DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
      //***************************************************************
      //*
      //*  AS OF GEOSUPPORT VERSION 10.0, THE STEPLIB OR JOBLIB
      //*  STATEMENTS OF THE GEOSUPPORT EXECUTION STEP MUST INCLUDE
      //*  THE FOLLOWING TWO CONCATENATED DATA SETS IN THE SPECIFIED
      //*  ORDER:
      //*                A030.GEO.SUPPORT.PDSE.LOADLIB
      //*                A030.GEO.SUPPORT.LOADLIB
      //*
      //***************************************************************
      //GO.STEPLIB  DD  DSN=A030.GEO.SUPPORT.PDSE.LOADLIB,DISP=SHR
      //            DD  DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
      //***************************************************************
      //*
      //*  AS OF GEOSUPPORT VERSION 10.0, DD STATEMENTS FOR GEOSUPPORT
      //*  DATA FILES (E.G. GRID, PAD, ETC) ARE NO LONGER NEEDED AND
      //*  ARE IGNORED.  GEOSUPPORT IS TAILORED TO USE STANDARD
      //*  GEOSUPPORT DATA SETS.  TO USE NON-STANDARD FILES, SEE YOUR
      //*  SYSTEMS PROGRAMMER.
      //*
      //***************************************************************
      //GO.SYSPRINT DD SYSOUT=A
      //GO.INFILE DD *
      1 CHAMBERS ST                      1 HUDSON ST
      1 SIXTH AVE                        1 W. 8 ST
      1 DUANE ST                         1 READE ST
      /*
      //

SAMPLE C PROGRAM #2 EXECUTION OUTPUT

       *****----------------- INPUT INTERSECTION ----------------------***** *****------------ SELECTED OUTPUT ITEMS -------------*****

       B IN-STREET-NAME-1                 B IN-STREET-NAME-2                   ZIP CD NYPD-PCT SCHLDST INTERSECTING STREET NAMES
       \- -------------------------------- - -------------------------------- ----- -- -------- ------- ---------------------------------

       1 CHAMBERS ST                      1 HUDSON ST                        10007 01 001      02      CHAMBERS STREET
                                                                                                       HUDSON STREET
                                                                                                       WEST BROADWAY

       1 SIXTH AVE                        1 W. 8 ST                          10014 02 006      02      6 AVENUE
                                                                                                       GREENWICH AVENUE
                                                                                                       WEST 8 STREET

       ***** FUNCTION 2 GRC = 62 REASON CODE =  . READE STREET & DUANE STREET DO NOT INTERSECT
       1 DUANE ST                         1 READE ST

NATURAL SAMPLE PROGRAM #1

‑ Program Source Code - MSW
- Program Source Code - COW
- Input Job Stream
- Output Report

NATURAL SAMPLE PROGRAM #1 – Program Source- MSW

          0010 ************************************************************************
           0020 * PGM NAME: GEOBUPG1    DATE: 08-18-98                                 *
           0030 *                                                                      *
           0040 * THIS PROGRAM MAKES FUNCTION 1 AND D CALLS TO GEOSUPPORT USING        *
           0050 * BORO, HOUSENUMBER, & STREET NAME SUPPLIED BY AN INSTREAM FILE.       *
           0060 * FUNCTION 1 RETURNS GEOGRAPHIC INFORMATION FOR AN ADDRESS.            *
           0070 * FUNCTION D TRANSLATES AN INPUT STREET CODE TO A STREET NAME.         *
           0080 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *  *
           0090 *          NOTE: IF THE CROSS STREET NAMES FLAG WERE USED IN THE       *
           0100 *                ORIGINAL CALL TO FUNCTION 1, ALL THE CROSS STREET     *
           0110 *                NAMES WOULD HAVE BEEN RETURNED BY FUNCTION 1.         *
           0120 ************************************************************************
           0130 *                                                                      *
           0140 ************************************************************************
           0150 * USE OF GEOSUPPORT LDA (REFERENCED BELOW BY THE LOCAL USING STATEMENT)*
           0160 * IS STRONGLY ENCOURAGED.                                              *
           0170 ************************************************************************
           0180 DEFINE DATA
           0190  LOCAL USING GEOLW1
           0200  LOCAL USING GEOLW2
           0210 *
           0220 ***** REPLACE CODE BELOW WITH YOUR OWN INPUT FILE DECLARATION      *****
           0230  LOCAL
           0240   01 #USER-INPUT
           0250      02 #USER-BORO                    (A1)
           0260      02 #FILLER1                      (A1)
           0270      02 #USER-HSE-NUM                 (A12)
           0280      02 #FILLER2                      (A1)
           0290      02 #USER-STRT-NAME               (A32)
           0300      02 #FILLER3                      (A33)
           0310 *
           0320   01 #SAVE-RET-CODE                   (A2)
           0330   01 #OUT-STREET-1-SNL25              (A25)
           0340   01 #OUT-STREET-2-SNL25              (A25)
           0350   01 #OUT-ERROR-MESSAGE-77            (A77)
           0360 *
           0370 END-DEFINE
           0380 *
           0390 FORMAT LS=133 PS=65
           0400 *
           0410 ***** REPLACE CODE BELOW WITH YOUR OWN REPORT LAYOUT               *****
           0420 WRITE NOTITLE
           0430  1T'SAMPLE NATURAL PROGRAM #1 EXECUTION OUTPUT'//
           0440  1T'*****---------- INPUT ADDRESS ------------*****'
           0450  49T'*****--------------------- SELECTED OUTPUT'
           0460  92T'ITEMS -----------------------*****'//
           0470  1T'B HOUSE NUMBER IN-STREET-NAME                     ZIP CD'
           0480  58T'NYPD-PCT SCHLDST LOW CROSS STREET         '
           0490  101T'HIGH CROSS STREET        '/
           0500  1T'- ------------ -------------------------------- ----- --'
           0510  58T'-------- ------- -------------------------'
           0520  101T'-------------------------'/
           0530 *
           0540 READ WORK FILE 01 #USER-INPUT
           0550  PERFORM FN1-PROCESS
           0560 END-WORK
           0570 *
           0580 DEFINE SUBROUTINE FN1-PROCESS
           0590 ************************************************************************
           0600 * TO MAKE A FUNCTION 1 CALL:                                           *
           0610 *   (1) INITIALIZE WORKAREA 1 TO SPACES                                *
           0620 *   (2) SET WA1'S FUNCTION CODE FIELD TO 1                             *
           0630 *   (3) MOVE THE INPUT BORO TO WA1'S INPUT BORO CODE FIELD             *
           0640 *   (4) MOVE THE INPUT HOUSE NUMBER TO WA1'S INPUT HOUSE NUMBER FIELD  *
           0650 *   (5) MOVE THE INPUT STREET TO WA1'S INPUT STREET NAME FIELD         *
           0660 *   (6) CALL GBI WITH 2 WORKAREAS                                      *
           0670 *   (7) CHECK RETURN CODES FOR ERRORS OR WARNINGS                      *
           0680 ************************************************************************
           0690 ************************************************************************
           0700 * AS OF GEOSUPPORT 10.1,                                               *
           0710 *    TO RECEIVE ROADBED-SPECIFIC INFORMATION,                          *
           0720 *    SET THE ROADBED REQUEST SWITCH TO 'R', AS FOLLOWS:                *
           0730 *        MOVE 'R' TO GEO-WA1-IN-ROADBED-REQ-SWITCH.                    *
           0740 ************************************************************************
           0750  RESET GEOLW1
           0760  MOVE '1 ' TO GEO-WA1-IN-FUNCTION-CODE
           0770  MOVE #USER-BORO TO GEO-WA1-IN-BORO
           0780  MOVE #USER-HSE-NUM TO GEO-WA1-IN-HOUSENUM
           0790  MOVE #USER-STRT-NAME TO GEO-WA1-IN-STREET-1
           0800 *
           0810  CALL 'GBI' W1NAT W2NAT
           0820 *
           0830  IF GEO-WA1-OUT-RETURN-CODE NOT = '00' AND
           0840     GEO-WA1-OUT-RETURN-CODE NOT = '01'
           0850 *
           0860 ***** REPLACE YOUR OWN ERROR HANDLING ROUTINE HERE                 *****
           0870 *
           0880   MOVE GEO-WA1-OUT-ERROR-MESSAGE TO #OUT-ERROR-MESSAGE-77
           0890   WRITE NOTITLE
           0900    1T #USER-BORO 3T #USER-HSE-NUM 16T #USER-STRT-NAME
           0910    49T '*** FUNCTION 1 GRC =' GEO-WA1-OUT-RETURN-CODE
           0920    73T 'REASON CODE =' GEO-WA1-OUT-REASON-CODE /
           0930    49T '\***' #OUT-ERROR-MESSAGE-77 /
           0940  ELSE
           0950   IF GEO-WA1-OUT-RETURN-CODE = '01'
           0960 *
           0970 ***** REPLACE YOUR OWN WARNING HANDLING ROUTINE HERE               *****
           0980 *
           0990    MOVE GEO-WA1-OUT-ERROR-MESSAGE TO #OUT-ERROR-MESSAGE-77
           1000    WRITE NOTITLE
           1010     1T #USER-BORO 3T #USER-HSE-NUM 16T #USER-STRT-NAME
           1020     49T '*** FUNCTION 1 WARNING, GRC =' GEO-WA1-OUT-RETURN-CODE
           1030     82T 'REASON CODE =' GEO-WA1-OUT-REASON-CODE /
           1040     49T '\***' #OUT-ERROR-MESSAGE-77
           1050   END-IF
           1060  END-IF
           1070 *
           1080  IF GEO-WA1-OUT-RETURN-CODE = '00' OR
           1090     GEO-WA1-OUT-RETURN-CODE = '01'
           1100   MOVE GEO-WA1-OUT-RETURN-CODE TO #SAVE-RET-CODE
           1110 *
           1120 ***** REPLACE CODE BELOW WITH YOUR OWN CODE FOR                    *****
           1130 ***** PROCESSING SUCCESSFUL GEOSUPPORT FUNCTION 1 CALL             *****
           1140 *
           1150 ************************************************************************
           1160 * THIS PROGRAM ASSUMES THERE EXISTS AT LEAST ONE HIGH AND              *
           1170 * ONE LOW CROSS STREET.  TO GET THE STREET NAMES OF THE                *
           1180 * FIRST-LISTED HIGH AND FIRST-LISTED LOW CROSS STREETS                 *
           1190 * FROM THE HIGH AND LOW STREET CODE LISTS CALL FUNCTION D:             *
           1200 *   (1) INITIALIZE WORKAREA 1 TO SPACES                                *
           1210 *   (2) SET WA1'S FUNCTION CODE FIELD TO D                             *
           1220 *   (3) SET WA1'S STREET NAME LENGTH FIELD TO DESIRED                  *
           1230 *       VALUE (IN THIS CASE 25 BECAUSE THE REPORT LINE                 *
           1240 *              HAS SPACE FOR ONLY 25 CHARACTERS)                       *
           1250 *   (4) USE THE COMPACT STREET NAMES OPTION TO OBTAIN                  *
           1260 *       STREET NAMES FORMATTED FOR DISPLAY                             *
           1270 *   (5) MOVE WA2'S LOW PBSC FIELD TO WA1'S INPUT STREET CODE 1 FIELD   *
           1280 *   (6) MOVE WA2'S HIGH PBSC FIELD TO WA1'S INPUT STREET CODE 2 FIELD  *
           1290 *   (7) CALL GBI WITH 1 WORKAREA                                       *
           1300 *   (8) CHECK RETURN CODES FOR ERRORS OR WARNINGS                      *
           1310 ************************************************************************
           1320   RESET GEOLW1
           1330   MOVE 'D ' TO GEO-WA1-IN-FUNCTION-CODE
           1340   MOVE 'C' TO GEO-WA1-IN-COMPACT-NAME-FLAG
           1350   MOVE '25' TO GEO-WA1-IN-SNL
           1360   MOVE GEO-WA2-FN1-LOW-PBSC(1) TO GEO-WA1-IN-STREETCODE-1
           1370   MOVE GEO-WA2-FN1-HI-PBSC(1) TO GEO-WA1-IN-STREETCODE-2
           1380 *
           1390   CALL 'GBI' W1NAT
           1400 *
           1410   IF GEO-WA1-OUT-RETURN-CODE = '00'
           1420    MOVE GEO-WA1-OUT-STREET-1 TO #OUT-STREET-1-SNL25
           1430    MOVE GEO-WA1-OUT-STREET-2 TO #OUT-STREET-2-SNL25
           1440 *
           1450 ***** REPLACE CODE BELOW WITH YOUR OWN CODE FOR                    *****
           1460 ***** PROCESSING SUCCESSFUL GEOSUPPORT CALLS                       *****
           1470 *
           1480    IF #SAVE-RET-CODE = '01' RESET #USER-BORO
           1490     #USER-HSE-NUM #USER-STRT-NAME
           1500    END-IF
           1510    WRITE NOTITLE
           1520     1T #USER-BORO 3T #USER-HSE-NUM 16T #USER-STRT-NAME
           1530     49T GEO-WA2-FN1-ZIP 55T GEO-WA2-FN1-COMDIST-NUM
           1540     58T GEO-WA2-FN1-POL-PRECINCT 67T GEO-WA2-FN1-SCHOOLDIST
           1550     75T #OUT-STREET-1-SNL25 101T #OUT-STREET-2-SNL25 /
           1560   ELSE
           1570 *
           1580 ***** REPLACE YOUR OWN ERROR HANDLING ROUTINE HERE                 *****
           1590 *
           1600    MOVE GEO-WA1-OUT-ERROR-MESSAGE TO #OUT-ERROR-MESSAGE-77
           1610    WRITE NOTITLE
           1620     1T #USER-BORO 3T #USER-HSE-NUM 16T #USER-STRT-NAME
           1630     49T '*** FUNCTION D GRC =' GEO-WA1-OUT-RETURN-CODE
           1640     73T 'REASON CODE =' GEO-WA1-OUT-REASON-CODE /
           1650     49T '\***' #OUT-ERROR-MESSAGE-77 /
           1660   END-IF
           1670  END-IF
           1680 *
           1690  END-SUBROUTINE
           1700  END

NATURAL SAMPLE PROGRAM #1 – Program Source code - COW

           0010 ************************************************************************
           0020 * PGM NAME: GEOBUPGA    DATE: 08-18-98         MODIFIED : 08-28-06     *
           0030 *                                                                      *
           0040 * THIS PROGRAM MAKES FUNCTION 1 AND D CALLS TO GEOSUPPORT USING        *
           0050 * BORO, HOUSENUMBER, & STREET NAME SUPPLIED BY AN INSTREAM FILE.       *
           0060 * FUNCTION 1 RETURNS GEOGRAPHIC INFORMATION FOR AN ADDRESS.            *
           0070 * FUNCTION D TRANSLATES AN INPUT STREET CODE TO A STREET NAME.         *
           0080 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *  *
           0090 *          NOTE: IF THE CROSS STREET NAMES FLAG WERE USED IN THE       *
           0100 *                ORIGINAL CALL TO FUNCTION 1, ALL THE CROSS STREET     *
           0110 *                NAMES WOULD HAVE BEEN RETURNED BY FUNCTION 1.         *
           0120 ************************************************************************
           0130 *                                                                      *
           0140 ************************************************************************
           0150 * USE OF GEOSUPPORT LDA (REFERENCED BELOW BY THE LOCAL USING STATEMENT)*
           0160 * IS STRONGLY ENCOURAGED.                                              *
           0170 ************************************************************************
           0180 DEFINE DATA
           0190  LOCAL USING GEOLP1
           0200  LOCAL USING GEOLP2
           0210 *
           0220 ***** REPLACE CODE BELOW WITH YOUR OWN INPUT FILE DECLARATION      *****
           0230  LOCAL
           0240   01 #USER-INPUT
           0250      02 #USER-BORO                    (A1)
           0260      02 #FILLER1                      (A1)
           0270      02 #USER-HSE-NUM                 (A12)
           0280      02 #FILLER2                      (A1)
           0290      02 #USER-STRT-NAME               (A32)
           0300      02 #FILLER3                      (A33)
           0310 *
           0320   01 #SAVE-RET-CODE                   (A2)
           0330   01 #OUT-STREET-1-SNL25              (A25)
           0340   01 #OUT-STREET-2-SNL25              (A25)
           0350   01 #OUT-ERROR-MESSAGE-77            (A77)
           0360 *
           0370   01 #B5SC (A6)
           0380   01 REDEFINE #B5SC
           0390      02 #B5SC-BORO (A1)
           0400      02 #B5SC-5SC (A5)
           0410 *
           0420 END-DEFINE
           0430 *
           0440 FORMAT LS=133 PS=65
           0450 *
           0460 ***** REPLACE CODE BELOW WITH YOUR OWN REPORT LAYOUT               *****
           0470 WRITE NOTITLE
           0480  1T'SAMPLE NATURAL PROGRAM \#1 EXECUTION OUTPUT'//
           0490  1T'*****---------- INPUT ADDRESS ------------*****'
           0500  49T'*****--------------------- SELECTED OUTPUT'
           0510  92T'ITEMS -----------------------*****'//
           0520  1T'B HOUSE NUMBER IN-STREET-NAME                     ZIP CD'
           0530  58T'NYPD-PCT SCHLDST LOW CROSS STREET         '
           0540  101T'HIGH CROSS STREET        '/
           0550  1T'- ------------ -------------------------------- ----- --'
           0560  58T'-------- ------- -------------------------'
           0570  101T'-------------------------'/
           0580 *
           0590 READ WORK FILE 01 #USER-INPUT 0600  PERFORM FN1-PROCESS
           0610 END-WORK
           0620 *
           0630 DEFINE SUBROUTINE FN1-PROCESS
           0640 ************************************************************************
           0650 * TO MAKE A FUNCTION 1 CALL:                                           *
           0660 *   (1) INITIALIZE WORKAREA 1 TO SPACES                                *
           0670 *   (2) SET WA1'S FUNCTION CODE FIELD TO 1                             *
           0680 *   (3) SET THE PLATFORM INDICATOR SWITCH (NON-IBM-MAINFRAME)          *
           0690 *       TO USE CHARACTER-ONLY WORK AREA (COWS)                         *
           0700 *   (4) MOVE THE INPUT BORO TO WA1'S INPUT BORO CODE FIELD             *
           0710 *   (5) MOVE THE INPUT HOUSE NUMBER TO WA1'S INPUT HOUSE NUMBER FIELD  *
           0720 *   (6) MOVE THE INPUT STREET TO WA1'S INPUT STREET NAME FIELD         *
           0730 *   (7) CALL GBI WITH 2 WORKAREAS                                      *
           0740 *   (8) CHECK RETURN CODES FOR ERRORS OR WARNINGS                      *
           0750 ************************************************************************
           0760 ************************************************************************
           0770 * AS OF GEOSUPPORT 10.1,                                               *
           0780 *    TO RECEIVE ROADBED-SPECIFIC INFORMATION,                          *
           0790 *    SET THE ROADBED REQUEST SWITCH TO 'R', AS FOLLOWS:                *
           0800 *        MOVE 'R' TO PIWA1-IN-ROADBED-REQ-SWITCH.                      *
           0810 ************************************************************************
           0820  RESET GEOLP1
           0830  MOVE '1 ' TO PIWA1-IN-FUNCTION-CODE
           0840  MOVE 'C' TO PIWA1-IN-PLATFORM-INDICATOR
           0850  MOVE #USER-BORO TO PIWA1-IN-BORO-1
           0860  MOVE #USER-HSE-NUM TO PIWA1-IN-HOUSENUM-DISPLAY
           0870  MOVE #USER-STRT-NAME TO PIWA1-IN-STREET-1
           0880 *
           0890  CALL 'GBI' P1NAT P2NAT
           0900 *
           0910  IF PIWA1-OUT-RETURN-CODE NOT = '00' AND
           0920     PIWA1-OUT-RETURN-CODE NOT = '01'
           0930 *
           0940 ***** REPLACE YOUR OWN ERROR HANDLING ROUTINE HERE                 *****
           0950 *
           0960   MOVE PIWA1-OUT-ERROR-MESSAGE TO #OUT-ERROR-MESSAGE-77
           0970   WRITE NOTITLE
           0980    1T #USER-BORO 3T #USER-HSE-NUM 16T #USER-STRT-NAME
           0990    49T '*** FUNCTION 1 GRC =' PIWA1-OUT-RETURN-CODE
           1000    73T 'REASON CODE =' PIWA1-OUT-REASON-CODE /
           1010    49T '\***' #OUT-ERROR-MESSAGE-77 /
           1020  ELSE
           1030   IF PIWA1-OUT-RETURN-CODE = '01'
           1040 *
           1050 ***** REPLACE YOUR OWN WARNING HANDLING ROUTINE HERE               *****
           1060 *
           1070    MOVE PIWA1-OUT-ERROR-MESSAGE TO #OUT-ERROR-MESSAGE-77
           1080    WRITE NOTITLE
           1090     1T #USER-BORO 3T #USER-HSE-NUM 16T #USER-STRT-NAME
           1100     49T '*** FUNCTION 1 WARNING, GRC =' PIWA1-OUT-RETURN-CODE
           1110     82T 'REASON CODE =' PIWA1-OUT-REASON-CODE /
           1120     49T '\***' #OUT-ERROR-MESSAGE-77
           1130   END-IF
           1140  END-IF
           1150 *

           1160  IF PIWA1-OUT-RETURN-CODE = '00' OR
           1170     PIWA1-OUT-RETURN-CODE = '01'
           1180   MOVE PIWA1-OUT-RETURN-CODE TO #SAVE-RET-CODE
           1190 *
           1200 ***** REPLACE CODE BELOW WITH YOUR OWN CODE FOR                    *****
           1210 ***** PROCESSING SUCCESSFUL GEOSUPPORT FUNCTION 1 CALL             *****
           1220 *
           1230 ************************************************************************
           1240 * THIS PROGRAM ASSUMES THERE EXISTS AT LEAST ONE HIGH AND              *
           1250 * ONE LOW CROSS STREET.  TO GET THE STREET NAMES OF THE                *
           1260 * FIRST-LISTED HIGH AND FIRST-LISTED LOW CROSS STREETS                 *
           1270 * FROM THE HIGH AND LOW STREET CODE LISTS CALL FUNCTION D:             *
           1280 *   (1) INITIALIZE WORKAREA 1 TO SPACES                                *
           1290 *   (2) SET WA1'S FUNCTION CODE FIELD TO D                             *
           1300 *   (3) SET THE PLATFORM INDICATOR SWITCH (NON-IBM-MAINFRAME)          *
           1310 *       TO USE CHARACTER-ONLY WORK AREA (COWS)                         *
           1320 *   (4) SET WA1'S STREET NAME LENGTH FIELD TO DESIRED                  *
           1330 *       VALUE (IN THIS CASE 25 BECAUSE THE REPORT LINE                 *
           1340 *              HAS SPACE FOR ONLY 25 CHARACTERS)                       *
           1350 *   (5) USE THE COMPACT STREET NAMES OPTION TO OBTAIN                  *
           1360 *       STREET NAMES FORMATTED FOR DISPLAY                             *
           1370 *   (6) MOVE WA2'S LOW B5SC FIELD TO WA1'S INPUT STREET CODE 1 FIELD   *
           1380 *   (7) MOVE WA2'S HIGH B5SC FIELD TO WA1'S INPUT STREET CODE 2 FIELD  *
           1390 *   (8) CALL GBI WITH 1 WORKAREA                                       *
           1400 *   (9) CHECK RETURN CODES FOR ERRORS OR WARNINGS                      *
           1410 ************************************************************************
           1420   RESET GEOLP1
           1430   MOVE 'C' TO PIWA1-IN-PLATFORM-INDICATOR
           1440   MOVE 'D ' TO PIWA1-IN-FUNCTION-CODE
           1450   MOVE '25' TO PIWA1-IN-SNL
           1460   MOVE 'C' TO PIWA1-IN-SN-NORM-FORMAT
           1470   MOVE PIWA2-FN1-LOW-B5SC(1) TO #B5SC
           1480   MOVE #B5SC-BORO TO PIWA1-IN-BORO-1
           1490   MOVE #B5SC-5SC TO PIWA1-IN-10SC-1
           1500   MOVE PIWA2-FN1-HI-B5SC(1) TO #B5SC
           1510   MOVE #B5SC-BORO TO PIWA1-IN-BORO-2
           1520   MOVE #B5SC-5SC TO PIWA1-IN-10SC-2
           1530 *
           1540   CALL 'GBI' P1NAT
           1550 *
           1560   IF PIWA1-OUT-RETURN-CODE = '00'
           1570    MOVE PIWA1-OUT-STREET-1 TO #OUT-STREET-1-SNL25
           1580    MOVE PIWA1-OUT-STREET-2 TO #OUT-STREET-2-SNL25
           1590 *
           1600 ***** REPLACE CODE BELOW WITH YOUR OWN CODE FOR                    *****
           1610 ***** PROCESSING SUCCESSFUL GEOSUPPORT CALLS                       *****
           1620 *
           1630    IF #SAVE-RET-CODE = '01' RESET #USER-BORO
           1640     #USER-HSE-NUM #USER-STRT-NAME
           1650    END-IF
           1660    WRITE NOTITLE
           1670     1T #USER-BORO 3T #USER-HSE-NUM 16T #USER-STRT-NAME
           1680     49T PIWA2-FN1-ZIP 55T PIWA2-FN1-COM-DIST-NUM
           1690     58T PIWA2-FN1-POL-PRECINCT 67T PIWA2-FN1-SCHL-DIST
           1700     75T #OUT-STREET-1-SNL25 101T #OUT-STREET-2-SNL25 /
           1710   ELSE
           1720 *
           1730 ***** REPLACE YOUR OWN ERROR HANDLING ROUTINE HERE                 *****
           1740 *
           1750    MOVE PIWA1-OUT-ERROR-MESSAGE TO #OUT-ERROR-MESSAGE-77
           1760    WRITE NOTITLE
           1770     1T #USER-BORO 3T #USER-HSE-NUM 16T #USER-STRT-NAME
           1780     49T '*** FUNCTION D GRC =' PIWA1-OUT-RETURN-CODE
           1790     73T 'REASON CODE =' PIWA1-OUT-REASON-CODE /
           1800     49T '\***' #OUT-ERROR-MESSAGE-77 /
           1810   END-IF
           1820  END-IF
           1830 *
           1840  END-SUBROUTINE
           1850  END

NATURAL SAMPLE PROGRAM #1- Job Stream

            //GEOBUPG1 JOB    YOUR-JOB-CARD-INFORMATION
            //*      
            //**********************************************************************
            //***  NATURAL SAMPLE BATCH GEOSUPPORT USER APPLICATION PROGRAM \#1   ***
            //***                       MSW FORMAT                               ***
            //**********************************************************************
            //S1  EXEC NT3MPM1M,REGION=7000K
            //* * * * * * *  * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
            //*                                                                  \*//
            //*  AS OF GEOSUPPORT VERSION 10.0,                                  \*//
            //*  THE STEPLIB (OR JOBLIB) OF THE GEOSUPPORT EXECUTION STEP        \*//
            //*  MUST INCLUDE THE FOLLOWING TWO CONCATENATED DATSETS:            \*//
            //*       A030.GEO.SUPPORT.PDSE.LOADLIB                              \*//
            //*       A030.GEO.SUPPORT.LOADLIB                                   \*//
            //*                                                                  \*//
            //* * * * * * *  * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
            //NAT.STEPLIB DD
            //            DD
            //            DD DSN=A030.GEO.SUPPORT.PDSE.LOADLIB,DISP=SHR
            //            DD DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
            //SYSPRINT    DD SYSOUT=A
            //SYSOUT      DD SYSOUT=A,DCB=(LRECL=132)
            //CMPRINT     DD SYSOUT=A,DCB=(LRECL=132)
            //CMWKF01     DD *
            1,22          ,READE ST
            1,500         ,DUANE ST
            1,2-4         ,BROADWAY
            4,165-100     ,BAISLEY BLVD
            4,165-1000    ,BAISLEY BLVD
            //CMSYNIN     DD *
            Your_Application_ID,Your-User_ID
            %*
            Your-Password
            L L GEOLW1     [For COW: GEOLP1]
            L L GEOLW2     [For COW: GEOLP2]
            L P GEOBUPG1   [For COW Sample:  GEOBUPGA]
            GEOBUPG1       [For COW Sample:  GEOBUPGA}    
            FIN
            //INCLIB      DD DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
            //* * * * * * *  * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
            //*                                                                  \*//
            //*  AS OF GEOSUPPORT VERSION 10.0,                                  \*//
            //*  DD STATEMENTS FOR GEOSUPPORT DATA FILES (E.G. GRID, PAD,        \*//
            //*  ETC) ARE NO LONGER NEEDED AND ARE IGNORED. GEOSUPPORT           \*//
            //*  IS TAILORED TO USE STANDARD GEOSUPPORT DATA SET NAMES.          \*//
            //*  TO USE NON-STANDARD FILES, SEE YOUR SYSTEMS PROGRAMMER.         \*//
            //*                                                                  \*//
            //* * * * * * *  * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
            //SYSUDUMP    DD DUMMY
            //

SAMPLE NATURAL PROGRAM #1 EXECUTION OUTPUT

             *****---------- INPUT ADDRESS ------------***** *****--------------------- SELECTED OUTPUT ITEMS -----------------------*****

             B HOUSE NUMBER IN-STREET-NAME                     ZIP CD NYPD-PCT SCHLDST LOW CROSS STREET          HIGH CROSS STREET
             \- ------------ -------------------------------- ----- -- -------- ------- ------------------------- -------------------------

             1 22           READE ST                         10007 01 005      02      ELK STREET                BROADWAY

             1 500          DUANE ST                         *** FUNCTION 1 GRC = 42 REASON CODE =
                                                             *** ADDRESS NUMBER OUT OF RANGE

             1 2-4          BROADWAY                         *** FUNCTION 1 WARNING, GRC = 01 REASON CODE = 1
                                                             *** ADDR NUMBER ALTERED: RANGE ASSUMED. USING DIGITS BEFORE DASH ONLY
                                                             10004 01 001      02      STONE STREET              BOWLING GREEN

             4 165-100      BAISLEY BLVD                     11434 12 113      28      GUY R BREWER BOULEVARD    BEDELL STREET

             4 165-1000     BAISLEY BLVD                     *** FUNCTION 1 GRC = 13 REASON CODE = 2
                                                             *** ADDRESS NBR 165-1000  HAS MORE THAN 3 DIGITS AFTER THE DASH.

NATURAL SAMPLE PROGRAM #2

‑ Program Source Code - MSW
- Program Source Code - COW
- Input Job Stream
- Output Report

NATURAL SAMPLE PROGRAM #2 – Program Source Code - MSW

             0010************************************************************************
             0020 * PGM NAME: GEOBUPG2    DATE: 08-18-98                                 *
             0030 *                                                                      *
             0040 * THIS PROGRAM MAKES FUNCTION 2 AND D CALLS TO GEOSUPPORT USING TWO    *
             0050 * BOROS AND TWO STREET NAMES SUPPLIED BY AN INSTREAM FILE.             *
             0060 * FUNCTION 2 RETURNS GEOGRAPHIC INFORMATION FOR AN INTERSECTION.       *
             0070 * FUNCTION D TRANSLATES AN INPUT STREET CODE TO A STREET NAME.         *
             0080 ************************************************************************
             0090 *          NOTE: IF THE CROSS STREET NAMES FLAG WERE USED IN THE       *
             0100 *                ORIGINAL CALL TO FUNCTION 1, ALL THE CROSS STREET     *
             0110 *                NAMES WOULD HAVE BEEN RETURNED BY FUNCTION 1.         *
             0120 ************************************************************************
             0130 *
             0140 ************************************************************************
             0150 * USE OF GEOSUPPORT LDA (REFERENCED BELOW BY THE LOCAL USING STATEMENT)*
             0160 * IS STRONGLY ENCOURAGED.                                              *
             0170 ************************************************************************
             0180 *
             0190 DEFINE DATA
             0200  LOCAL USING GEOLW1
             0210  LOCAL USING GEOLW2
             0220 *
             0230 ***** REPLACE CODE BELOW WITH YOUR OWN INPUT DATA DECLARATION      *****
             0240 *
             0250  LOCAL
             0260   01 #USER-INPUT
             0270      02 #USER-BORO1                   (A1)
             0280      02 #FILLER1                      (A1)
             0290      02 #USER-STRT-NAME1              (A32)
             0300      02 #FILLER2                      (A1)
             0310      02 #USER-BORO2                   (A1)
             0320      02 #FILLER3                      (A1)
             0330      02 #USER-STRT-NAME2              (A32)
             0340      02 #FILLER4                      (A11)
             0350 *
             0360   01 #INDEX                           (I1)
             0370 *
             0380 END-DEFINE
             0390 *
             0400 FORMAT LS=133 PS=65
             0410 *
             0420 ***** REPLACE CODE BELOW WITH YOUR OWN REPORT LAYOUT               *****
             0430 *
             0440 WRITE NOTITLE
             0450  1T'SAMPLE NATURAL PROGRAM \#2 EXECUTION OUTPUT'//
             0460  1T'*****----------------- INPUT INTERSECTION'
             0470  43T'----------------------*****'
             0480  71T'*****------------ SELECTED OUTPUT ITEMS -------------*****'//
             0490  1T 'B IN-STREET-NAME-1                '
             0500  36T'B IN-STREET-NAME-2                '
             0510  71T'  ZIP CD NYPD-PCT SCHLDST INTERSECTING STREET NAMES'/
             0520  1T '- --------------------------------'
             0530  36T'- --------------------------------'
             0540  71T'----- -- -------- ------- --------------------------------'
             0550 *
             0560 READ WORK FILE 01 #USER-INPUT
             0570  PERFORM FN2-PROCESS
             0580 END-WORK
             0590 *
             0600 DEFINE SUBROUTINE FN2-PROCESS
             0610 ************************************************************************
             0620 * TO MAKE A FUNCTION 2 CALL:                                           *
             0630 *    (1) INITIALIZE WORKAREA 1 TO SPACES                               *
             0640 *    (2) SET WA1'S FUNCTION-CODE TO 2                                  *
             0650 *    (3) MOVE THE 1ST INPUT BORO TO WA1'S INPUT BORO CODE FIELD        *
             0660 *    (4) MOVE THE 1ST INPUT STREET TO WA1'S INPUT STREET NAME FIELD    *
             0670 *    (5) MOVE THE 2ND INPUT BORO TO WA1'S INPUT BORO CODE 2 FIELD      *
             0680 *    (6) MOVE THE 2ND INPUT STREET TO WA1'S INPUT STREET NAME 2 FIELD  *
             0690 *    (7) CALL GBI WITH 2 WORKAREAS                                     *
             0700 *    (8) CHECK RETURN CODES FOR ERRORS OR WARNINGS                     *
             0710 ************************************************************************
             0720  RESET GEOLW1
             0730  MOVE '2 ' TO GEO-WA1-IN-FUNCTION-CODE
             0740  MOVE #USER-BORO1 TO GEO-WA1-IN-BORO
             0750  MOVE #USER-STRT-NAME1 TO GEO-WA1-IN-STREET-1
             0760  MOVE #USER-BORO2 TO GEO-WA1-IN-BORO-2
             0770  MOVE #USER-STRT-NAME2 TO GEO-WA1-IN-STREET-2
             0780 *
             0790  CALL 'GBI' W1NAT W2NAT
             0800 *
             0810  IF GEO-WA1-OUT-RETURN-CODE NOT = '00' AND
             0820     GEO-WA1-OUT-RETURN-CODE NOT = '01'
             0830 *
             0840 ***** REPLACE CODE BELOW WITH YOUR OWN ERROR HANDLING ROUTINE HERE *****
             0850 *
             0860   WRITE NOTITLE /
             0870    1T '***** FUNCTION 2 GRC =' GEO-WA1-OUT-RETURN-CODE
             0880    27T 'REASON CODE ='GEO-WA1-OUT-REASON-CODE
             0890    43T ','GEO-WA1-OUT-ERROR-MESSAGE /
             0900    1T #USER-BORO1 3T #USER-STRT-NAME1
             0910    36T #USER-BORO2 38T #USER-STRT-NAME2
             0920  ELSE
             0930   IF GEO-WA1-OUT-RETURN-CODE = '01'
             0940 *
             0950 *** REPLACE CODE BELOW WITH YOUR OWN WARNING HANDLING ROUTINE HERE   ***
             0960 *
             0970    WRITE NOTITLE /
             0980     1T '***** FUNCTION 2 WARNING, GRC =' GEO-WA1-OUT-RETURN-CODE
             0990     37T 'REASON CODE =' GEO-WA1-OUT-REASON-CODE
             1000     53T ','GEO-WA1-OUT-ERROR-MESSAGE /
             1010     1T #USER-BORO1 3T #USER-STRT-NAME1
             1020     36T #USER-BORO2 38T #USER-STRT-NAME2
             1030   END-IF
             1040  END-IF
             1050 *
             1060   IF GEO-WA1-OUT-RETURN-CODE = '00' OR
             1070      GEO-WA1-OUT-RETURN-CODE = '01'
             1080 *
             1090 ***** REPLACE CODE BELOW WITH YOUR OWN CODE FOR                   *****
             1100 ***** PROCESSING SUCCESSFUL GEOSUPPORT FUNCTION 2 CALL            *****
             1110 *
             1120    FOR #INDEX 1 TO GEO-WA2-FN2-NUM-OF-INTERSECTS
             1130 ***********************************************************************
             1140 * TO GET STREET NAMES FOR INTERSECTING STREET CODES                   *
             1150 * MAKE A FUNCTION D CALL:                                             *
             1160 *    (1) INITIALIZE WORKAREA 1 TO SPACES                              *
             1170 *    (2) SET THE WA1'S FUNCTION CODE FIELD TO D                       *
             1180 *    (3) USE THE COMPACT STREET NAMES OPTION TO OBTAIN                *
             1190 *        STREET NAMES FORMATTED FOR DISPLAY                           *
             1200 *    (4) MOVE THE PACKED BORO AND STREET CODE TO                      *
             1210 *        WA1'S INPUT STREET CODE 1 FIELD                              *
             1220 *    (5) CALL GBI WITH 1 WORKAREA                                     *
             1230 *    (6) CHECK RETURN CODES FOR ERRORS OR WARNINGS                    *
             1240 ***********************************************************************
             1250     RESET GEOLW1
             1260     MOVE 'D ' TO GEO-WA1-IN-FUNCTION-CODE
             1270     MOVE 'C ' TO GEO-WA1-IN-COMPACT-NAME-FLAG
             1280     MOVE '25' TO GEO-WA1-IN-SNL
             1290     MOVE GEO-WA2-FN2-INTERSECT-PBSC(#INDEX) TO GEO-WA1-IN-STREETCODE-1
             1300 *
             1310     CALL 'GBI' W1NAT
             1320 *
             1330     IF GEO-WA1-OUT-RETURN-CODE = '00'
             1340 *
             1350 ***** INSERT YOUR OWN CODE HERE FOR                               *****
             1360 ***** PROCESSING SUCCESSFUL FUNCTION D CALLS                      *****
             1370 *
             1380      IF #INDEX = 1
             1390       WRITE NOTITLE /
             1400        1T #USER-BORO1 3T #USER-STRT-NAME1
             1410        36T #USER-BORO2 38T #USER-STRT-NAME2
             1420        71T GEO-WA2-FN2-ZIP 77T GEO-WA2-FN2-COMDIST-NUM
             1430        80T GEO-WA2-FN2-POL-PRECINCT 89T GEO-WA2-FN2-SCHOOLDIST
             1440        97T GEO-WA1-OUT-STREET-1
             1450      ELSE
             1460       WRITE NOTITLE
             1470        97T GEO-WA1-OUT-STREET-1
             1480      END-IF
             1490     ELSE IF GEO-WA1-OUT-RETURN-CODE NOT = '00'
             1500 *
             1510 ***** INSERT YOUR OWN ERROR HANDLING ROUTINE HERE                 *****
             1520 *
             1530      WRITE NOTITLE /
             1540       1T '***** FUNCTION D GRC =' GEO-WA1-OUT-RETURN-CODE
             1550       27T 'REASON CODE =' GEO-WA1-OUT-REASON-CODE
             1560       43T ','GEO-WA1-OUT-ERROR-MESSAGE /
             1570       1T #USER-BORO1 3T #USER-STRT-NAME1
             1580       36T #USER-BORO2 38T #USER-STRT-NAME2
             1590     END-IF
             1600     END-IF
             1610    END-FOR
             1620  END-IF
             1630 *
             1640 END-SUBROUTINE
             1650 END

NATURAL SAMPLE PROGRAM #2 – Program Source Code - COW

             0010 ************************************************************************
             0020 * PGM NAME: GEOBUPGB    DATE: 08-18-98     MODIFIED : 08-28-06         *
             0030 *                                                                      *
             0040 * THIS PROGRAM MAKES FUNCTION 2 AND D CALLS TO GEOSUPPORT USING TWO    *
             0050 * BOROS AND TWO STREET NAMES SUPPLIED BY AN INSTREAM FILE.             *
             0060 * FUNCTION 2 RETURNS GEOGRAPHIC INFORMATION FOR AN INTERSECTION.       *
             0070 * FUNCTION D TRANSLATES AN INPUT STREET CODE TO A STREET NAME.         *
             0080 ************************************************************************
             0090 *          NOTE: IF THE CROSS STREET NAMES FLAG WERE USED IN THE       *
             0100 *                ORIGINAL CALL TO FUNCTION 2, ALL THE CROSS STREET     *
             0110 *                NAMES WOULD HAVE BEEN REUTRNED BY FUNCTION 2.         *
             0120 ************************************************************************
             0130 *                                                                      *
             0140 ************************************************************************
             0150 * USE OF GEOSUPPORT LDA (REFERENCED BELOW BY THE LOCAL USING STATEMENT)*
             0160 * IS STRONGLY ENCOURAGED.                                              *
             0170 ************************************************************************
             0180 *                                                                        
             0190 DEFINE DATA                                                              
             0200  LOCAL USING GEOLP1                                                      
             0210  LOCAL USING GEOLP2                                                      
             0220 *                                                                        
             0230 ***** REPLACE CODE BELOW WITH YOUR OWN INPUT DATA DECLARATION      *****
             0240 *                                                                        
             0250  LOCAL                                                                   
             0260   01 #USER-INPUT                                                         
             0270      02 #USER-BORO1                   (A1)                               
             0280      02 #FILLER1                      (A1)                               
             0290      02 #USER-STRT-NAME1              (A32)                              
             0300      02 #FILLER2                      (A1)                               
             0310      02 #USER-BORO2                   (A1)                               
             0320      02 #FILLER3                      (A1)                               
             0330      02 #USER-STRT-NAME2              (A32)                              
             0340      02 #FILLER4                      (A11)                              
             0350 *                                                                        
             0360   01 #INDEX                           (I1)                               
             0370 *                                                                        
             0380   01 #B5SC (A6)                                                          
             0390   01 REDEFINE #B5SC                                                      
             0400      02 #B5SC-BORO (A1)                                                  
             0410      02 #B5SC-5SC (A5)                                                   
             0420 *                                                                        
             0430   01 #NUM-INTERSECT-A (A1)                                               
             0440   01 REDEFINE #NUM-INTERSECT-A                                           
             0450      02 #NUM-INTERSECT-N (N1)                                            
             0460 *                                                                        
             0470 END-DEFINE                                                               
             0480 *                                                                        
             0490 FORMAT LS=133 PS=60                                                      
             0500 *                                                                        
             0510 ***** REPLACE CODE BELOW WITH YOUR OWN REPORT LAYOUT               *****
             0520 *                                                                        
             0530 WRITE NOTITLE                                                            
             0540  1T'SAMPLE NATURAL PROGRAM \#2 EXECUTION OUTPUT'//                        
             0550  1T'*****----------------- INPUT INTERSECTION'                           
             0560  43T'----------------------*****'                                        
             0570  71T'*****------------ SELECTED OUTPUT ITEMS -------------*****'//       
             0580  1T 'B IN-STREET-NAME-1                '                                 
             0590  36T'B IN-STREET-NAME-2                '                                 
             0600  71T'  ZIP CD NYPD-PCT SCHLDST INTERSECTING STREET NAMES'/               
             0610  1T '- --------------------------------'                                 
             0620  36T'- --------------------------------'                                 
             0630  71T'----- -- -------- ------- --------------------------------'         
             0640 *                                                                        
             0650 READ WORK FILE 01 #USER-INPUT                                            
             0660  PERFORM FN2-PROCESS                                                     
             0670 END-WORK                                                                 
             0680 *                                                                        
             0690 DEFINE SUBROUTINE FN2-PROCESS                                            
             0700 ************************************************************************
             0710 * TO MAKE A FUNCTION 2 CALL:                                           *
             0720 *    (1) INITIALIZE WORKAREA 1 TO SPACES                               *
             0730 *    (2) SET WA1'S FUNCTION-CODE TO 2                                  *
             0740 *    (3) SET THE PLATFORM INDICATOR SWITCH (NON-IBM-MAIN-FRAME)        *
             0750 *        TO USE CHARACTER ONLY WORK AREAS (COWS)                         
             0760 *    (4) MOVE THE 1ST INPUT BORO TO WA1'S INPUT BORO CODE FIELD        *
             0770 *    (5) MOVE THE 1ST INPUT STREET TO WA1'S INPUT STREET NAME FIELD    *
             0780 *    (6) MOVE THE 2ND INPUT BORO TO WA1'S INPUT BORO CODE 2 FIELD      *
             0790 *    (7) MOVE THE 2ND INPUT STREET TO WA1'S INPUT STREET NAME 2 FIELD  *
             0800 *    (8) CALL GBI WITH 2 WORKAREAS                                     *
             0810 *    (9) CHECK RETURN CODES FOR ERRORS OR WARNINGS                     *
             0820 ************************************************************************
             0830  RESET GEOLP1                                                            
             0840  MOVE '2 ' TO PIWA1-IN-FUNCTION-CODE                                     
             0850  MOVE 'C' TO PIWA1-IN-PLATFORM-INDICATOR                                 
             0860  MOVE #USER-BORO1 TO PIWA1-IN-BORO-1                                     
             0870  MOVE #USER-STRT-NAME1 TO PIWA1-IN-STREET-1                              
             0880  MOVE #USER-BORO2 TO PIWA1-IN-BORO-2                                     
             0890  MOVE #USER-STRT-NAME2 TO PIWA1-IN-STREET-2                              
             0900 *                                                                        
             0910  CALL 'GBI' P1NAT P2NAT                                                  
             0920 *                                                                        
             0930  IF PIWA1-OUT-RETURN-CODE NOT = '00' AND                                 
             0940     PIWA1-OUT-RETURN-CODE NOT = '01'                                     
             0950 *                                                                        
             0960 ***** REPLACE CODE BELOW WITH YOUR OWN ERROR HANDLING ROUTINE HERE *****
             0970 *                                                                        
             0980   WRITE NOTITLE /                                                        
             0990    1T '***** FUNCTION 2 GRC =' PIWA1-OUT-RETURN-CODE                     
             1000    27T 'REASON CODE ='PIWA1-OUT-REASON-CODE                              
             1010    43T ','PIWA1-OUT-ERROR-MESSAGE /                                      
             1020    1T #USER-BORO1 3T #USER-STRT-NAME1                                    
             1030    36T #USER-BORO2 38T #USER-STRT-NAME2                                  
             1040  ELSE                                                                    
             1050   IF PIWA1-OUT-RETURN-CODE = '01'                                        
             1060 *                                                                        
             1070 *** REPLACE CODE BELOW WITH YOUR OWN WARNING HANDLING ROUTINE HERE   ***
             1080 *                                                                        
             1090    WRITE NOTITLE /                                                       
             1100     1T '***** FUNCTION 2 WARNING, GRC =' PIWA1-OUT-RETURN-CODE           
             1110     37T 'REASON CODE =' PIWA1-OUT-REASON-CODE                            
             1120     53T ','PIWA1-OUT-ERROR-MESSAGE /                                     
             1130     1T #USER-BORO1 3T #USER-STRT-NAME1                                   
             1140     36T #USER-BORO2 38T #USER-STRT-NAME2                                 
             1150   END-IF                                                                 
             1160  END-IF                                                                  
             1170 *                                                                        
             1180   IF PIWA1-OUT-RETURN-CODE = '00' OR                                     
             1190      PIWA1-OUT-RETURN-CODE = '01'                                        
             1200 *                                                                        
             1210 ***** REPLACE CODE BELOW WITH YOUR OWN CODE FOR                   *****  
             1220 ***** PROCESSING SUCCESSFUL GEOSUPPORT FUNCTION 2 CALL            *****  
             1230 *                                                                        
             1240   MOVE PIWA2-FN2-NUM-OF-INTERSECTS TO #NUM-INTERSECT-A                   
             1250   FOR #INDEX 1 TO #NUM-INTERSECT-N                                       
             1260 ***********************************************************************  
             1270 * TO GET STREET NAMES FOR INTERSECTING STREET CODES                   *  
             1280 * MAKE A FUNCTION D CALL:                                             *  
             1290 *    (1) INITIALIZE WORKAREA 1 TO SPACES                              *  
             1300 *    (2) SET THE WA1'S FUNCTION CODE FIELD TO D                       *  
             1310 *    (3) SET THE PLATFORM INDICATOR SWITCH (NON-IBM-MAIN-FRAME)       *  
             1320 *        TO USE CHARACTER ONLY WORK AREAS (COWS)                      *  
             1330 *    (4) USE THE COMPACT STREET NAMES OPTION TO OBTAIN                *  
             1340 *        STREET NAMES FORMATTED FOR DISPLAY                           *  
             1350 *    (5) MOVE THE PACKED BORO AND STREET CODE TO                      *  
             1360 *        WA1'S INPUT STREET CODE 1 FIELD                              *  
             1370 *    (6) CALL GBI WITH 1 WORKAREA                                     *  
             1380 *    (7) CHECK RETURN CODES FOR ERRORS OR WARNINGS                    *  
             1390 ***********************************************************************  
             1400     RESET GEOLP1                                                         
             1410     MOVE 'D ' TO PIWA1-IN-FUNCTION-CODE                                  
             1420     MOVE 'C' TO PIWA1-IN-PLATFORM-INDICATOR                              
             1430     MOVE 'C' TO PIWA1-IN-SN-NORM-FORMAT                                  
             1440 *   MOVE PIWA2-FN2-INTERSECT-B5SC(#INDEX) TO PIWA1-IN-10SC-1             
             1450     MOVE PIWA2-FN2-INTERSECT-B5SC(#INDEX) TO #B5SC                       
             1460     MOVE #B5SC-BORO TO PIWA1-IN-BORO-1                                   
             1470     MOVE #B5SC-5SC TO PIWA1-IN-10SC-1                                    
             1480 *                                                                        
             1490     CALL 'GBI' P1NAT                                                     
             1500 *                                                                        
             1510     IF PIWA1-OUT-RETURN-CODE = '00'                                      
             1520 *                                                                        
             1530 ***** INSERT YOUR OWN CODE HERE FOR                               *****  
             1540 ***** PROCESSING SUCCESSFUL FUNCTION D CALLS                      *****  
             1550 *                                                                        
             1560      IF #INDEX = 1                                                       
             1570       WRITE NOTITLE /                                                    
             1580        1T #USER-BORO1 3T #USER-STRT-NAME1                                
             1590        36T #USER-BORO2 38T #USER-STRT-NAME2                              
             1600        71T PIWA2-FN2-ZIP 77T PIWA2-FN2-COM-DIST-NUM                      
             1610        80T PIWA2-FN2-POL-PRECINCT 89T PIWA2-FN2-SCHL-DIST                
             1620        97T PIWA1-OUT-STREET-1                                            
             1630      ELSE                                                                
             1640       WRITE NOTITLE                                                      
             1650        97T PIWA1-OUT-STREET-1                                            
             1660      END-IF                                                              
             1670     ELSE IF PIWA1-OUT-RETURN-CODE NOT = '00'                             
             1680 *                                                                        
             1690 ***** INSERT YOUR OWN ERROR HANDLING ROUTINE HERE                 *****  
             1700 *                                                                        
             1710      WRITE NOTITLE /                                                     
             1720       1T '***** FUNCTION D GRC =' PIWA1-OUT-RETURN-CODE                  
             1730       27T 'REASON CODE =' PIWA1-OUT-REASON-CODE                          
             1740       43T ','PIWA1-OUT-ERROR-MESSAGE /                                   
             1750       1T #USER-BORO1 3T #USER-STRT-NAME1                                 
             1760       36T #USER-BORO2 38T #USER-STRT-NAME2                               
             1770     END-IF                                                               
             1780     END-IF                                                               
             1790    END-FOR                                                               
             1800  END-IF                                                                  
             1810 *                                                                        
             1820 END-SUBROUTINE                                                           
             1830 END

NATURAL SAMPLE PROGRAM #2 – Job stream

            //GEOBUPG2 JOB    YOUR-JOB-CARD-INFORMATION
            //*              
            //**********************************************************************
            //***  NATURAL SAMPLE BATCH GEOSUPPORT USER APPLICATION PROGRAM \#2   ***
            //***                       MSW FORMAT                               ***
            //**********************************************************************
            //S1  EXEC NT3MPM1M,REGION=7000K
            //* * * * * * *  * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
            //*                                                                  \*//
            //*  AS OF GEOSUPPORT VERSION 10.0,                                  \*//
            //*  THE STEPLIB (OR JOBLIB) OF THE GEOSUPPORT EXECUTION STEP        \*//
            //*  MUST INCLUDE THE FOLLOWING TWO CONCATENATED DATSETS:            \*//
            //*       A030.GEO.SUPPORT.PDSE.LOADLIB                              \*//
            //*       A030.GEO.SUPPORT.LOADLIB                                   \*//
            //*                                                                  \*//
            //* * * * * * *  * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
            //NAT.STEPLIB DD
            //            DD
            //            DD DSN=A030.GEO.SUPPORT.PDSE.LOADLIB,DISP=SHR
            //            DD DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
            //SYSPRINT    DD SYSOUT=A
            //SYSOUT      DD SYSOUT=A,DCB=(LRECL=132)
            //CMPRINT     DD SYSOUT=A,DCB=(LRECL=132)
            //CMWKF01     DD *
            1,CHAMBERS ST                     ,1,HUDSON ST
            1,SIXTH AV                        ,1,W. 8 ST
            1,DUANE ST                        ,1,READE ST
            //CMSYNIN     DD *
            Your-Application-ID,Your-User-ID
            %*
            Your-Password
            L L GEOLW1         [For COW: GEOLP1]
            L L GEOLW2         [For COW: GEOLP2]  
            L P GEOBUPG2       [For COW Sample:  GEOBUPGB]
            GEOBUPG2           [For COW Sample:  GEOBUPGB]
            FIN
            //INCLIB      DD DSN=A030.GEO.SUPPORT.LOADLIB,DISP=SHR
            //* * * * * * *  * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
            //*                                                                  \*//
            //*  AS OF GEOSUPPORT VERSION 10.0,                                  \*//
            //*  DD STATEMENTS FOR GEOSUPPORT DATA FILES (E.G. GRID, PAD,        \*//
            //*  ETC) ARE NO LONGER NEEDED AND ARE IGNORED. GEOSUPPORT           \*//
            //*  IS TAILORED TO USE STANDARD GEOSUPPORT DATA SET NAMES.          \*//
            //*  TO USE NON-STANDARD FILES, SEE YOUR SYSTEMS PROGRAMMER.         \*//
            //*                                                                  \*//
            //* * * * * * *  * * * * * * * * * * * * * * * * * * * * * * * * * * \*//
            //SYSUDUMP    DD DUMMY

SAMPLE NATURAL PROGRAM #2 EXECUTION OUTPUT

             *****----------------- INPUT INTERSECTION ----------------------***** *****------------ SELECTED OUTPUT ITEMS -------------*****

             B IN-STREET-NAME-1                 B IN-STREET-NAME-2                   ZIP CD NYPD-PCT SCHLDST INTERSECTING STREET NAMES
             - -------------------------------- - -------------------------------- ----- -- -------- ------- --------------------------------

             1 CHAMBERS ST                      1 HUDSON ST                        10007 01 001      02      CHAMBERS STREET
                                                                                                             HUDSON STREET
                                                                                                             WEST BROADWAY

             1 SIXTH AV                         1 W. 8 ST                          10014 02 006      02      6 AVENUE
                                                                                                             GREENWICH AVENUE
                                                                                                             WEST 8 STREET

             ***** FUNCTION 2 GRC = 62 REASON CODE =   , READE STREET & DUANE STREET DO NOT INTERSECT
             1 DUANE ST                         1 READE ST