Re: Rexx Execio to PDS

2013-08-27 Thread Karl-Heinz Doppelfeld
Hello George,

your code is right except your inititialyze for 'outstem.=0'. This initialyze 
the complete stem 'outstem.' with '0' and than the execio tries to write many 
(I do not know how much) lines to your output file.

When you initialyze only 'outstem.0=0' for computing your stem counter your 
REXX works fine.

Kind regards, Karl-Heinz Doppelfeld.

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Rexx Execio to PDS

2013-08-27 Thread Paul Gilmartin
On Tue, 27 Aug 2013 01:51:54 -0500, Karl-Heinz Doppelfeld wrote:

your code is right except your inititialyze for 'outstem.=0'. This initialyze 
the complete stem 'outstem.' with '0' and than the execio tries to write many 
(I do not know how much) lines to your output file.

When you initialyze only 'outstem.0=0' for computing your stem counter your 
REXX works fine.
 
As Joel Ewing suggested, the code may then still not be serially reusable.
But that could be repaired by adding a procedure expose instruction.

And it still can't deal with empty lines and blank lines.  But I've suggested
a repair for that, earlier.

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Rexx Execio to PDS

2013-08-27 Thread Shmuel Metz (Seymour J.)
In cad60d68b445b3b511af79a64d84a...@shedlock.org, on 08/26/2013
   at 02:21 PM, George Shedlock geo...@shedlock.org said:

  EXECIO * DISKW Pdsout (STEM outstem. FINIS  

The * is not equivalent to outstem.0 and the description of FINIS
suggest that you may want it in a separate EXECIO invocation.

-- 
 Shmuel (Seymour J.) Metz, SysProg and JOAT
 Atid/2http://patriot.net/~shmuel
We don't care. We don't have to care, we're Congress.
(S877: The Shut up and Eat Your spam act of 2003)

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Rexx Execio to PDS

2013-08-27 Thread Paul Gilmartin
On Mon, 26 Aug 2013 17:14:58 -0400, Shmuel Metz (Seymour J.) wrote:

 ... the description of FINIS
suggest that you may want it in a separate EXECIO invocation.
 
Can you explain?  I've never had a problem with it.

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Rexx Execio to PDS

2013-08-27 Thread Gross, Randall [PRI-1PP]
Try initializing the stem to null (outstem. = ).

A null entry will terminate the EXECIO. 

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of George Shedlock
Sent: Tuesday, August 27, 2013 8:45 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Rexx Execio to PDS

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 
lists...@listserv.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Rexx Execio to PDS

2013-08-27 Thread Shmuel Metz (Seymour J.)
In 4868602893006577.wa.paulgboulderaim@listserv.ua.edu, on
08/26/2013
   at 04:47 PM, Paul Gilmartin paulgboul...@aim.com said:

It should probably be stressed that EXECIO, unlike most Rexx
utilities does not [substitute] the values of any simple symbols in
the tail as described in 2.4.3,

Unlike? How many REXX utilities[1] do that? Can you name one? If you
want a symbol in a command treated as a variable, then don't quote it.

[1] Utilities, not keyword statements

-- 
 Shmuel (Seymour J.) Metz, SysProg and JOAT
 Atid/2http://patriot.net/~shmuel
We don't care. We don't have to care, we're Congress.
(S877: The Shut up and Eat Your spam act of 2003)

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Rexx Execio to PDS

2013-08-27 Thread Paul Gilmartin
On Tue, 27 Aug 2013 08:45:22 -0400, George Shedlock wrote:

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.
   
No, your stem never ran out.  The behavior is identical on CMS:

 q cmslevel 
   
CMS Level 24, Service Level 102 
 
 rexx outstem. = 0; 'execio * diskw foo bar a (finis stem OUTSTEM.' 
 
DMSERD107S Disk A(260) is full  

DMSEIO632E I/O error in EXECIO; rc=13 from FSWRITE command   

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Rexx Execio to PDS

2013-08-27 Thread Shmuel Metz (Seymour J.)
In 8482246969138410.wa.karlheinz.doppelfeldfi...@listserv.ua.edu, on
08/27/2013
   at 01:51 AM, Karl-Heinz Doppelfeld karl-heinz.doppelf...@f-i.de
said:

your code is right except your inititialyze for 'outstem.=0'. This
initialyze the complete stem 'outstem.' with '0' 

That's only an issue due to the * for line count. Has the OP use
outstem.0 it would have been fine.

-- 
 Shmuel (Seymour J.) Metz, SysProg and JOAT
 Atid/2http://patriot.net/~shmuel
We don't care. We don't have to care, we're Congress.
(S877: The Shut up and Eat Your spam act of 2003)

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Rexx Execio to PDS

2013-08-27 Thread Paul Gilmartin
On Tue, 27 Aug 2013 09:02:03 -0400, Shmuel Metz (Seymour J.) wrote:

 on 08/26/2013   at 04:47 PM, Paul Gilmartin said:

It should probably be stressed that EXECIO, unlike most Rexx
utilities does not [substitute] the values of any simple symbols in
the tail as described in 2.4.3,

Unlike? How many REXX utilities[1] do that? Can you name one? If you
want a symbol in a command treated as a variable, then don't quote it.

[1] Utilities, not keyword statements
 
I'm most familiar with address SYSCALL.  Example:

rexx x=wombat; address syscall 'readfile /etc/services s.x.'; say s.wombat.0

Prints:

203

That's one.  But, right back at you: how many utilities, other than
EXECIO, can you name that *don't* evaluate simple symbols
appearing in compound tails.  (Answers from other readers are
welcome.)

Are any ISPF/LM services compound symbol-savvy?

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Rexx Execio to PDS

2013-08-27 Thread Joel C. Ewing
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 lists...@listserv.ua.edu with the message: INFO IBM-MAIN
 


-- 
Joel C. Ewing,Bentonville, AR   jcew...@acm.org 

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Rexx Execio to PDS

2013-08-27 Thread Shmuel Metz (Seymour J.)
In 8027846442974110.wa.paulgboulderaim@listserv.ua.edu, on
08/27/2013
   at 07:36 AM, Paul Gilmartin paulgboul...@aim.com said:

Can you explain? 

Never mind; the text that I was looking at only applies if the line
count is 0. Sorry for the mistake.

-- 
 Shmuel (Seymour J.) Metz, SysProg and JOAT
 Atid/2http://patriot.net/~shmuel
We don't care. We don't have to care, we're Congress.
(S877: The Shut up and Eat Your spam act of 2003)

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Rexx Execio to PDS

2013-08-27 Thread Shmuel Metz (Seymour J.)
In 9390988258167395.wa.paulgboulderaim@listserv.ua.edu, on
08/27/2013
   at 08:33 AM, Paul Gilmartin paulgboul...@aim.com said:

I'm most familiar with address SYSCALL.

Address is a keyword statement, not a REXX utility.

That's one.

No.

That's one.  But, right back at you: how many utilities, other than
EXECIO, can you name that *don't* evaluate simple symbols appearing
in compound tails.

Thousands; most of them are not REXX utilities.

Are any ISPF/LM services compound symbol-savvy?

Yes, but they are ISPF services, not REXX services.

-- 
 Shmuel (Seymour J.) Metz, SysProg and JOAT
 Atid/2http://patriot.net/~shmuel
We don't care. We don't have to care, we're Congress.
(S877: The Shut up and Eat Your spam act of 2003)

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Rexx Execio to PDS

2013-08-26 Thread Barkow, Eileen
E37 04 means that you ran out of space


  04A data set opened for output used all space available to or on  
the current volume, and no more volumes were available. Change  
the JCL to specify more volumes.

1.  Not enough volumes were specified for the data set, through 
the SER, volume count, or REF subparameter of the VOLUME
parameter of the DD statement.  When all the volumes were   
filled, the program attempted to write another record.  

2.  For a partitioned data set on a direct access volume or for 
a VIO data set, all space was filled when the program   
attempted to write another record.  (A partitioned data set 
or a VIO data set can reside on only one volume with a  
maximum of 65535 tracks.)   
3.  For a partitioned data set on a direct access volume, 16
 extents had been used when the program attempted to write   
another record. 

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of George Shedlock
Sent: Monday, August 26, 2013 2:21 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Rexx Execio to PDS

Gentle Listers;

I am trying to write a Rexx routine that takes in 3 arguments. First is DSN, 
second is Member name, third is a string of text. The string of text is the 
concatenation of lines delimited by a ;. (ex. line1;line2;line3).

This code fails:

Write_Member:
  MyDSN = ARG(1)
  MyMember = ARG(2)
  MyArg = ARG(3)
  outstem.=0
  dsnname = MyDSN || '(' || MyMember || ')'
  Say 'The dsname is: {'dsnname'}'
  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
  Say 'Number of lines written: 'outstem.0
  ALLOC DA('dsnname') F(Pdsout) OLD REUSE
  EXECIO * DISKW Pdsout (STEM outstem. FINIS
  FREE F(Pdsout)
  Return    

Failure:

The dsname is: :HLQ.TEST(MEM3): Number of lines written: 3 ACC20210-A ADDVOL 
FOR DD=PDSOUT DSN=HLQ.TEST VOL=S92248 POOL=TSOPOOL EXT=16 ACC20628-A DATA SET 
IS PARTITIONED System abend code E37, reason code 0004. Abend in host 
command EXECIO or address environment routine TSO. EXECIO error while trying to 
GET or PUT a record.    

This code works:

Write_Member:
  MyDSN = ARG(1)
  MyMember = ARG(2)
  MyArg = ARG(3)
  outstem.=0
  dsnname = MyDSN || '(' || MyMember || ')'
  Say 'The dsname is: {'dsnname'}'
  ALLOC FI(PDS) DA('dsnname') OLD reuse
  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 .
  PUSH thisword
  EXECIO 1 DISKW PDS 
  end
  EXECIO 0 DISKW PDS (FINIS
  Say 'Number of lines written: 'outstem.0
  FREE FI(PDS)
   Return    

The objective is to pass a stem for the third argument. 

Any suggestions on how to use the Execio with the stem value?

Show me the error of my ways.

George  





--
For IBM-MAIN subscribe / signoff / archive access instructions, send email to 
lists...@listserv.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Rexx Execio to PDS

2013-08-26 Thread Ted MacNEIL
  04A data set opened for output used all space available to or on the 
 current volume, and no more volumes were available.
Change the JCL to specify more volumes. 

Won't work for a PDS(E).
They can't span volumes.
-
Ted MacNEIL
eamacn...@yahoo.ca
Twitter: @TedMacNEIL

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Rexx Execio to PDS

2013-08-26 Thread Lizette Koehler
First, there is a REXX Newsgroup that might be more helpful.

To sign up  - if you have not done so - go to the bottom of this webpage:  
http://www2.marist.edu/htbin/wlvindex?TSO-REXX


Second, why use EXECIO instead of ISPF LM functions?
What do your dataset attibutes look like?  Primary space, secondary space?  
Who-all is using this file (is it shared or not shared?)

E37 is pretty descriptive.  But I also see you are using DTS Software.  Perhaps 
you need to alter the rules in ACC so you can add more space?  PDS cannot 
spanned volumes, PDSE maybe??? (I forget but maybe not)

Perhaps you need to increase your space allocation on the  file.  As you 
add/del members you leave gas - a good COMPRESS helps files that have a lot 
of add/del of members.

Lizette



-Original Message-
From: George Shedlock geo...@shedlock.org
Sent: Aug 26, 2013 11:21 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Rexx Execio to PDS

Gentle Listers;

I am trying to write a Rexx routine that takes in 3 arguments. First is DSN, 
second is Member name, third is a string of text. The string of text is the 
concatenation of lines delimited by a ;. (ex. line1;line2;line3).

This code fails:

Write_Member:   
  MyDSN = ARG(1)    
  MyMember = ARG(2) 
  MyArg = ARG(3)    
  outstem.=0    
  dsnname = MyDSN || '(' || MyMember || ')' 
  Say 'The dsname is: {'dsnname'}'  
  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   
  Say 'Number of lines written: 'outstem.0  
  ALLOC DA('dsnname') F(Pdsout) OLD REUSE   
  EXECIO * DISKW Pdsout (STEM outstem. FINIS  
  FREE F(Pdsout)  
  Return    

Failure:

The dsname is: :HLQ.TEST(MEM3):   
Number of lines written: 3 
  
ACC20210-A ADDVOL FOR DD=PDSOUT DSN=HLQ.TEST VOL=S92248 POOL=TSOPOOL EXT=16   
ACC20628-A DATA SET IS PARTITIONED 
  
System abend code E37, reason code 0004.   
  
Abend in host command EXECIO or address environment routine TSO.   
  
EXECIO error while trying to GET or PUT a record.  
  

This code works:

Write_Member:  
  MyDSN = ARG(1)   
  MyMember = ARG(2)    
  MyArg = ARG(3)   
  outstem.=0   
  dsnname = MyDSN || '(' || MyMember || ')'    
  Say 'The dsname is: {'dsnname'}' 
  ALLOC FI(PDS) DA('dsnname') OLD reuse    
  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 . 
  PUSH thisword    
  EXECIO 1 DISKW PDS     
  end  
  EXECIO 0 DISKW PDS (FINIS  
  Say 'Number of lines written: 'outstem.0 
  FREE FI(PDS)
   Return    

The objective is to pass a stem for the third argument. 

Any suggestions on how to use the Execio with the stem value?

Show me the error of my ways.

George  



--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Rexx Execio to PDS

2013-08-26 Thread Paul Gilmartin
On Mon, 26 Aug 2013 14:21:18 -0400, George Shedlock wrote:

Gentle Listers;

I am trying to write a Rexx routine that takes in 3 arguments. First is DSN, 
second is Member name, third is a string of text. The string of text is the 
concatenation of lines delimited by a ;. (ex. line1;line2;line3).

This code fails:

Write_Member:   
  MyDSN = ARG(1)    
  MyMember = ARG(2) 
  MyArg = ARG(3)    
  outstem.=0    
  dsnname = MyDSN || '(' || MyMember || ')' 
  Say 'The dsname is: {'dsnname'}'  
  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   
  Say 'Number of lines written: 'outstem.0  
  ALLOC DA('dsnname') F(Pdsout) OLD REUSE   
  EXECIO * DISKW Pdsout (STEM outstem. FINIS  
  FREE F(Pdsout)  
  Return    

I can't spot a problem.  Try it with trace R.  That's often illuminating.

The parse is cute; I hadn't thought of that of that as a way of
combining 3 instructions to one.

Hmmm.  What terminates EXECIO?  Try:

EXECIO outstem.0 DISKW Pdsout (STEM outstem. FINIS
    
System abend code E37, reason code 0004.   

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Rexx Execio to PDS

2013-08-26 Thread Binyamin Dissen
I would suggest that you read up on EXECIO * DISKW and stems

You will figure it out if you look at the file that got the E37

On Mon, 26 Aug 2013 14:21:18 -0400 George Shedlock geo...@shedlock.org
wrote:

:Gentle Listers;
:
:I am trying to write a Rexx routine that takes in 3 arguments. First is DSN, 
second is Member name, third is a string of text. The string of text is the 
concatenation of lines delimited by a ;. (ex. line1;line2;line3).
:
:This code fails:
:
:Write_Member:   
:  MyDSN = ARG(1)    
:  MyMember = ARG(2) 
:  MyArg = ARG(3)    
:  outstem.=0    
:  dsnname = MyDSN || '(' || MyMember || ')' 
:  Say 'The dsname is: {'dsnname'}'  
:  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   
:  Say 'Number of lines written: 'outstem.0  
:  ALLOC DA('dsnname') F(Pdsout) OLD REUSE   
:  EXECIO * DISKW Pdsout (STEM outstem. FINIS  
:  FREE F(Pdsout)  
:  Return    
:
:Failure:
:
:The dsname is: :HLQ.TEST(MEM3):   
:Number of lines written: 3
   
:ACC20210-A ADDVOL FOR DD=PDSOUT DSN=HLQ.TEST VOL=S92248 POOL=TSOPOOL EXT=16   
:ACC20628-A DATA SET IS PARTITIONED
   
:System abend code E37, reason code 0004.  
   
:Abend in host command EXECIO or address environment routine TSO.  
   
:EXECIO error while trying to GET or PUT a record. 
   
:
:This code works:
:
:Write_Member:  
:  MyDSN = ARG(1)   
:  MyMember = ARG(2)    
:  MyArg = ARG(3)   
:  outstem.=0   
:  dsnname = MyDSN || '(' || MyMember || ')'    
:  Say 'The dsname is: {'dsnname'}' 
:  ALLOC FI(PDS) DA('dsnname') OLD reuse    
:  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 . 
:  PUSH thisword    
:  EXECIO 1 DISKW PDS     
:  end  
:  EXECIO 0 DISKW PDS (FINIS  
:  Say 'Number of lines written: 'outstem.0 
:  FREE FI(PDS)
:   Return    
:
:The objective is to pass a stem for the third argument. 
:
:Any suggestions on how to use the Execio with the stem value?
:
:Show me the error of my ways.
:
:George  
:
:
:
:
:
:--
:For IBM-MAIN subscribe / signoff / archive access instructions,
:send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

--
Binyamin Dissen bdis...@dissensoftware.com
http://www.dissensoftware.com

Director, Dissen Software, Bar  Grill - Israel


Should you use the mailblocks package and expect a response from me,
you should preauthorize the dissensoftware.com domain.

I very rarely bother responding to challenge/response systems,
especially those from irresponsible companies.

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Rexx Execio to PDS

2013-08-26 Thread Ted MacNEIL
PDS cannot spanned volumes, PDSE maybe??? (I forget but maybe not)

Neither.
-
Ted MacNEIL
eamacn...@yahoo.ca
Twitter: @TedMacNEIL

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Rexx Execio to PDS

2013-08-26 Thread Paul Gilmartin
On 2013-08-26 13:41, Lizette Koehler wrote:
 First, there is a REXX Newsgroup that might be more helpful.
 
 To sign up  - if you have not done so - go to the bottom of this webpage:  
 http://www2.marist.edu/htbin/wlvindex?TSO-REXX
 
 
 Second, why use EXECIO instead of ISPF LM functions?
 What do your dataset attibutes look like?  Primary space, secondary space?  
 Who-all is using this file (is it shared or not shared?)
  
Why? isn't always the right question.

o Perhaps he isn't in an ISPF context?

o Perhaps, like me, he learned EXECIO under CMS, and is
  staying in a familiar environment?

o There has been much discussion in the TSO-REXX which you
  recommend of the (actually rather small) performance benefit
  of using as few system calls as possible.  Does ISPF LMPUT
  allow writing an entire stem in a single call, as EXECIO
  does?

o Why not?

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Rexx Execio to PDS

2013-08-26 Thread Paul Gilmartin
On Mon, 26 Aug 2013 22:43:46 +0300, Binyamin Dissen wrote:

I would suggest that you read up on EXECIO * DISKW and stems

You will figure it out if you look at the file that got the E37
 
Kind of a snarky RTFM, but I suppose I was similarly Socratic in my followup.

So, I RTFM; Title: z/OS V1R13.0 TSO/E REXX Reference
Document Number: SA22-7790-10.  Some of this is worth a RCF.

2.4.3 Compound symbols
...
Before the symbol is used (that is, at the time of reference), the language
processor substitutes the values of any simple symbols in the tail (I, J, 
and
One in the examples), thus generating a new, derived name. This derived
name is then used just like a simple symbol. That is, its value is by 
default
the derived name, or (if it has been used as the target of an assignment)
its value is the value of the variable named by the derived name.

The antecedent of the pronoun it in the parenthesized clause is totally
unclear.  The whole thing would be better if the sentence beginning
That is ... were omitted.  It adds no meaning and much confusion.

10.3 EXECIO
...
When var-name does not end with a period, ...
...
EXECIO * DISKR MYINDD (FINIS STEM MYVAR
...
The number of variables in the list is placed in MYVAR.0

Clearly wrong; the number of variables is placed in MYVAR0, not in MYVAR.0.

...
Operands for Writing to a Data Set:
...
lines
the number of lines to be written. This operand can be a specific
decimal number or an arbitrary number indicated by *  ...
...
When EXECIO writes an arbitrary number of lines from a list of
compound variables, it stops when it reaches a null value or an
uninitialized variable (one that displays its own name). 

The (one that displays its own name) is clearly wrong.  For example:

S.1 = 'First line'
S.2 = 'S.2'
S.3 = 'After ''S.2'' (one that displays its own name).'
S.4 = ''
S.5 = 'After null line.'

S.0 = 5
'EXECIO * DISKW OUTFILE (finis stem S.'

Writes:

** * Top of Data 
01 First line 
02 S.2 
03 After 'S.2' (one that displays its own name). 
**  Bottom of Data **

... not stopping at S.2 which displays its own name.

It should probably be stressed that EXECIO, unlike most Rexx
utilities does not [substitute] the values of any simple symbols
in the tail as described in 2.4.3, but uses the unsubstituted
names of those simple symbols.  Example:

T = 'WOMBAT'
'EXECIO 3 DISKR INFILE (finis stem S.T.'
TT = 'T'
say value( 'S.T.0' ) value( 'S.TT.0' )

Prints:

S.WOMBAT.0 3
... where value() substitutes the value of T (and TT), but EXECIO does not.

I suppose some of this should go to TSO-REXX for vetting, then to
RCF.

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Rexx Execio to PDS

2013-08-26 Thread Gerhard Adam
When EXECIO writes an arbitrary number of lines from a list of
compound variables, it stops when it reaches a null value or an
uninitialized variable (one that displays its own name). 

** * Top of Data 
01 First line 
02 S.2 
03 After 'S.2' (one that displays its own name). 
**  Bottom of Data **

... not stopping at S.2 which displays its own name.

You're playing a bit fast and loose with the definition.  An uninitialized 
variable clearly displays its own name in upper case, but that isn't the same 
thing as having a variable initialized with its own name.  So whether you agree 
with the use of the description in parenthesis, the documentation clearly 
indicates an uninitialized variable as being the criteria.

Adam

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Rexx Execio to PDS

2013-08-26 Thread Paul Gilmartin
On 2013-08-26 17:03, Gerhard Adam wrote:
When EXECIO writes an arbitrary number of lines from a list of
compound variables, it stops when it reaches a null value or an
uninitialized variable (one that displays its own name). 
 
 ** * Top of Data 
 01 First line 
 02 S.2 
 03 After 'S.2' (one that displays its own name). 
 **  Bottom of Data **
 
 ... not stopping at S.2 which displays its own name.
 
 You're playing a bit fast and loose with the definition.  An uninitialized 
 variable clearly displays its own name in upper case, but that isn't the same 
 thing as having a variable initialized with its own name.  So whether you 
 agree with the use of the description in parenthesis, the documentation 
 clearly indicates an uninitialized variable as being the criteria.
 
I am not playing a bit fast and loose.  displays its own name
is a necessary but not sufficient condition, so it is not a
criterion.

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Rexx Execio to PDS

2013-08-26 Thread Joel C. Ewing
The problem is
outstem.=0
which sets an infinite number of instances of outstem.x to the non-null
value 0 for all x.   DISKW from a stem variable does not stop based
on a count in outstem.0, it stops when the first null outstem.n value
for n=1, 2, ...  is found, which is never in this case.  I suspect
outstem.0 = 0 is what was intended.  Or if this were in a section of
code that is repeated, you might need to also do a Drop outstem. first
to insure you don't pick up records from a previous usage.

The parse is clever, but also much more obscure than a simple loop with
counter and setting outstem.0 to the counter on loop exit.  (I would
still be inclined to set outstem.0 for tracking purposes even though the
EXECIO doesn't use it in the code shown)
   Joel C. Ewing

On 08/26/2013 01:21 PM, George Shedlock wrote:
 Gentle Listers;
 
 I am trying to write a Rexx routine that takes in 3 arguments. First is DSN, 
 second is Member name, third is a string of text. The string of text is the 
 concatenation of lines delimited by a ;. (ex. line1;line2;line3).
 
 This code fails:
 
 Write_Member:   
   MyDSN = ARG(1)
   MyMember = ARG(2) 
   MyArg = ARG(3)
   outstem.=0
   dsnname = MyDSN || '(' || MyMember || ')' 
   Say 'The dsname is: {'dsnname'}'  
   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   
   Say 'Number of lines written: 'outstem.0  
   ALLOC DA('dsnname') F(Pdsout) OLD REUSE   
   EXECIO * DISKW Pdsout (STEM outstem. FINIS  
   FREE F(Pdsout)  
   Return
 
 Failure:
 
 The dsname is: :HLQ.TEST(MEM3):   
 Number of lines written: 3

 ACC20210-A ADDVOL FOR DD=PDSOUT DSN=HLQ.TEST VOL=S92248 POOL=TSOPOOL EXT=16   
 ACC20628-A DATA SET IS PARTITIONED

 System abend code E37, reason code 0004.  

 Abend in host command EXECIO or address environment routine TSO.  

 EXECIO error while trying to GET or PUT a record. 

 
 This code works:
 
 Write_Member:  
   MyDSN = ARG(1)   
   MyMember = ARG(2)
   MyArg = ARG(3)   
   outstem.=0   
   dsnname = MyDSN || '(' || MyMember || ')'
   Say 'The dsname is: {'dsnname'}' 
   ALLOC FI(PDS) DA('dsnname') OLD reuse
   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 . 
   PUSH thisword
   EXECIO 1 DISKW PDS 
   end  
   EXECIO 0 DISKW PDS (FINIS  
   Say 'Number of lines written: 'outstem.0 
   FREE FI(PDS)
Return
 
 The objective is to pass a stem for the third argument. 
 
 Any suggestions on how to use the Execio with the stem value?
 
 Show me the error of my ways.
 
 George  
 
 
 
 
 
 --
 For IBM-MAIN subscribe / signoff / archive access instructions,
 send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
 


-- 
Joel C. Ewing,Bentonville, AR   jcew...@acm.org 


Re: Rexx Execio to PDS

2013-08-26 Thread Joel C. Ewing
And although this change would not be needed for the code to work, for
consistency and to actually use the outstem.0 value as a constraint the
EXECIO should probably be changed to
EXECIO outstem.0 DISKW Pdsout (STEM outstem. FINIS
That way the code could even be re-executed without having to Drop prior
outstem values each time.
JC Ewing

On 08/26/2013 08:57 PM, Joel C. Ewing wrote:
 The problem is
 outstem.=0
 which sets an infinite number of instances of outstem.x to the non-null
 value 0 for all x.   DISKW from a stem variable does not stop based
 on a count in outstem.0, it stops when the first null outstem.n value
 for n=1, 2, ...  is found, which is never in this case.  I suspect
 outstem.0 = 0 is what was intended.  Or if this were in a section of
 code that is repeated, you might need to also do a Drop outstem. first
 to insure you don't pick up records from a previous usage.
 
 The parse is clever, but also much more obscure than a simple loop with
 counter and setting outstem.0 to the counter on loop exit.  (I would
 still be inclined to set outstem.0 for tracking purposes even though the
 EXECIO doesn't use it in the code shown)
Joel C. Ewing
 
 On 08/26/2013 01:21 PM, George Shedlock wrote:
 Gentle Listers;

 I am trying to write a Rexx routine that takes in 3 arguments. First is DSN, 
 second is Member name, third is a string of text. The string of text is the 
 concatenation of lines delimited by a ;. (ex. line1;line2;line3).

 This code fails:

 Write_Member:   
   MyDSN = ARG(1)
   MyMember = ARG(2) 
   MyArg = ARG(3)
   outstem.=0
   dsnname = MyDSN || '(' || MyMember || ')' 
   Say 'The dsname is: {'dsnname'}'  
   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   
   Say 'Number of lines written: 'outstem.0  
   ALLOC DA('dsnname') F(Pdsout) OLD REUSE   
   EXECIO * DISKW Pdsout (STEM outstem. FINIS  
   FREE F(Pdsout)  
   Return

 Failure:

 The dsname is: :HLQ.TEST(MEM3):  
  
 Number of lines written: 3   
 
 ACC20210-A ADDVOL FOR DD=PDSOUT DSN=HLQ.TEST VOL=S92248 POOL=TSOPOOL EXT=16  
  
 ACC20628-A DATA SET IS PARTITIONED   
 
 System abend code E37, reason code 0004. 
 
 Abend in host command EXECIO or address environment routine TSO. 
 
 EXECIO error while trying to GET or PUT a record.
 

 This code works:

 Write_Member:  
   MyDSN = ARG(1)   
   MyMember = ARG(2)
   MyArg = ARG(3)   
   outstem.=0   
   dsnname = MyDSN || '(' || MyMember || ')'
   Say 'The dsname is: {'dsnname'}' 
   ALLOC FI(PDS) DA('dsnname') OLD reuse
   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 . 
   PUSH thisword
   EXECIO 1 DISKW PDS 
   end  
   EXECIO 0 DISKW PDS (FINIS  
   Say 'Number of lines written: 'outstem.0 
   FREE FI(PDS)
Return

 The objective is to pass a stem for the third argument. 

 Any suggestions on how to use the Execio with the stem value?

 Show me the 

Re: Rexx Execio to PDS

2013-08-26 Thread Paul Gilmartin
On Mon, 26 Aug 2013 21:27:42 -0500, Joel C. Ewing wrote:

And although this change would not be needed for the code to work, for
consistency and to actually use the outstem.0 value as a constraint the
EXECIO should probably be changed to
EXECIO outstem.0 DISKW Pdsout (STEM outstem. FINIS
That way the code could even be re-executed without having to Drop prior
outstem values each time.

Actually, it might be needed to avoid premature termination at an
empty record.

OK.  Suppose the OP is 100.00% certain that his data contain no empty
records (is he willing to test for this condition and report it as an error?)
But code snippets have a tendency to be recycled far beyond their
original intended purpose.  Strive for generality, even needless generality.

similarly:
...
   if thisword='' then leave

The = operator is a fuzzy comparison.  It will match if thisword contains
any number of blanks and nothing else.  Better to use == even if he's
certain that his data contain no blank lines.

So:
...
do t = 1
if MyArg == '' then leave t
parse var MyArg  outstem.t ';' MyArg  
outstem.t = Left(oustem.t,80)  /* Or should 80 be reported as an 
error?  */ 
end t
outstem.0 = t-1 
Say 'Number of lines written: 'outstem.0 
ALLOC DA('dsnname') F(Pdsout) OLD REUSE   
EXECIO outstem.0 DISKW Pdsout (STEM outstem. FINIS
FREE F(Pdsout)
Return

This leaves a nonuniformity; a lurking astonishment factor.  If the last
record is empty and not followed by a ; it will be written unless it is
empty, in which case it will not be written.

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN