George,
The first Parse in the original loop is a useful technique. No
complaints there, only about the 2nd parse that changes t, outstem.t and
outstem.0 in one statement. The original
...
do forever
parse var MyArg thisword ';' MyArg
if thisword='' then leave
thisword = Left(thisword,80)
parse value outstem.0+1 thisword with t outstem.t =1 outstem.0 .
end
...
could have been replaced by the clearer and possibly faster
...
do t = 1 by 1
parse var MyArg thisword ';' MyArg
if thisword='' then Do outstem.0 = t-1; Leave End
outstem.t = Left(thisword,80)
end
...
The latter version would also clearly work for a "line" in the original
MyArg with only blanks or with leading blanks, while I would have to
actually run the "parse value ..." to convince myself whether the
original would or would not work for those cases (since the 2nd parse
divides on "word" boundaries, I think the original version would drop
intentional leading blanks in a line).
Joel C. Ewing
On 08/27/2013 07:45 AM, George Shedlock wrote:
> To All:
> First, the output dataset was created immediately prior to executing the
> exec. It was defined as a standard FB 80 PDS of 10 cylinders with 30
> directory blocks. For testing, my code only was generating 3 lines of output
> into a single member in that PDS.
>
> Lizette:
> I am using EXECIO instead of the ISPF LM functions for 2 reasons. First I
> cannot guarantee that this exec will run in an ISPF environment. Second, I am
> an old time VM'er and somewhat stuck in my ways.
>
> Paul:
> You have noted one of the subtle differences in the way that Execio works
> in the CMS vs TSO environments. It seems that in CMS, the "EXECIO *" stops
> after the stem runs out. In TSO, it continues on forever resulting in my out
> of space condition.
> It seems that the ISPF LMPUT only deals with one line at a time.
>
> Joel and Paul:
> The parse was a quick and dirty way of piping in a string of lines as one
> argument
>
> Joel:
> The "outstem. = 0" was indeed incorrect. It should have been "outstem.0 =
> 0". See my note below for the final code segment.
>
>
> Thank you to all who have responded. Here is the final code segment that does
> indeed work:
>
> Write_Member: Procedure expose line.
> MyDSN = ARG(1)
> MyMember = ARG(2)
> MyArg = ARG(3)
> dsnname = MyDSN || '(' || MyMember || ')'
> Say 'The dsname is: {'dsnname'}'
> Say 'Number of lines written: 'line.0
> "ALLOC DA('"dsnname"') F(Pdsout) OLD REUSE"
> "EXECIO" line.0 "DISKW Pdsout (STEM line. FINIS"
> "FREE F(Pdsout)"
> Return
>
>
> Thank you all.
>
> George
>
>
>
>
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>
--
Joel C. Ewing, Bentonville, AR [email protected]
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN