If you can use the TSO MOUNT command to mount the directory using NFS from z/OS everything should work as explained. You might check to see if you have the MVSNFSC task (z/OS NFS Client) running (default name). The other challenges are file permissions and your effective GID/UID. Assuming you can work through these, the REXX is pretty simple. I have some example code that does what you want. In my case it was simply removing line numbers from the end of each record that had line numbers and rewriting the file.
Here is the code (not pretty - include lots of debugging mesages).
000001 /*********************************************************************/
000002 /* REXX */
000003 /*********************************************************************/
000004 /* Purpose: Sample USS REXX EXEC */
000005 /*-------------------------------------------------------------------*/
000006 /* Syntax: USSRDRF path */
000007 /*-------------------------------------------------------------------*/
000008 /* Parms: PATH - Fully qualified path to a directory */
000009 /* */
000010 /*********************************************************************/
000011 /* Change Log */
000012 /* */
000013 /* Author Date Reason */
000014 /* -------- --------- ----------------------------------------- */
000015 /* R. Zenuk Jan 2012 Initial Creation */
000016 /* */
000017 /*********************************************************************/
000018 parse arg path
000019 /*********************************************************************/
000020 /* Dub the address space to allow it to use USS REXX commands */
000021 /*********************************************************************/
000022 if syscalls('ON') <> 0 then say 'Error dubbing address space'
000023 /*********************************************************************/
000024 /* Use the readdir command */
000025 /*********************************************************************/
000026 EXITRC = ussapi('readdir' path 'file.' 'stat.')
000027 /*********************************************************************/
000028 /* Print the results */
000029 /*********************************************************************/
000030 say 'Files found in' path
000031 do i=1 to file.0
000032 select
000033 when stat.i.ST_TYPE = S_ISDIR then say file.i 'DIRECTORY'
000034 when stat.i.ST_TYPE = S_ISREG then
000035 do
000036 filepath = path||file.i
000037 EXITRC = ussapi('readfile' filepath 'rec.')
000038 if EXITRC = 0 then
000039 do
000040 say center(' FILE:' file.i 'BEGIN ',78,'-')
000041 do j=1 to rec.0
000042 say 'BEFORE RECORD:'j 'LENGTH:'length(rec.j)': 'rec.j
000043 if datatype(right(rec.j,8)) = 'NUM' then
000044 rec.j = strip(substr(rec.j,1,length(rec.j)-8))
000045 say 'AFTER RECORD:'j 'LENGTH:'length(rec.j)': 'rec.j
000046 mode = '777'
000047 EXITRC = ussapi('writefile' filepath mode 'rec.')
000048 end
000049 say center(' FILE:' file.i rec.0 'RECORDS ',78,'-')
000050 end
000051 end
000052 otherwise say file.i 'TYPE='stat.i.ST_TYPE
000053 end
000054 end
000055 /*********************************************************************/
000056 /* Undub */
000057 /*********************************************************************/
000058 call syscalls('OFF')
000059 exit(EXITRC)
000060 /*********************************************************************/
000061 /* USS API subroutine - execute API and generic error handling */
000062 /*********************************************************************/
000063 ussapi: parse arg usscmd
000064 say center(' Before' usscmd' ',76,'-')
000065 address SYSCALL usscmd
000066 say 'RETVAL='RETVAL 'ERRNO='ERRNO 'ERRNOJR='ERRNOJR
000067 if ERRNO <> 0 | ERRNOJR <> 0 then
000068 do
000069 address SYSCALL 'strerror' ERRNO ERRNOJR 'err.'
000070 say
000071 say err.SE_ERRNO
000072 say
000073 parse var err.SE_REASON . '15'x errmsg
000074 say errmsg
000075 say
000076 say err.SE_ACTION
000077 end
000078 say center(' After' usscmd' ',76,'-')
000079 return RETVAL
Rob
-----Original Message-----
From: Donald Johnson <
dej...@GMAIL.COM>
To: TSO-REXX <
TSO-...@VM.MARIST.EDU>
Sent: Wed, Jan 18, 2012 6:48 am
Subject: Re: How to handle Unix text file with stem vars
John, there is some great info here, and I appreciate your guidance. I have
ound out that we have an appliance here to share file systems - probably a
amba server. I hope to learn more from those infrastructure guys today. I
ill also look at Co:Z to see what that offers.
Thanks again - I will let you know if I run into anything else
don*