-Original Message-
From: IBM Mainframe Discussion List
[mailto:ibm-m...@bama.ua.edu] On Behalf Of Hilario Garcia
Sent: Friday, May 21, 2010 3:41 AM
To: IBM-MAIN@bama.ua.edu
Subject: How to validate the existence of a file on a Server via JCL
I would like to know how to test the existence of a file on a
Server Directory
(Windows or Linux) and if exist to execute a job step in an z/os jcl.
Thanks in advance.
Hilario
How are you accessing the Windows/Linux server? Is the Windows/Linux
file/directory directly readable on z/OS using SMB or NFS? Or do you need to
use something like ftp?
For FTP, run a step like:
//FTP03EXEC PGM=FTP,REGION=6M,PARM='(EXIT'
//SYSPRINT DD SYSOUT=*
//OUTPUT DD SYSOUT=*,DCB=BLKSIZE=133
//INPUTDD *
server.name
user
password
ls file-name-to-test
/*
//EXISTS EXEC PGM=DOIT,COND=(0,NE,FTP03)
//... MORE JCL
//*
Now, if you're using SMB or NFS to directly read the server's data as it if
were a local UNIX file, then it would be similar, but different.
//TESTIT EXEC PGM=BPXBATCH,
// PARM='ls file-to-test'
//STDOUT DD SYSOUT=*
//STDERR DD SYSOUT=*
//STDIN DD PATH='/dev/null',PATHOPTS=(ORDONLY)
//*
//EXISTS EXEC PGM=DOIT,COND=(0,NE,TESTIT)
//... MORE JCL
//*
--
John McKown
Systems Engineer IV
IT
Administrative Services Group
HealthMarkets(r)
9151 Boulevard 26 * N. Richland Hills * TX 76010
(817) 255-3225 phone * (817)-961-6183 cell
john.mck...@healthmarkets.com * www.HealthMarkets.com
Confidentiality Notice: This e-mail message may contain confidential or
proprietary information. If you are not the intended recipient, please contact
the sender by reply e-mail and destroy all copies of the original message.
HealthMarkets(r) is the brand name for products underwritten and issued by the
insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance
Company(r), Mid-West National Life Insurance Company of TennesseeSM and The
MEGA Life and Health Insurance Company.SM
--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html