Page 1 of 1

Getting file from mainframe server

Posted: Wed Aug 29, 2007 12:02 pm
by horserider
I want to get a file from mainframe server(text mode or ascii mode) to the datastage server via a shell script using FTP.

Is there a sample FTP script available?

Thanks for your help.

Posted: Wed Aug 29, 2007 3:19 pm
by ArndW
You have two main ways of getting the file - using FTP from your system or using DataStage FTP. In the former, you should google your OS name and "ftp script" because each flavor of UNIX is a bit different in how it allows scripting the commands and you might find an example for your mainframe OS connectivity strings as well. If you intend on using the DataStage FTP to do a line-by-line transfer of data the options in the stage should be pretty clear, as are the error messages when it doesn't work.
Alternatively, you could post the OS information for both ends and perhaps someone who has already gone through that might post their script.

Posted: Wed Aug 29, 2007 7:38 pm
by shamshad
If you are planning to get the data from mainframe and load it in DS server, you can use the usual FTP command like

ftp <domain name for mainframe server>
mget the filename

You can use the shell script in prescript in job sequencer.

But if you just want to read the data, then either use FTP plugin for either parallel or server job. I have seen that FTP plug in and FTP enterprise may sometimes gives different results when trying to read file that has COMP fields / Signed numeric. I would suggest do some research before using Datastage FTP although in most of the cases it should work just fine.

Posted: Thu Aug 30, 2007 10:40 am
by srimitta
Here you go ENJOY :D

typeset USER= <mainframe USERID>
typeset PASS= <mainframe PASSWORD>

DATA_DIR = <Unix Box DataStage Server Directory Path>
OUTPUT_FILE = <Unix Box File Name>

ftp -nvi <HOSTNAME / IP Address> <<-ptf
quote user $USER
quote pass $PASS
binary
lcd $DATA_DIR
get $OUTPUT_FILE
quit
ptf