P1-Message-Id: DE*DBP*UNI-ERLANGEN;SUX400MTF CUASUBMM04071018530023
Priority:     normal
X400-Trace:   DE*DBP*UNI-ERLANGEN; arrival Tue,
              7 Apr 92 10:18+0100 action Relayed
X400-Trace:   de*dbp*gmd; arrival Tue, 7 Apr 92 15:47+0200 action Relayed
X400-Trace:   de*dbp*GMD; arrival Tue, 7 Apr 92 15:47+0200 action Relayed
Newsgroups: bit.listserv.rexxlist
Date:         Tue, 7 Apr 1992 09:56:42 +0200
Comments:     <Parser> W: Field "Resent-Date:/Date:" duplicated. Last occurence
              was retained.
Comments:     <Parser> W: Field "Resent-Message-ID:/Message-ID:" duplicated.
              Last occurence was retained.
From:         Rainer M Woitok <Woitok@VM.RRZE.UNI-ERLANGEN.DBP.DE>
Subject:      Re: Capturing response from CP command within REXX exec

On Mon, 06 Apr 1992 18:21:28 I received mail from Scott Mattes, saying:

  (">>" denotes myself)

> ...
>>A line  stuffed into the  internal buffer  of EXECIO is  80+1 characters
>>long. 80 characters  of information plus one  linefeed character (EBCDIC
>>'15'x) to separate the line from the next. Thus you'll have to provide a
>>buffer of at least (files+1)*81 characters.
>
>  True for the internal buffer, but when EXECIO puts the lines into the
>stack or into a VAR/STEM the x'15's are striped off.

Yes, but  it is exactly the  size of this internal  EXECIO buffer you're
specifying via  the BUFFER option.  You are right, however,  that EXECIO
strips this '15'x character as well as any trailing blanks.

>  On my HPO 5 system the length of each line placed in the stack by
>EXECIO is RECFM V and the LRECL never reaches 80.

It does. See below.

> ...
>                   (I think you are thinking about when you use the REXX
>Diag function).

Yes and no. What  EXECIO sees in its buffer is exactly  the same as what
diag 08 would return.

> ...

>AMHSG    2288 T CON 00000004 001 NONE 04/05 18:02:56                    SYSPRO
G
> ...
>79
>G

Exactly. 79 is the length of that  line returned by QUERY and "G" is its
last  character.  If you  take  now  into  account that  the  particular
distribution  code "SYSPROG"  is  seven characters  in  length, but  the
general distribution  code may be  up to eight characters,  you'll agree
that in general the output of a "QUERY  READER ..." line may be up to 80
chars wide.

If you  assume the "mean"  line length to  be less and  incorporate that
into your  programs, you'll sooner  or later  be badly bitten  by Murphy
himself :-)

On second  reading of  my own original  text, I admit  that it  could at
least be  misleading. It's of course  not the output of  EXECIO which is
(op to) 80 characters wide but the output of the CP QUERY READER command
used together  with EXECIO in  the original example. For  other commands
the output  width may  well be different.  But I'm not  aware of  any CP
command producing  lines wider  than 80  characters, so  80+1 is  a good
choice for all cases.

Sincerely
 Rainer

----------------------------------------------------------------------.
| Rainer M. Woitok         | Phone: (+49-9131) 85-7811, -7031          |
| Regionales Rechenzentrum | Fax  : (+49-9131) 30 29 41                |
| Friedrich-Alexander-Univ | Telex: d 629 755 tf erl                   |
| Martens-Strasse 1        | eMail: Woitok@VM.RRZE.Uni-Erlangen.DBP.DE |
| DW-8520 Erlangen         |        |      |  |    |            |   |  |
| Fed Republic of Germany  | X.400: S     OU2 OU1  P            A   C  |
'----------------------------------------------------------------------'