X-Delivery-Notice:  SMTP MAIL FROM does not correspond to sender.
Newsgroups: bit.listserv.vm-util
Date:         Wed, 2 Sep 1992 08:58:28 IST
From:         Hank Nussbacher <HANK@VM.BIU.AC.IL>
Subject:      Re: DMSDDL

>insist on having a file to work on.  I was wondering if anyone had a similar
>program like DMSDDL for sending and receiving files, where the input data
>can come from a stem variable, and where the received data can be placed in
>a stem too.

Back in 1984 when I was teaching myself Rexx I wrote a program called
SCAN which takes a reader file and displays it without reading it to
disk.  There are many programs today that do this but mine also
decoded the following formats: Netdata, DISK DUMP and CARD DUMP so that
they were displayed properly.  I can send anyone who wants a copy
of my SCAN EXEC (which runs slow on large files - I haven't bothered
to optimize the code): but here is part of the Rexx EXEC that
interprets Netdata format files:

/* ------------------------------------------------------------------- */
/* Subroutine to process NETDATA format files.                         */
/* NETDATA format files have control records and data records.         */
/* We will ignore all control records (since they are so screwy        */
/* anyway) and stick to data records.   Each record is defined as      */
/* follows:                                                            */
/* byte #1 - Length of record                                          */
/* byte #2 - Type of record (we ignore any records with x'20' ANDed    */
/*           in this field, since that designates a control record     */
/* byte #3-n Actual data record                                        */
/* ------------------------------------------------------------------- */
/* Netdata format is part of IBM's DIA - Document Interchange          */
/* Architecture, a higher level section of SNA (System Network         */
/* Architecture).  ISO is currently examining DIA to see whether they  */
/* will adopt it for their Applications level (top level of it's       */
/* 7 layer network structure) standard.                                */
/* The basic principle of DIA is that there be an envelope surrounding */
/* the data.  Any I/O device (printer, badge reader, plotter, fax,     */
/* image processor) should be able to understand DIA and process the   */
/* data accordingly.                                                   */
/* ------------------------------------------------------------------- */
Netdata: Procedure Expose buffer internal nje ccw1 spoolid class type ,
         hold userid
string    = ''
start     = 176
records   = 0
Do Forever
   buffersize = C2d(Substr(buffer,16,1))
   Do Forever
      If Substr(buffer,start+5,5) ^= nje & ,
         Substr(buffer,start-7,1) ^= ccw1 Then Leave
      start = start + C2d(Substr(buffer,start+4,1))
   End
   count = 0
   Do Forever
      /* Build up the NETDATA buffer */
      len = C2d(Substr(buffer,start,1))       /* Length */
      /* Under the following 3 conditions we will leave this loop  */
      If len = 0                Then Leave
      If start > 4095           Then Leave
      If count = buffersize     Then Leave
      temp = Substr(buffer,start+5,len)
      If Length(temp) < 80 Then temp = Substr(temp,1,80) /* Pad out */
      string = string||temp
      start = start + C2d(Substr(buffer,start+4,1))
      count = count + 1
   End
   begin = 1
   remains = Length(string)
   /* Now process the actual NETDATA format */
   Do Forever
      netdatalen = C2d(Substr(string,begin,1))
      huh        = Substr(string,begin+1,1)  /* Get descriptor    */
      If netdatalen <= remains & netdatalen ^= 0 Then Do
         /* Don't display descriptor records with x'20' (control) */
         If C2x(bitand(huh,'20'x)) ^= C2x('20'x) Then ,
            Call Fswrite(Substr(string,begin+2,netdatalen-2))
         remains = remains - netdatalen
         begin   = begin + netdatalen
      End
      Else Leave
   End
   string = Substr(string,begin)     /* Pick up remaining string */
   Call Getbuffer
   start = 24
End

>Kris Van Hees.

+---------------------------------------------------------------+
|                        Hank Nussbacher                        |
| Inter-University Computer Center   Computer Center            |
| Tel-Aviv University                Bar-Ilan University        |
| Ramat Aviv     ISRAEL              Ramat Gan     ISRAEL       |
|                                                               |
| Work phone: +972-3-6408309         Work phone: +972-3-5318784 |
| Work fax:   +972-3-6409118                                    |
|                 Home phone: +972-52-920165                    |
|                 Home fax:   +972-52-920166                    |
|                                                               |
| Bitnet: HANK@TAUNIVM.BITNET    or  HANK@BARILVM.BITNET        |
| Internet: hank@vm.tau.ac.il    or  hank@vm.biu.ac.il          |
+---------------------------------------------------------------+
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU