Marc's Place

E$LIB - Sorteren van bestanden




XCALL SORT statement vervangen


De DIBOL routine XCALL SORT en het gebruik van sorteerprogramma's werkt onder Synergy Language (DBL) niet meer. Synergy Language biedt een SORT statement in plaats van een XCALL zoals onder DIBOL.

De aanpassingen die gedaan moet worden om XCALL SORT te vervangen door XCALL E$SORT te kunnen gebruiken met bestaande sorteerdefinities bestaat uit het volgende:

  • Er wordt géén gebruik meer gemaakt van aparte sorteerprogramma's.
  • Het programma waar naar doorgestart werd, gedefinieerd in de Vax/DIBOL SORT-parameterfile door het EXECUTE: statement, moet nu in parameter 4 worden doorgegeven. Zo niet, dan keert de routine terug naar het aanroepende programma en kan je zelf een STOP "PROG" programmeren.

Het record dat in de eerste parameter kan worden meegegeven kan je vullen door DBLSORTG een include file te laten genereren van je sorteerdefinitie (vóórdat je DIBOL van de VAX verwijderd!):


Vax/DBLSORTG input file:


INPUT:WRK:SORTFILE.DDF
WORK:3
OUTPUT:WRK:SORTFILE.DDF

RECORD:
       ARTIKEL,A18
       ,       A70
       INKDAT, D8
       ,       A104

KEYS:INKDAT,ARTIKEL
TAGS:SORT
EXECUTE:EXE:PRINTPROG.EXE

END:


Vax/DCL command procedure:


$ run sys$system:dblsortg
VAX DBLSORTG Version Vx.x

Input file: SORTPGM.PRM
Output file: SORTPGM.H

 


Resultaat van DBLSORTG:


RECORD SORTM

, A50,'1WRK:SORTFILE.DDF                                 '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                    WRK:SORTFILE.D'
, A50,'DF                                                '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                         002000x00'
, A50,'00000000000000000000000000000000000000000000000000'
, A50,'0000000000000000002DA      AA      000890000100000'
, A50,'0000000000000000000000000008018000000000000000000S'
, A50,'ORT 000000099y30                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                           EXE:PRINTPROG.EXE      '
, A50,'                                                  '
, A50,'                                                  '
, A50,'                                                00'
, A50,'                                        0010000000'
, A08,'00000000'


.INCLUDE 'SYS$LIBRARY:DBLSORTM.DBL'


Haal het .INCLUDE 'SYS$LIBRARY:DBLSORTM.DBL' statement weg en bewaar het bestand als een include file. Toets bovenin in de source van je programma .INCLUDE 'SORTPGM.H' of zoiets. Dit record SORTM komt qua posities en lengte precies overeen met het RECORD PARMS dat voor het samenstellen van het sort-statement wordt gebruikt. Geef het record SORTM als eerste parameter mee aan E$SORT. Hier volgt het record PARMS:


RECORD PARMS
                        ; INPUT=filespec(s)
        INNUM,  D1      ; Number of inputfiles
        INPUT,  7A255   ; Specifications for input file(s)

                        ; OUTPUT=filespec
        OUTPUT, A255    ; Specifications for output file

        RECLEN, D5      ; Record length

        ISAM,   D1      ; Non-VMS or DBL-ISAM: always 0.

        PAD,    A1, "_" ; User-defined end-of-file marker
                        ; (ASCII 000)
                        ; Non-VMS or DBL-ISAM: not used

        COUNT,  7D10    ; Number of records to sort
                        ; Non-VMS or DBL-ISAM: not used

        KEYNUM, D1      ; Number of keys
        TYPE,   8A1     ; Key field data type
                        ; (A=alpha,D=numeric,...)
        DIRECT, 8A1     ; Sort direction
                        ; (A=ascending,D=descending)
        POSTN,  8D5     ; Starting record position for key
        LENGTH, 8D3     ; Length of key

        TAGS,   A5      ; Type of tag sort to be performed
                        ; (SORT, LIST or INDEX)
                        ; Non-VMS or DBL-ISAM: not used

        TTNUM,  D10, -999 ; Not used

        WORK,   D1, 2   ; Number of work files to use

        DEVNO,  D1      ; Number of device specifications
        DEV,    8A32    ; Device specs for work files

                        ; TEMP=filespec
        TEMP,   A255    ; Spec for temporary output file

                        ; CHAIN=filespec
        CHAIN,  A132    ; Program to chain to

        IDENT,  A39     ; Not used

        MESSIZ, D2      ; Number of characters in message
        MESSGE, A40     ; Message to be sent to program
                        ; specified by CHAIN

        LOCKCC, D1      ; Set if CTRL/C should be disabled

        DETACH, D1      ; Not used
        DIBOL,  D1      ; Not used
        MEMORY, D2      ; Not used
        SU,     D1      ; Not used
        CNTWRK, D1      ; Not used

        FLAGS,  10D1    ; Not used

RECORD,X
        PARMSX, A2727   ; Overlay
        ,       A173
        DMSSGE, D3      ; Overlays 1st 3 chars of MESSGE

© 1997- Marc Vos (and others)   -   Privacy Statement   -    Contact Me

On this website, Google Analytics is used to track visitor statistics. These are anonymised data about the number of visitors, which pages they visit on this site, from which regions they visit, which web browsers they use, etc.. You will also see non-personalised ads via Google AdSense. Cookies from Paddle or Paypal are placed when you click on a 'Buy now!' or 'Donate!' button, and possible cookies from Disqus when you use that system to comment on one or more blogposts.
Privacy Statement