Problem with IBM (MVS) Connection

Core FTP client questions and answers
Post Reply
dtw01
Posts: 50
Joined: Thu Sep 09, 2004 6:25 pm

Problem with IBM (MVS) Connection

Post by dtw01 »

I'm trying to connect to our Mainframe here at work. It gets past the login/password and changes the working directory etc.. , but then I am receiving the error: 501 Pathname required with null working directory.

A prompt box comes up with:

Cannot retrieve directory listing (server not responding).

Would you like to try the directory listing in the opposite mode (active/pasv)?

If I choose Yes, I get the 501 error again along with "Error loading directory..."

If I choose No, it simply sends it the QUIT command.

I've tried toggling the PASV check box and doesn't seem to matter. I'm using Version 1.3 build 1375 (coreftp pro evaluation 44 days remaining).

The only additional settings that I'm using is under Advanced Site Settings - General - I've got the Legacy Mode checked On and am using Server Type: MVS.

My operating system is XP sp1 and using microsofts ftp.exe does work to make this connection. Once I get this connection established, I would like to use this probram from the command line.

One other quick question on the capabilities of CoreFtp. Would it be possible once I get this session established to send a file to the mainframe as a (GDG) file? This would require using the QUOTE SITE command as would sending a file using a certain blocking factor.
dtw01
Posts: 50
Joined: Thu Sep 09, 2004 6:25 pm

Post by dtw01 »

I did as you suggested, but still no luck.

Here is the log:

Resolving mainframe.mayo.edu...
Connect socket #468 to 129.176.97.3, port 21...
220-FTPSERVE IBM FTP CS V1R5 at mfdevl.MAYO.EDU, 21:45:10 on 2004-09-09.
220 Connection will close if idle for more than 5 minutes.
USER tu00055
331 Send password please.
PASS **********
230 TU00055 is logged on. Working directory is "TU00055.".
SYST
215 MVS is the operating system of this server. FTP Server is running on z/OS.

500 unknown command
CWD ''/
501 Mismatched quotes on directory name "''/".
CWD ''/
501 Mismatched quotes on directory name "''/".
PWD
257 "'TU00055.'" is working directory.
PASV
227 Entering Passive Mode (129,176,97,3,82,250)
LIST
Connect socket #480 to 129.176.97.3, port 21242...
550 No data sets found.
Attemping Active mode transfer...
PORT 172,22,77,14,50,205
200 Port request OK.
LIST
550 No data sets found.
Error loading directory...


Any ideas?
dtw01
Posts: 50
Joined: Thu Sep 09, 2004 6:25 pm

Post by dtw01 »

I'm sorry. After changing to the settings you suggested and then looking a little closer, there were no files in the default login directory. After changing directories, the directory listing works just fine.

Thanks for your help.

Dave
dtw01
Posts: 50
Joined: Thu Sep 09, 2004 6:25 pm

Post by dtw01 »

FYI

The blocking factor is specified in the QUOTE SITE command, so I think you're covered.

The only thing I'm not sure about at this time without being able to specify the destination file name, is if a dgd could be sent. Normally when you send a gdg you would specify the destination file as something like such:

part1.part2.part3(+1)
dtw01
Posts: 50
Joined: Thu Sep 09, 2004 6:25 pm

Post by dtw01 »

It could easily be renamed as part1.part2.part3 ahead of time on the PC side, but it's the (+1) part that tells the mainframe to generate the final extention by using a special mainframe auto-incrementing seqence.

example of mainframe destination gdg files after FTPing 3 files.

part1.part2.part3.v001
part1.part2.part3.v002
part1.part2.part3.v003

I'm taking tomorrow (Friday) off as vacation, so I'll experiment more with this on Monday to see if I can possibly get it to work as is with using the SITE command. I'll let you know what I find out.
dtw01
Posts: 50
Joined: Thu Sep 09, 2004 6:25 pm

Post by dtw01 »

Just wondering if this was put into the last build? I tried testing it, but didn't have any luck. Maybe I'm not using it correctly though. When you implement this, are you going to have the file name right along with the -p switch (/path/filename), or have a separate switch just for the file name?

I tried it within the -p switch, but it tried to change to a directory like /path/filename/ which didn't exist.
dtw01
Posts: 50
Joined: Thu Sep 09, 2004 6:25 pm

Post by dtw01 »

Will do. :D

Is it OK to use the -p and -FN for both upload & download?
dtw01
Posts: 50
Joined: Thu Sep 09, 2004 6:25 pm

Post by dtw01 »

The reason I ask is that the -p doesn't seem to work correctly for an upload. It has problems changing directories.

If I use these command line options it works:

-site T-EDISRV02 -u \\CLMSRV03\JOBS$\TEST\EDI\DTW\XXX\DTW_TEST.TXT /TEST/

If I use these command line options is doesn't work.

-site T-EDISRV02 -u \\CLMSRV03\JOBS$\TEST\EDI\DTW\XXX\DTW_TEST.TXT -p /TEST/

I tested the -FN option and it seems to work with both the upload & download. e.g.

-site T-EDISRV02 -d /TEST/DTW_TEST2.TXT -p \\CLMSRV03\JOBS$\TEST\EDI\DTW\XXX\ -FN DTW_TEST3.TXT


I do think it would be nice however if the -p was allowed to give both the path & file name. The reason I say this is that we have jobs setup that have these command line parameters all setup ahead of time in a database, and if a person wants to quickly change an upload to a download, all they would have to do is change the 2 parameter switches. Here would be an example of an upload & download:


-site T-EDISRV02 -u \\CLMSRV03\JOBS$\TEST\EDI\DTW\XXX\DTW_TEST.TXT -p /TEST/DTW_TEST2.TXT -O

-site T-EDISRV02 -p \\CLMSRV03\JOBS$\TEST\EDI\DTW\XXX\DTW_TEST.TXT -d /TEST/DTW_TEST2.TXT -O

Pretty clean huh? :wink:
dtw01
Posts: 50
Joined: Thu Sep 09, 2004 6:25 pm

Post by dtw01 »

In order to test a mainframe gdg ftp from the command line, I need to be able to save off more than one line in the Post login commands box.

Any idea as to when that may be fixed?
dtw01
Posts: 50
Joined: Thu Sep 09, 2004 6:25 pm

Post by dtw01 »

Fantastic! :D
dtw01
Posts: 50
Joined: Thu Sep 09, 2004 6:25 pm

Post by dtw01 »

Build 1385 still didn't seem to fix the problem of being able to save off more than one line in the Post login commands box. Here is what it looks like inside the coreftp.cfg file.

Name=T-MAINFRAME
Desc=
Host=mainframe.mayo.edu
User=tu00055
HostT=10
PW=2570047AF1C8B46866B5D70B36509E79
Acct=
PthR=
PthL=
Sc1=
Sc2=cwd ..
cwd edit.ftp=
cwd edit.ftp=
cwd edit.ftp=
cwd edit.ftp=
SX1=

Notice how I've attempted to put the second line in there a bunch of times, but when I pull it back up it only shows "cwd..". :cry:
dtw01
Posts: 50
Joined: Thu Sep 09, 2004 6:25 pm

Post by dtw01 »

I should make a slight correction to my statement. When I close the application and re-open it and pull that Site back up it only shows the "cwd..".
dtw01
Posts: 50
Joined: Thu Sep 09, 2004 6:25 pm

Post by dtw01 »

It's been my experience in the past that Carriage Return & Line Feed (CR LF) characters can be handled a multitude of different ways when reading/writing to/from flat files.
dtw01
Posts: 50
Joined: Thu Sep 09, 2004 6:25 pm

Post by dtw01 »

XP SP1
dtw01
Posts: 50
Joined: Thu Sep 09, 2004 6:25 pm

Post by dtw01 »

Are you using the coreftp.cfg file or the registry? I'm pretty sure that when I was using the registry a couple weeks ago this wasn't a problem. Only when I'm using the coreftp.cfg file and sharing the profile between computers.

Just out of curiousity, what programming language / version is this written in? The only reason I ask is that I've seen a similiar issue with VB 6.0 and using the Line Input # and Print # statements. I'm currently in the process of converting all our apps to VB.Net 2003.
dtw01
Posts: 50
Joined: Thu Sep 09, 2004 6:25 pm

Post by dtw01 »

I had a similiar type of problem in VB 6 using a specific Line at a time type of a read. When reading in the line it would read until it encountered a CR/LF. The problem was that it wouldn't include that CR/LF in the buffer/variable that we were storing the data into. Then when it came time to re-write that buffer it would automatically append a CR/LF onto the line when it wrote it out. One of the things we were intentionally trying to do was change the CR/LF inside the buffer to something else and it took me a little while to figure out why is wasn't working (finding the CR/LF inside the buffer.)

Other types of systems/products (programming languages) may interpret the CR/LF and only re-write it as an individual CR or LF, or vise versa.

I've seen all kinds of weird combinations.
dtw01
Posts: 50
Joined: Thu Sep 09, 2004 6:25 pm

Post by dtw01 »

If you open your coreftp.cfg file up with Notepad, does your data show up as 2 separate lines or does it show up with 1 line and a non-printable character as in your previous example?

Mine shows up like this:

Sc2=cwd ..
cwd edit.ftp
dtw01
Posts: 50
Joined: Thu Sep 09, 2004 6:25 pm

Post by dtw01 »

As a matter of fact it's doing it on all 4 of the boxes. I typed in 3 test lines per box, closed the app and came back in and only the first line appeared for each one. Here's what's in the cfg file.

Sc1=Pre login commands line 1
Pre login commands line 2
Pre login commands line 3
Sc2=Post login commands line 1
Post login commands line 2
Post login commands line 3
Sx1=Pre transfer commands line 1
Pre transfer commands line 2
Pre transfer commands line 3
Sx2=Post transfer commands line 1
Post transfer commands line 2
Post transfer commands line 3
dtw01
Posts: 50
Joined: Thu Sep 09, 2004 6:25 pm

Post by dtw01 »

Could UNC possibly be the issue again?
dtw01
Posts: 50
Joined: Thu Sep 09, 2004 6:25 pm

Post by dtw01 »

Today I'm testing FTP's (uploading) to a mainframe (MVS) system & I've noticed a couple of things that probably need a little tweaking.

If I don't give it a destination path in the command line, the transfer does not work. Here's and example of the command line and the log output following. The bad part about this is that it returns a return code of 0 which my calling program treats as a successful transfer.

-site P-MAINFRAME-133 -u \\CLMSRV03\JOBS$\PROD\EDI\MFA\XXX\133\* -log \\CLMSRV03\JOBS$\PROD\EDI\MFA\XXX\EDIMFAXXX-061-FTP-133_2004-09-22_14-11-43.TXT -O

Started on Wednesday September 22, 2004 at 14:09:PMResolving mainframe.mayo.edu...
Connect socket #388 to 129.176.97.3, port 21...220-FTPSERVE IBM FTP CS V1R5 at mfdevl.MAYO.EDU, 14:09:37 on 2004-09-22.
220 Connection will close if idle for more than 5 minutes.
USER tu00055
331 Send password please.
PASS **********
230 TU00055 is logged on. Working directory is "TU00055.".
SYST
215 MVS is the operating system of this server. FTP Server is running on z/OS.
cwd ..
250 "" is the working directory name prefix.
cwd edip.ftp
250 "EDIP.FTP." is the working directory name prefix.
site recfm=fb lrecl=133 blksize=20881 wrap unit=prod pri=30 sec=30 CYL
200 SITE command was accepted
PWD
257 "'EDIP.FTP.'" is working directory.
CWD 'EDIP.FTP.'/
501 Mismatched quotes on directory name "'EDIP.FTP.'/".
PWD
257 "'EDIP.FTP.'" is working directory.
PORT 129,176,128,162,52,0
200 Port request OK.
LIST
125 List started OK
250 List completed successfully.
Transferred 20,681 bytes in 1.984 seconds
CWD
250 HFS directory TU00055. is the current working directory
PORT 129,176,128,162,52,1
200 Port request OK.
LIST
550 No data sets found.
Error loading directory...PWD
257 "'TU00055.'" is working directory.
TYPE I
200 Representation type is Image
PORT 129,176,128,162,52,2
200 Port request OK.
STOR MFTXMM.IPHTXT.Y2004.D0922.T061734
550-SVC99 Return code=4 S99INFO=0 S99ERROR=22280 HEX=5708 S99ERSN code X'00000000').
550 Unable to create data set TU00055.MFTXMM.IPHTXT.Y2004.D0922.T061734 for STOR command.
TYPE I
200 Representation type is Image
PORT 129,176,128,162,52,3
200 Port request OK.
STOR OWAXMM.IPHTXT.Y2004.D0922.T062236
550-SVC99 Return code=4 S99INFO=0 S99ERROR=22280 HEX=5708 S99ERSN code X'00000000').
550 Unable to create data set TU00055.OWAXMM.IPHTXT.Y2004.D0922.T062236 for STOR command.
Total uploaded files: 0
Total uploaded data: 0
Total downloaded files: 0
Total downloaded data: 0

The lines I have in bold are the Post Login commands that I'm sending it. Because I'm already manually changing to the correct directory and I'm not specifying any destination path from the command line, that's all it should have to do is the STOR.

Now here is the command line & log file if I include the Destination Path (but this won't work if I include the -p switch).

-site P-MAINFRAME-133 -u \\CLMSRV03\JOBS$\PROD\EDI\MFA\XXX\133\* /EDIP.FTP/ -log \\CLMSRV03\JOBS$\PROD\EDI\MFA\XXX\EDIMFAXXX-061-FTP-133_2004-09-22_14-21-48.TXT -O


Started on Wednesday September 22, 2004 at 14:20:PMResolving mainframe.mayo.edu...
Connect socket #392 to 129.176.97.3, port 21...220-FTPSERVE IBM FTP CS V1R5 at mfdevl.MAYO.EDU, 14:20:33 on 2004-09-22.
220 Connection will close if idle for more than 5 minutes.
USER tu00055
331 Send password please.
PASS **********
230 TU00055 is logged on. Working directory is "TU00055.".
SYST
215 MVS is the operating system of this server. FTP Server is running on z/OS.
cwd ..
250 "" is the working directory name prefix.
cwd edip.ftp
250 "EDIP.FTP." is the working directory name prefix.
site recfm=fb lrecl=133 blksize=20881 wrap unit=prod pri=30 sec=30 CYL
200 SITE command was accepted
PWD
257 "'EDIP.FTP.'" is working directory.
CWD 'EDIP.FTP.'/EDIP.FTP/
501 Mismatched quotes on directory name "'EDIP.FTP.'/EDIP.FTP/".
PWD
257 "'EDIP.FTP.'" is working directory.
PORT 129,176,128,162,114,159
200 Port request OK.
LIST
125 List started OK
250 List completed successfully.
Transferred 20,587 bytes in 1.281 seconds
CWD /EDIP.FTP/
550 CWD cmd failed : EDC5129I No such file or directory. (errno2=0x05190050)
PWD
257 "'EDIP.FTP.'" is working directory.
PORT 129,176,128,162,114,160
200 Port request OK.
LIST
125 List started OK
250 List completed successfully.
Transferred 20,587 bytes in 0.891 seconds
TYPE I
200 Representation type is Image
PORT 129,176,128,162,114,161
200 Port request OK.
STOR MFTXMM.IPHTXT.Y2004.D0922.T061734
125 Storing data set EDIP.FTP.MFTXMM.IPHTXT.Y2004.D0922.T061734
250 Transfer completed successfully.
TYPE I
200 Representation type is Image
PORT 129,176,128,162,114,162
200 Port request OK.
STOR OWAXMM.IPHTXT.Y2004.D0922.T062236
125 Storing data set EDIP.FTP.OWAXMM.IPHTXT.Y2004.D0922.T062236
250 Transfer completed successfully.
Total uploaded files: 2
Total uploaded data: 67 KB
Total downloaded files: 0
Total downloaded data: 0

This transfer actually works, but as you can see from the log it still is generating a few errors while trying to change directories.


The last thing that I can not get to work is the option to "Delete source file after transfer". I can't get it to delete the source files either through the GUI or command line while attempting to upload these files to the mainframe. I've tried everything I can think of as far as toggling on & off & exitting the application and retrying. The setting isn't getting lost at all, it's just not deleting the files. Could this have anything to do with the errors that are being generated by the directory changes failing? Does the program look through the log to see if any 5XX errors were generated, and if so that is doesn't delete the source files?
Post Reply