|
|
| Author |
Message |
reachcyrus
New User
Joined: 13 Jul 2007 Posts: 24 Location: chennai
|
|
|
|
Hi,
My requirement is to ftp few datasets from mainframes to PC.
I have the list of datasets to be ftp in a sequential file.
Is there any rexx command or program to transfer a file from mainframes to desktop.
I dont want to do ftp manual!!!!!!!
Cheers!!
Vijay |
|
| Back to top |
|
 |
References
|
Posted: Fri Jul 13, 2007 7:16 pm Post subject: Re: Any Rexx program to ftp a dataset from mainframe to pc |
 |
|
|
 |
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 2435 Location: Brussels once more ...
|
|
|
|
This, or a similar topic has been discussed quite recently.
Please use the search facility. |
|
| Back to top |
|
 |
superk
Moderator Team Head
Joined: 26 Apr 2004 Posts: 3001 Location: Charlotte,NC USA
|
|
|
|
I may not be getting the question entirely, but it seems like a relatively trivial task to open the dataset list, build an ftp "put" command for each dataset, and then run FTP using the generated "put" list.
Or, am I missing something here? |
|
| Back to top |
|
 |
superk
Moderator Team Head
Joined: 26 Apr 2004 Posts: 3001 Location: Charlotte,NC USA
|
|
|
|
This is a simple exec that I use. It's designed to run as an ISPF EDIT macro, bit you can use any portions of it you might wish to:
| Code: |
/* REXX FTPIT */
"ISREDIT MACRO"
"ISREDIT (currdsn) = DATASET"
"ISREDIT (currmem) = MEMBER"
Parse Upper Source . . execname . execdsn . . execenv .
"ALLOC DD(SYSPRINT) DUMMY REU"
"ALLOC DD(OUTPUT) DUMMY REU"
ddnftp = '#'Right(Time(S),7,'0')
If Length(currmem) <> 0 Then
Do
"ALLOC DD("ddnftp") DA('"currdsn"("currmem")') SHR REU"
End
Else
Do
"ALLOC DD("ddnftp") DA('"currdsn"') SHR REU"
End
/* Process inline panel and message definitions */
ddname = '$'Right(Time(S),7,'0')
memname = 'ZZ'
"ALLOC DD("ddname") NEW REU RECF(F B) LRECL(80) DIR(2) SP(1) TR"
"ISPEXEC LMINIT DATAID(did) DDNAME("ddname") ENQ(EXCLU)"
"ISPEXEC LMOPEN DATAID("did") OPTION(OUTPUT)"
Do 1
Do a = 1 To 999 Until Substr(line,1,8) = '/*MEMBER'
line = Sourceline(a)
End
Parse Var line . memname .
Do a = (a + 1) To 999 While Substr(line,1,2) <> '*/'
line = sourceline(a)
"ISPEXEC LMPUT DATAID("did") MODE(INVAR) DATALOC(line) DATALEN(80)"
End
"ISPEXEC LMMADD DATAID("did") MEMBER("memname")"
End
"ISPEXEC LMFREE DATAID("did")"
"ISPEXEC LIBDEF ISPPLIB LIBRARY ID("ddname") STACK"
"ISPEXEC DISPLAY PANEL(FTPIT)"
If rc = 0 Then
Do
Queue "sendsite"
Queue "ascii"
Queue "cd temp"
Queue "put //dd:"ddnftp" "filename
Queue "qui"
x = Outtrap(x.)
"FTP "server" 21 (Exit=8"
retcode = rc
x = Outtrap(Off)
If retcode = 0 Then zedlmsg = 'Success'
Else zedlmsg = 'Failed'
zedlmsg = Time('L') execname zedlmsg 'RC='retcode
"ISPEXEC SETMSG MSG(ISRZ000)"
End
Exit 0
/*MEMBER FTPIT
)Attr Default(%+_)
$ Type(Input) Intens(Low) Pad(_) Caps(Off)
_ Type(Input) Intens(Low) Pad(_) Caps(On)
! Type(Input) Intens(Low) Pad(' ') Caps(Off)
` Type(Output) Intens(HIGH)
)Body Expand(//) Width(80) Cmd()
%/-/ FTP Processing Facility /-/+
%Command ==>!zcmd +
+
+Enter FTP Server Address%=>_z +
+Enter Target Filename %=>_z +
+
+
+
+
+Enter%Enter+to continue or%End+to Exit.
)Init
.zvars = '(server filename)'
)Proc
)End
*/
|
|
|
| Back to top |
|
 |
arnth01
New User
Joined: 15 Jan 2008 Posts: 2 Location: Evanston, IL
|
|
|
|
Hey superk,
This is a pretty slick exec if I could get it to work. I am not an FTP expert so I could use so help what to fill in here.
1) Is the "FTP Server Address" the IP address or URL of the mainframe?
2) Is the "Target Filename" the filename on my PC?
I was getting these errors:
IKJ56500I COMMAND CD NOT FOUND
IKJ56500I COMMAND PUT NOT FOUND
IKJ56500I COMMAND QUI NOT FOUND
Enter FTP Server Address => ____________________________
Enter Target Filename => ____________________________
Thanks,
Tom |
|
| Back to top |
|
 |
superk
Moderator Team Head
Joined: 26 Apr 2004 Posts: 3001 Location: Charlotte,NC USA
|
|
|
|
| arnth01 wrote: |
1) Is the "FTP Server Address" the IP address or URL of the mainframe?
2) Is the "Target Filename" the filename on my PC? |
1. The "FTP Server Address" is the TCP/IP address, or domain name, of the REMOTE FTP Server you're connecting to.
2. Yes. It's the target filename on the remote FTP server. It's an optional field. |
|
| Back to top |
|
 |
kavya123
New User
Joined: 11 Jul 2007 Posts: 35 Location: hyderabad
|
|
|
|
Hi SuperK,
When i tried to use the code given by you, i am getting following error.
| Code: |
25 +++ line = Sourceline(a)
IRX0040I Error running REXFTP, line 25: Incorrect call to routine
*** |
Could you please guide me whats going wrong?? |
|
| Back to top |
|
 |
enrico-sorichetti
Global Moderator
Joined: 14 Mar 2007 Posts: 2291 Location: italy
|
|
|
|
the most common issue with sourceline and invalid call message
is that You are trying to sourceline after the end of file
the best way to avoid it is to find the number of lines in the rexx script with
| Code: |
| lines = sourceline() |
to test it
| Code: |
EDIT USER.CLIST(Z) - 01.02 Columns 00001 00072
Command ===> Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 /*REXX - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
000002 /* */
000003 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
000004 Trace "O"
000005 lines = sourceline()
000006 do l = 1 to lines
000007 say l sourceline(l)
000008 end
000009 exit
****** **************************** Bottom of Data ****************************
|
|
|
| Back to top |
|
 |
|
|