Rexx File Handling for OS/390(Newbie) 
Author Message
 Rexx File Handling for OS/390(Newbie)

how do i do read/write on PS files or members using rexx (in OS/390)
Lineout command does not seem to be working here!


Sat, 24 Sep 2005 14:35:14 GMT  
 Rexx File Handling for OS/390(Newbie)
Try the EXECIO command

--
Regards,  Herman...

Quote:
> how do i do read/write on PS files or members using rexx (in
OS/390)
> Lineout command does not seem to be working here!



Sat, 24 Sep 2005 19:18:01 GMT  
 Rexx File Handling for OS/390(Newbie)


Quote:
>how do i do read/write on PS files or members using rexx (in OS/390)
>Lineout command does not seem to be working here!

Unless you're in a Unix environment you'll have to use EXECIO. I'm not
sure whether the ANSI I/O support for Unix Services was available
prior to z/OS.

--
     Shmuel (Seymour J.) Metz, SysProg and JOAT

Any unsolicited commercial junk E-mail will be subject to legal
action.  I reserve the right to publicly post or ridicule any
abusive E-mail.

I mangled my E-mail address to foil automated spammers; reply to
domain Patriot dot net user shmuel+news to contact me.  Do not



Sun, 25 Sep 2005 01:52:06 GMT  
 Rexx File Handling for OS/390(Newbie)
If you can find a copy of REXX in the TSO environment by Gabriel F.
Gargulio, most of your OS/390 questions will be answered. Also,  your
questions may get answered more quickly at bit.listserv.tsorexx.

Here is one way:

ADDRESS ISREDIT "MACRO NOPROCESS"
ADDRESS TSO
"FREE DDN(INDD)"
"FREE DDN(OUTDD)"
"ALLOC DDN(INDD)  DSN('T0xxx.LIB.DATA(xxxxx)') SHR"
"ALLOC DDN(OUTDD) DSN('T0xxx.LIB.DATA(zzzzz)') SHR"
"EXECIO * DISKR INDD (STEM RECD. FINIS)"  /* read pds member into array */
OUTREC. = ""
DO M = 1 TO RECD.0
      SAY  RECD.M
      OUTREC.M  = RECD.M
      [maybe do something to OUTREC.M]
END M

/* write file */
"EXECIO * DISKW OUTDD (STEM OUTREC. FINIS)"

"FREE DDN(INDD)"
"FREE DDN(OUTDD)"

RETURN

EXIT        

I don't have a mainframe available at the moment, so this could have errors.

Ian

Quote:

>how do i do read/write on PS files or members using rexx (in OS/390)
>Lineout command does not seem to be working here!



Sun, 25 Sep 2005 09:30:53 GMT  
 Rexx File Handling for OS/390(Newbie)

(snip)

Quote:
>/* write file */
>"EXECIO * DISKW OUTDD (STEM OUTREC. FINIS)"

I think you need to specify the line count when writing, ie

OUTREC.0 = number_of_lines_written
"EXECIO" OUTREC.0 "DISKW OUTDD (STEM OUTREC. FINIS)"

Quote:
>I don't have a mainframe available at the moment, so this could have errors.

Me neither, so I could be wrong too :-)

--
-- Stephan



Mon, 26 Sep 2005 06:15:43 GMT  
 Rexx File Handling for OS/390(Newbie)

Quote:

>(snip)

>>/* write file */
>>"EXECIO * DISKW OUTDD (STEM OUTREC. FINIS)"

>I think you need to specify the line count when writing, ie

>OUTREC.0 = number_of_lines_written
>"EXECIO" OUTREC.0 "DISKW OUTDD (STEM OUTREC. FINIS)"

>>I don't have a mainframe available at the moment, so this could have errors.

>Me neither, so I could be wrong too :-)

>--
>-- Stephan

You can specify an asterisk (*) which indicates "Write till end of file" if
that's what you'd like to do instead of the record count.

Jaime A. Cruz, Jr.

o&o_o&o_o&o_o&o_o&o_o&o_o&o_o&o_o&o_o&o_o&o_o&o_o&o
o                                                 o
o  Visit the Nassau Wings Motorcycle Club at:     o
o  http://www.nassauwings.org/                    o
o  A Charter Member of the Motorcycle Web Ring!   o
o                                                 o
o&o_o&o_o&o_o&o_o&o_o&o_o&o_o&o_o&o_o&o_o&o_o&o_o&o



Mon, 26 Sep 2005 06:35:09 GMT  
 Rexx File Handling for OS/390(Newbie)
In a previous episode of comp.lang.rexx, Jaime A. Cruz, Jr. was heard to
say:

Quote:


>>>"EXECIO * DISKW OUTDD (STEM OUTREC. FINIS)"
>>I think you need to specify the line count when writing, ie
>>OUTREC.0 = number_of_lines_written
>>"EXECIO" OUTREC.0 "DISKW OUTDD (STEM OUTREC. FINIS)"
>You can specify an asterisk (*) which indicates "Write till end of file" if
>that's what you'd like to do instead of the record count.

Chip Davis will tell you everything that's wrong with "EXECIO * DISKW",
but surely there's something wrong if you don't know how many lines you
are going to write?

The point is that "end of file" isn't really a concept that applies well
to stems, and the actual rules can catch you out in a number of ways.
--

------ http://users.comlab.ox.ac.uk/ian.collier/imc.shtml

New to this group?  Answers to frequently-asked questions can be had from
http://rexx.hursley.ibm.com/rexx/ .



Mon, 26 Sep 2005 18:44:26 GMT  
 Rexx File Handling for OS/390(Newbie)
Hi All ;
I am trying to return data from w32findeventlogentry in w32util.dll
supported by Patrick TJ McPhee. Here is his web page
http://www.interlog.com/~ptjm/
I am using w32util version 1.5.0
I am trying to retrieve the data from w32findeventlogentry when I make the
call to the routine I get a return code of 1 which means an error.
Thanks in advance
Bill

Here is my code.
Start Code
/* Comment */

call rxfuncadd 'w32loadfuncs', 'w32util', 'w32loadfuncs'
call w32loadfuncs

trace(?I)

Handle = w32openeventlog(, 'LOCAL MACHINE\System\CurrentControlSet\Services\Eventlog\security')

Num_of_Records = w32getnumberofeventlogrecords(Handle)

do J = 1 to Num_of_Records
 rc = w32findeventlogentry(Handle,J,'Stem') /* Problem Line */
 say Stem.id
 say id.0
 say id
end

rc = w32closeeventlog(Handle)

exit
End Code

Start Trace

C:\tapearc>rexx evlog.rex
    12 *-* Handle = w32openeventlog(, 'LOCAL MACHINE\System\CurrentControlSet\Services\Eventlog\security')
       >L>   "LOCAL MACHINE\System\CurrentControlSet\Services\Eventlog\security"
       >F>   "14c538" /* Good Handle */
       +++ Interactive trace.  "Trace Off" to end debug. ENTER to continue.

    14 *-* Num_of_Records = w32getnumberofeventlogrecords(Handle)
       >V>   "14c538"
       >F>   "2034"    /* Valid number of Records */

    16 *-* do J = 1 to Num_of_Records
       >L>   "1"
       >V>   "2034"
       >V>   "1"

    17 *-*  rc = w32findeventlogentry(Handle,42,'Stem')
       >V>    "14c538"
       >L>    "42"
       >L>    "Stem"
       >F>    "1"

    18 *-*  say Stem.id
       >L>    "ID"
       >C>    "STEM.ID"
       >L>    "STEM.ID"
STEM.ID

    19 *-*  say id.0
       >C>    "ID.0"
       >L>    "ID.0"
ID.0

    20 *-*  say id
       >L>    "ID"
ID

    21 *-* end
    16 *-* do J = 1 to Num_of_Records
       >V>   "1"
       >V>   "2"
    17 *-*  rc = w32findeventlogentry(Handle,42,'Stem') Problem Line
       >V>    "14c538"
       >L>    "42"
       >L>    "Stem"
       >F>    "1"     <------ Return Code of 1

    18 *-*  say Stem.id
       >L>    "ID"
       >C>    "STEM.ID"
       >L>    "STEM.ID"
STEM.ID
End Trace



Tue, 27 Sep 2005 06:48:00 GMT  
 Rexx File Handling for OS/390(Newbie)


Quote:
>Chip Davis will tell you everything that's wrong with "EXECIO * DISKW",
>but surely there's something wrong if you don't know how many lines you
>are going to write?

...and if Chip doesn't, I will.  "EXECIO * DISKW" should be a criminal
offense.


Tue, 27 Sep 2005 08:00:27 GMT  
 Rexx File Handling for OS/390(Newbie)
Guilty as charged. Does the accused get an explanation for why this is
so bad? Or do I have to do a search for "Chip Davis". Maybe I ought to
know who he is, but I don't!

Ian :-)

Quote:




>>Chip Davis will tell you everything that's wrong with "EXECIO * DISKW",
>>but surely there's something wrong if you don't know how many lines you
>>are going to write?

>...and if Chip doesn't, I will.  "EXECIO * DISKW" should be a criminal
>offense.



Tue, 27 Sep 2005 10:17:12 GMT  
 Rexx File Handling for OS/390(Newbie)
In a previous episode of comp.lang.rexx, ian was heard to say:
[upside-down posting reformatted to Usenet conventions]

Quote:


>>>Chip Davis will tell you everything that's wrong with "EXECIO * DISKW",
>>...and if Chip doesn't, I will.  "EXECIO * DISKW" should be a criminal
>>offense.
>Guilty as charged. Does the accused get an explanation for why this is
>so bad? Or do I have to do a search for "Chip Davis". Maybe I ought to
>know who he is, but I don't!

I wouldn't want to deny Frank (or Chip) the pleasure, but while we are
waiting perhaps you could say what you think "EXECIO * DISKW" actually
does.

Chip is the president of RexxLA, by the way. :-)
--

------ http://users.comlab.ox.ac.uk/ian.collier/imc.shtml

New to this group?  Answers to frequently-asked questions can be had from
http://rexx.hursley.ibm.com/rexx/ .



Tue, 27 Sep 2005 17:56:04 GMT  
 Rexx File Handling for OS/390(Newbie)
Never used Patrick's library, so this is a "shot in the dark".  
Your problem line:
Quote:
> rc = w32findeventlogentry(Handle,J,'Stem') /* Problem Line */

doesn't appear to be proper - what exactly does the documentation say
about the THIRD parameter to this function?  Maybe it should be the
variable stem. not the literal "Stem".

On Thu, 10 Apr 2003 15:48:00 -0700, "B. Comegys"

Quote:

>Hi All ;
>I am trying to return data from w32findeventlogentry in w32util.dll
>supported by Patrick TJ McPhee. Here is his web page
>http://www.interlog.com/~ptjm/
>I am using w32util version 1.5.0
>I am trying to retrieve the data from w32findeventlogentry when I make the
>call to the routine I get a return code of 1 which means an error.
>Thanks in advance
>Bill

>Here is my code.
>Start Code
>/* Comment */

>call rxfuncadd 'w32loadfuncs', 'w32util', 'w32loadfuncs'
>call w32loadfuncs

>trace(?I)

>Handle = w32openeventlog(, 'LOCAL MACHINE\System\CurrentControlSet\Services\Eventlog\security')

>Num_of_Records = w32getnumberofeventlogrecords(Handle)

>do J = 1 to Num_of_Records
> rc = w32findeventlogentry(Handle,J,'Stem') /* Problem Line */
> say Stem.id
> say id.0
> say id
>end

>rc = w32closeeventlog(Handle)

>exit
>End Code

>Start Trace

>C:\tapearc>rexx evlog.rex
>    12 *-* Handle = w32openeventlog(, 'LOCAL MACHINE\System\CurrentControlSet\Services\Eventlog\security')
>       >L>   "LOCAL MACHINE\System\CurrentControlSet\Services\Eventlog\security"
>       >F>   "14c538" /* Good Handle */
>       +++ Interactive trace.  "Trace Off" to end debug. ENTER to continue.

>    14 *-* Num_of_Records = w32getnumberofeventlogrecords(Handle)
>       >V>   "14c538"
>       >F>   "2034"    /* Valid number of Records */

>    16 *-* do J = 1 to Num_of_Records
>       >L>   "1"
>       >V>   "2034"
>       >V>   "1"

>    17 *-*  rc = w32findeventlogentry(Handle,42,'Stem')
>       >V>    "14c538"
>       >L>    "42"
>       >L>    "Stem"
>       >F>    "1"

>    18 *-*  say Stem.id
>       >L>    "ID"
>       >C>    "STEM.ID"
>       >L>    "STEM.ID"
>STEM.ID

>    19 *-*  say id.0
>       >C>    "ID.0"
>       >L>    "ID.0"
>ID.0

>    20 *-*  say id
>       >L>    "ID"
>ID

>    21 *-* end
>    16 *-* do J = 1 to Num_of_Records
>       >V>   "1"
>       >V>   "2"
>    17 *-*  rc = w32findeventlogentry(Handle,42,'Stem') Problem Line
>       >V>    "14c538"
>       >L>    "42"
>       >L>    "Stem"
>       >F>    "1"     <------ Return Code of 1

>    18 *-*  say Stem.id
>       >L>    "ID"
>       >C>    "STEM.ID"
>       >L>    "STEM.ID"
>STEM.ID
>End Trace

Lee Peedin
VP RexxLA
0101001001100101011110000111100001010000011001010111001001110100


Tue, 27 Sep 2005 20:32:11 GMT  
 
 [ 39 post ]  Go to page: [1] [2] [3]

 Relevant Pages 

1. OS/390 release test periods Re: default variable initialization under os/390 v2r8

2. Cobol OS/390 to C OS/390 V2R6

3. (newbie) how to clear display (os/390)

4. Rexx and C on OS/390

5. FTP in OS/390 MVS REXX

6. Rexx under OS/390 Webserver?

7. More powerful REXX on OS/390?

8. How to compile REXX in OS/390

9. QMF Rexx interface on OS/390 environment

10. 0C1 abend when running REXX program in OS/390

11. rexx os/390 - whosgot in batch

12. REXX and SQL (OS/390)

 

 
Powered by phpBB® Forum Software