Sergio,
Someone always has to remind folks who write CMS execs in Rexx:
1-Always code: Address Command
right after the comment at the top.
2-Upper case and quote *all* commands to the underlying system and do not
abbreviate them.
3-When executing another exec, code: "EXEC execname
4-Similarly, a command to CP should start with: "CP cpcommand
Doing the above will save you much heartache and improve performance.
Speaking of performance, remember that Parse is your friend when breaking up
data strings, as it's optimized for the hardware on the mainframe.
Les
McKown, John wrote:
In your FTP1 EXEC, try replacing the line:
ftp "172.16.11.6"
with
"ftp 172.16.11.6 (EXIT"
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
________________________________
From: The IBM z/VM Operating System [mailto:ib...@listserv.uark.edu] On Behalf
Of Sergio Lima
Sent: Wednesday, June 16, 2010 12:34 PM
To: IBMVM@LISTSERV.UARK.EDU
Subject: Test Return Code using FTP under VM/CMS
Hi List,
We made a EXEC here, that do a automation.
This exec work with WAKEUP RDR, then Receive files, and next do a FTP to a
Windows Server Machine.
Here is the REXX code :
volta:
DO FOREVER
'WAKEUP (RDR '
IF RC = 4 THEN DO
'EXECIO * CP (STEM LINES. STRING QUERY RDR * ALL'
end
Do i=1 to Lines.0
if word(lines.i,1) = 'ORIGINID' then nop
else do
fn = word(lines.i,1)
numero = word(lines.i,2)
data = word(lines.i,8)
hora = word(lines.i,9)
ft = substr(data,1,2) || substr(data,4,2) || ,
substr(hora,1,2) || substr(hora,4,2)
fm = a
"cp spool c nohold"
read fn ft "a" "(replace"
if rc <> 0 then exit
call FTP1 fn ft
signal volta
end
end
Here, the FTP1 EXEC :
/* */
arg fn ft
queue "anonymous a...@a<mailto:a...@a>"
queue "put "fn"."ft".a "fn"."ft".printlog.txt"
queue "quit"
ftp "172.16.11.6"
if rc <> 0 then do
"cp msg operator .... danger message ... "
exit
end
if rc = 0 then do
call gravalog
end
return
gravalog:
data = date(u)
hora = time()
campo = data || ' ' || hora || ' ' || fn || ' ' || ft
queue campo
'EXECIO 1 DISKW' printlog log a
return
If the FTP don't run well, We need get the Return Code, but when FTP fails the
Return Code also was 0, this the test :
USER (identify yourself to the host):
USER anonymous
331 Anonymous access allowed, send identity (e-mail name) as password.
PASS ********
230 Anonymous user logged in.
Command:
Local file not found or cannot be accessed.
Command:
QUIT
221
12 *-* if rc <> 0
>>> "0"
18 *-* if rc = 0
>>> "1"
*-* then
*-* do
19 *-* call gravalog
24 *-* gravalog:
26 *-* data = date(u)
>>> "06/16/10"
27 *-* hora = time()
Anybody already used this ?
Thanks very much.
Sergio Lima Costa
Sao Paulo - Brazil
________________________________
TRANSFORME SUAS FOTOS EM EMOTICONS PARA O MESSENGER. CLIQUE AQUI E VEJA
COMO.<http://ilm.windowslive.com.br/?ocid=ILM:Live:Hotmail:Tagline:1x1:TRANSFORME77:->