         SYSTEM   SIG7FDP
         SYSTEM   BPM
PGMSEG0  CSECT    0
         USECT    PGMSEG0
************************************ATENSAO*************************************
* XEROX RESTRICTED PROPRIETARY PROGRAM, USE AUTHORIZED ONLY PURSUANT TO
*  LICENSE AGREEMENT.
********************************************************************************
         REF      DC1,SC1,INIT
         DEF      SSORT,RSORT,CCT01,LDTC,DCBADDR
         DEF      FINALEND
         REF      STEPCODE
         REF      F:SORTIN,F:SORTOUT
         REF      UTSCPVSW
* LEAVE ABOVE REF BEFORE F:SCRF1 SO THEY WILL LOAD FIRST
         REF      F:SCRF1,F:SCRF2,F:SCRF3,F:SCRF4,F:SCRF5,F:SCRF6
         REF      F:SCRF7,F:SCRF8,F:SCRF9,F:SCRF10,F:SCRF11,F:SCRF12
         REF      F:SCRF13,F:SCRF14,F:SCRF15,F:SCRF16,F:SCRF17
DCBADDR  DATA,4   F:SCRF1,F:SCRF2,F:SCRF3,F:SCRF4,F:SCRF5,F:SCRF6,;
                  F:SCRF7,F:SCRF8,F:SCRF9,F:SCRF10,F:SCRF11,F:SCRF12,;
                  F:SCRF13,F:SCRF14,F:SCRF15,F:SCRF16,F:SCRF17
CCT01    DATA     0                 1 IF MAIN PROG CALLED
SORTSAVE RES      15
BEGIN    LCI      15
         STM,1    SORTSAVE
         B        INIT
SSORT    RES      0
         BAL,1    SC1               SEQN SORT
         B        FINALEND
RSORT    RES      0
         BAL,1    DC1               RANDOM SORT
FINALEND RES      0
         M:FCP    1
         LW,1     STEPCODE
         SLS,1    8                 SET UP
         OR,1     =X'00010001'
         STW,1    STEPCODE          NOW READY TO GIVE USER 0 OR 6
         LCI      5
         LM,1     SORTSAVE
         LCI      6
         LM,10    SORTSAVE+9
         MTH,0    CCT01             IS IT SUB ROUTINE CALLED
         BEZ      ENDSORT1           YES
         MTW,0    UTSCPVSW           IS IT BPM
         BEZ      ENDSORT0           YES
         M:EXIT   *STEPCODE         TELL USER IF ANY ERRORS 0=NO
ENDSORT0 RES      0
         M:EXIT                     BPM/CPV WILL LEAVE STEP CODE = 0
ENDSORT1 RES      0
,LDTC    M:LDTRC  'XXXXX'           LOAD AND TRANS TO CALLER
         END      BEGIN

