[comp.os.vms] SNAP and UIC formatting.

MCKEEVER@UMKCVAX1.BITNET.UUCP (06/09/87)

I'm not familier with SNAP, but from the discussion I saw on the net it
prints out UIC's without zero padding, as in [  3,  6] instead of the
standard [003,006] we are all use to.  The space padding was described
as not being elegant by one individual who claims to have come up with
a solution that seemed to them to be more elegant.  Unfortunately, this
'fix' seems to suffer from the same affliction as the original.  If SNAP
runs under VMS why not use Sys$Fao to do the formatting for you.  Why
re-invent the wheel.  Below is a short program that does the translation
from decimal to octal, with zero padding.

        Program Test

        Character * 8   OctalOut
        External        Sys$Fao, Lib$Stop
        Integer   * 4   Dummy, Status, Sys$Fao, Lib$Stop

        Type    *, 'Enter a Number a number to translate...'
        Accept  *, Dummy

        Status = Sys$Fao('[!6OL,!6OL]',, OctalOut, %Val(Dummy))
        If (.NOT. Status) Call Lib$Stop(%Val(Status))

        Type    *, ' '
        Type    *, 'Number entered    : ', Dummy
        Type    *, 'Zero Padded Octal : ', OctalOut

        End


P.S.    There is also a Sys$Fao directive for converting a longword UIC
        into ASCII numeric format with braces, zero padding, and comma's
        or one that returns the Rights identifier associated with the
        longword UIC passed it.  See page SYS-159 in V4.4 System Routines
        volume 8D for more information.

-------------------------------------------------------------------------
     UMU   UMUMUMUMUM
     UMU   UMUMUMUMUM
     UMU   UMUMUMUMUM            Brian McKeever
     UMU   UMUMUMUMUM            Computer Science
      U   UM        U            University of Missouri Kansas City
  U      UM     UM      UM       5100 RockHill Rd.
  UMUMUMUM     UMUM    UMUM      4747 Building Rm. 219
  UMUMUMUM     UMUM    UMUM      Kansas City, MO  64110
  UMUMUMUM     UMUM    UMUM      BITNET:  MCKEEVER@UMKCVAX1
  UMUMUMUM     UMUM    UMUM
-------------------------------------------------------------------------