Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

FTP in REXX

862 views
Skip to first unread message

Gangireddy, Siva Pratap Reddy

unread,
Aug 7, 2008, 5:20:04 AM8/7/08
to

Hi,

I required help to create the REXX program for FTP in Mainframe. I have
to check the file availability on server using REXX. Can anyone help me
on this.

Thanks & Regards
Siva

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX

Captain Paralytic

unread,
Aug 7, 2008, 6:00:07 AM8/7/08
to
On 7 Aug, 10:20, sivapratapreddy.gangire...@EDS.COM (Gangireddy, Siva

Pratap Reddy) wrote:
> Hi,
>
> I required help to create the REXX program for FTP in Mainframe. I have
> to check the file availability on server using REXX. Can anyone help me
> on this.
>
> Thanks & Regards
> Siva
>
> ----------------------------------------------------------------------
> For TSO-REXX subscribe / signoff / archive access instructions,
> send email to LISTS...@VM.MARIST.EDU with the message: INFO TSO-REXX

Well AFAIK RXFTP isn't available for z/OS.
However, you could tackle this by invoking FTP, looking for the file
and directing the output to a dataset, then read the dataset to see if
the file was found.

Bob Hamilton

unread,
Aug 7, 2008, 6:39:32 AM8/7/08
to
Can you do it in batch JCL? IF so, then put the stuff in
sysin in the queue, allocate the files (input, output,
sysout et c) then ADDRESS mvs and CALL *FTP should do it.

bobh

On Thu, 7 Aug 2008 14:47:59 +0530
"Gangireddy, Siva Pratap Reddy"

Captain Paralytic

unread,
Aug 7, 2008, 6:45:20 AM8/7/08
to
On 7 Aug, 11:39, air.m...@VINTAGE-AERO.COM (Bob Hamilton) wrote:
> Can you do it in batch JCL? IF so, then put the stuff in
>  sysin in the queue, allocate the files (input, output,
> sysout et c) then ADDRESS mvs and CALL *FTP should do it.
You don't need batch JCL to do this. The files can be allocated and
populated within the REXX Exec and FTP kicked off from there too.

Cruz, Robert

unread,
Aug 7, 2008, 12:03:18 PM8/7/08
to
Based on my experience with this approach, you may have to read back in
the output from FTP to check your results (such as whether or not the
file was available on the server), because return codes from FTP are
limited.

bobh

--------------------------------------------------------

The information contained in this message is intended only for the recipient, and may be a confidential attorney-client communication or may otherwise be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, please be aware that any dissemination or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify us by replying to the message and deleting it from your computer. The McGraw-Hill Companies, Inc. reserves the right, subject to applicable local law, to monitor and review the content of any electronic message or information sent to or from McGraw-Hill employee e-mail addresses without informing the sender or recipient of the message.
--------------------------------------------------------

Gangireddy, Siva Pratap Reddy

unread,
Aug 7, 2008, 12:17:08 PM8/7/08
to
Thanks for your help.


Thanks and Regards,
Gangireddy Siva Pratap Reddy

Jack Kelly

unread,
Aug 7, 2008, 12:18:05 PM8/7/08
to
<snip>

check the file availability on server using REXX.
<unsnip>

Couldn't you just check the DSN with "available = SYSDSN('myrexx.exec')"
before before calling FTP or listdsi ?

Jack Kelly
202-502-2390 (Office)

McKown, John

unread,
Aug 7, 2008, 12:25:42 PM8/7/08
to
> -----Original Message-----
> From: TSO REXX Discussion List
> [mailto:TSO-...@VM.MARIST.EDU] On Behalf Of Jack Kelly
> Sent: Thursday, August 07, 2008 11:18 AM
> To: TSO-...@VM.MARIST.EDU
> Subject: Re: [TSO-REXX] FTP in REXX
>
> <snip>
> check the file availability on server using REXX.
> <unsnip>
>
> Couldn't you just check the DSN with "available =
> SYSDSN('myrexx.exec')"
> before before calling FTP or listdsi ?
>
> Jack Kelly
> 202-502-2390 (Office)

He's probably doing a GET to retrieve the file from the remote end. So
he needs to do a "cd" (maybe) and a "dir" and check the status that the
file exists on the far end.

--
John McKown
Senior Systems Programmer
HealthMarkets
Keeping the Promise of Affordable Coverage
Administrative Services Group
Information Technology

The information contained in this e-mail message may be privileged
and/or confidential. It is for intended addressee(s) only. If you are
not the intended recipient, you are hereby notified that any disclosure,
reproduction, distribution or other use of this communication is
strictly prohibited and could, in certain circumstances, be a criminal
offense. If you have received this e-mail in error, please notify the
sender by reply and delete this message without copying or disclosing
it.

Cruz, Robert

unread,
Aug 7, 2008, 12:28:07 PM8/7/08
to
The original post indicated that the file to be checked for was on the
server (meaning remote *nix or Windoze box), if I understood it
correctly. On that basis, the check for the presence of this file would
have to be done by FTP, rather than on MVS.

--------------------------------------------------------

The information contained in this message is intended only for the recipient, and may be a confidential attorney-client communication or may otherwise be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, please be aware that any dissemination or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify us by replying to the message and deleting it from your computer. The McGraw-Hill Companies, Inc. reserves the right, subject to applicable local law, to monitor and review the content of any electronic message or information sent to or from McGraw-Hill employee e-mail addresses without informing the sender or recipient of the message.
--------------------------------------------------------

----------------------------------------------------------------------

Gangireddy, Siva Pratap Reddy

unread,
Aug 7, 2008, 12:34:01 PM8/7/08
to
Hi,

I got the solution to my requirement and sharing the same here. Thanks
for a lot for your help.

/* rexx */
hostname = 'your.ftp.server'
input.1 = 'userid pw'
input.2 = 'cd mydir'
input.3 = 'DIR FILE.TXT'
input.4 = 'QUIT'
"ALLOC F(INPUT) UNIT(VIO) LRECL(80) SPACE(1) TRACKS RECFM(F B)"
"EXECIO * DISKW INPUT (STEM INPUT. FINIS"
"ALLOC F(OUTPUT) UNIT(VIO) LRECL(121) SPACE(1 10) CYLINDERS RECFM(V B)"

"FTP" hostname "(EXIT"
"EXECIO * DISKR OUTPUT (STEM OUTPUT. FINIS"
do i=1 to output.0
parse var output.i msgid dirline
if msgid = 'EZA2284I' then
say dirline
end
"FREE F(INPUT OUTPUT)"


Thanks and Regards,
Gangireddy Siva Pratap Reddy

Robert Zenuk

unread,
Aug 7, 2008, 3:29:21 PM8/7/08
to
Hmmm... That looks familiar...
_http://www2.marist.edu:8000/htbin/wlvtype?TSO-REXX.18599_ (http://www2.marist.edu:8000/htbin/wlvtype?TSO-REXX.18599)

Rob


In a message dated 8/7/2008 9:34:00 A.M. US Mountain Standard Time,
sivapratapred...@EDS.COM writes:

Hi,

--------------------------------------------------------


**************Looking for a car that's sporty, fun and fits in your budget?
Read reviews on AOL Autos.
(http://autos.aol.com/cars-BMW-128-2008/expert-review?ncid=aolaut00050000000017 )

Mike Holder

unread,
Aug 15, 2008, 10:15:34 AM8/15/08
to
Within a REXX, is there a way to clean up a catalog entry that does not
have a dataset?

I have run into a situation that happens periodically where the dataset
gets deleted from the DASD but the catalog entry does not get cleaned
up. I can use a TSO DELETE to delete a cataloged dataset but I get the
following error messages when only the catalog entry exists:

IKJ56232I DATA SET TEST.FILE NOT ON VOLUME AS INDICATED IN THE CATALOG
OR VOL PARAMETER
IDC0551I ** ENTRY TEST.FILE NOT DELETED
IDC0014I LASTCC=8

Mike Holder

unread,
Aug 15, 2008, 10:46:08 AM8/15/08
to
Looks like I answered my own question. A TSO DELETE PURGE will only
clean up a dataset that is found on the DASD, but a DELETE NOSCRATCH
will delete the catalog entry without caring if the dataset is on the
DASD.

Thanks anyway!

-----Original Message-----
From: Mike Holder
Sent: Friday, August 15, 2008 10:14 AM
To: 'TSO REXX Discussion List'
Subject: Clean up catalog entry?

Within a REXX, is there a way to clean up a catalog entry that does not
have a dataset?

I have run into a situation that happens periodically where the dataset
gets deleted from the DASD but the catalog entry does not get cleaned
up. I can use a TSO DELETE to delete a cataloged dataset but I get the
following error messages when only the catalog entry exists:

IKJ56232I DATA SET TEST.FILE NOT ON VOLUME AS INDICATED IN THE CATALOG
OR VOL PARAMETER IDC0551I ** ENTRY TEST.FILE NOT DELETED IDC0014I
LASTCC=8

----------------------------------------------------------------------

0 new messages