FTP stage for ftping file from Linux server to Mainframe

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
sprane01
Participant
Posts: 8
Joined: Mon Aug 15, 2011 4:56 pm

FTP stage for ftping file from Linux server to Mainframe

Post by sprane01 »

My requirement is to ftp files from Linux server to Mainframe GDG's using the FTP enterprise stage.
Following is what I found in the documentation
The syntax for a relative path is:
ftp://host/path/filename
Where path is the relative path of the user's home directory.
The syntax for an absolute path is:
ftp://host//path/filename
While connecting to the mainframe system, the syntax for an absolute path is:
ftp://host/\'path.filename\'
The syntax for connecting to the mainframe system through USS (Unix System Services) is:
ftp://host//path/filename
Where path is the absolute path of the user's home directory.

I have tried all the above options for URI but still getting error message as follows. With different options the value of current directory changes but the error is still around "No such file or directory'.
Remote system type is POSIX (z/OS).
HFS directory `/u/grsds' is the current directory.
Error: EDC5129I No such file or directory., file: /u/grsds/N01.FILENAME
This is what I have in URI sftp://#HOST_SERVER#/./N01.FILENAME

I need some help with the syntax and other paramters that need to be set. Thanks
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

Here is a sample URI from my code:

Code: Select all

ftp://<url-style alias>/'<high-level-qualifier.secondqual.datasetname(gdg generation number)'
The alias (we call it a portal) redirects the session to the host location for the logon. Note that the dataset name is surrounded by single-quotes, which I note are missing from your URI sample. The other possibility is that your ftp logon id requires authorization to access the dataset, something you can't know from the error message (which is ambiguous at best).

The alias name has no slashes in it, only the periods. Except for the angle brackets, all of the text in my sample is directly replaceable, meaning the / and () are required.

I learned early on to never rely on the DataStage messaging out of FTP Enterprise. Go straight to the ftp log on the host to see if it has messages that might help you find the specific problem.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
sprane01
Participant
Posts: 8
Joined: Mon Aug 15, 2011 4:56 pm

Post by sprane01 »

can you give me an example of <url-style alias>. I am not a mainframe person and I think thats the part am missing. Thanks for your response
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

That's a question for your mainframe/ftp support as well. Here it looks just like a website name (changed here for security reasons, of course):

Code: Select all

zosname.anothername.com
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
sprane01
Participant
Posts: 8
Joined: Mon Aug 15, 2011 4:56 pm

Post by sprane01 »

thank you. Will try that
PaulVL
Premium Member
Premium Member
Posts: 1315
Joined: Fri Dec 17, 2010 4:36 pm

Post by PaulVL »

Keep in mind that your site might have a requirement to use Secure FTP option. Some sites mandate that protocol.

So you would need SSH keys set up between servers. If your site is also a GRID site, each server in the GRID would need those keys.
lstsaur
Participant
Posts: 1139
Joined: Thu Oct 21, 2004 9:59 pm

Post by lstsaur »

The hardest thing for me to do is to convince the mainframe side to open up its security.
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

lstsaur wrote:The hardest thing for me to do is to convince the mainframe side to open up its security.
I resemble your remark 8) but I also have strong sympathy for the security guys. Cross- and multi-platform environments tend to have more and larger "holes" in them.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
sprane01
Participant
Posts: 8
Joined: Mon Aug 15, 2011 4:56 pm

Post by sprane01 »

Its still not working. Below is what I find in the DS logs

Remote system type is POSIX (z/OS).
HFS directory `/u' is the current directory.
Error: No such data set, file: //'N01.abc.xyz(+1)'.n0
Remote system type is POSIX (z/OS).
HFS directory `/u' is the current directory.
Error: No such data set, file: //'N01.abc.xyz(+1)'.n1
Remote system type is POSIX (z/OS).
HFS directory `/u' is the current directory.
Error: No such data set, file: //'N01.abc.xyz(+1)'.n2
Remote system type is POSIX (z/OS).
HFS directory `/u' is the current directory.
Error: No such data set, file: //'N01.abc.xyz(+1)'.n3

In properties of FTP stage, I have URI = ftp://hostname/../'N01.abc.xyz(+1)' ; username ; transfer mode and force parallelism set.

only when i give ".." before the filename does the current HFS directory matches with the one in existing running sftp script. If I remove tht its /u/xyz and still the next error message is the same. n1 , n2 is getting added at runtime. Thats how we are passing the file name in the script but its not working here.
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

Let's start from the beginning. Though I might not know everything I need to, I might help you find something.

1) Verify that the pointers to the datasets actually exist in the 'u/' directory your messages are confirming.

2) At this point, I don't think it's a session authority problem. The construction of the dataset names does concern me, though, because just for example the gdg generation number usually is the very last part of the data set name. That your script is appending .n0 outside of the single quotes looks very strange to me.

You are at a level of detail where your in-house support should be able to find the problem. Without seeing the host ftp log, I don't think I can be of much more help. This last point is I think very important. You keep quoting the DS log. It won't tell you much. You need access to the host ftp logs for the actual sessions outside of DS.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
sprane01
Participant
Posts: 8
Joined: Mon Aug 15, 2011 4:56 pm

Post by sprane01 »

Let me re-phrase.
the URI value in DS FTP stage is URI = ftp://hostname/../'N01.abc.xyz(+1)'

Datastage is adding .n0 , .n1 etc ( which I see in the logs)

Is that the correct format of filename that the ftp stage is expecting?

Appreciate all your inputs so far.
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

Are you doing a file-pattern read for input? If so, and if you are expecting to see more than one file after the FTP, that may be the problem.

Try doing just one file at a time. If you are not doing a file pattern, I think I may be out of suggestions. Good luck, and post here your results especially if you succeed.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
Post Reply