Previous Topic: Retrieving Partial PathsNext Topic: Retrieving Record Types by Name


What You Can Do

You can retrieve a segment of a path (partial string) when the entire path cannot be completed.

How to Do It

Specify a shorter (alternate) path.

A special type of alternate path ID, the null path identifier, can be used to indicate that an occurrence of the entry record was either not found or not selected.

The null path identifier is discussed later in this chapter.

Code:

  1. A PATH parameter with the path identifier and the records to be accessed
  2. An alternate path identifier placed one record after the last record of the shorter path
    PATH01 EMPLOYEE EXPERTISE (02) SKILL  $Shorter path is EMPLOYEE
    

Demonstration

Objective

This report:

Procedure

Complete Code

 col. 2
 ▼
 DATABASE DICTNAME=DOCUDICT
 IN DB SS=EMPSS01
 PATHAA EMPLOYEE COVERAGE HOSPITAL-CLAIM (BB)
 013 EMPLOYEE LISTING
 010 EMP-NAME '                         '
 010 INS-CODE '   '
 0151*005 PATH-ID                HH 'PATH' 'USED'
 0151*020 EMP-NAME-0415          HH 'EMPLOYEE' 'NAME'
 0151*030 INS-PLAN-CODE-0400     HH 'INSURANCE' 'PLAN CODE'
 0152*040+HOSPITAL-NAME-0430     HH 'HOSPITAL'
 017010 IF EMP-NAME-0415 EQ EMP-NAME AND INS-PLAN-CODE-0400 EQ
* INS-CODE  DROP                                   $Eliminate duplicate entries
 017020 MOVE EMP-NAME-0415 TO EMP-NAME
 017030 MOVE INS-PLAN-CODE-0400 TO INS-CODE
 017100   IF PATH-ID EQ 'AA' 300
 017200   TAKE 1
 017300   TAKE (1 2)

Result

REPORT NO. 01          EMPLOYEE LISTING               mm/dd/yy PAGE     1                PATH                      EMPLOYEE                     INSURANCE                USED                        NAME                       PLAN CODE                                                                                                      HOSPITAL                 BB              KATHERINE O'HEARN                        001                 BB              KATHERINE O'HEARN                        002                 BB              ROBBY     WILDER                         001                 BB              BURT      LANCHESTER                     004                 BB              BURT      LANCHESTER                     003                 AA              BURT      LANCHESTER                     002 +                                                                                           GENERAL HOSPITAL                 BB              BURT      LANCHESTER                     001                 BB              VLADIMIR  HEAROWITZ                      001                 BB              THEMIS    PAPAZEUS                       003                 BB              HERBERT   LIPSICH                        001                 BB              HENRIETTA HENDON                         004                 AA              HENRIETTA HENDON                         002 +                                                                                           ANGELS OF MERCY HOSPITAL                 BB              RUPERT    JENSON                         001                 BB              EDWARD    HUTTON                         003                 BB              RICHARD   MUNYON                         002                 BB              HARRY     ARM                            001                 BB              HARRY     ARM                            002                 BB              MICHAEL   ANGELO                         001                 BB              LAURA     PENMAN                         003                 BB              JAMES     JACOBI                         004                 BB              ROBIN     GARDNER                        002                 BB              HERBERT   CRANE                          004                 BB              HERBERT   CRANE                          003                 BB              HERBERT   CRANE                          001                 BB              PERCY     GRANGER                        003                 BB              JANE      DOUGH                          003                 BB              LARRY     LITERATA                       003                 BB              GEORGE    FONRAD                         004                 BB              DANIEL    MOON                           002