Getting file from mainframe server

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
horserider
Participant
Posts: 71
Joined: Mon Jul 09, 2007 1:12 pm

Getting file from mainframe server

Post 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.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
shamshad
Premium Member
Premium Member
Posts: 147
Joined: Wed Aug 25, 2004 1:39 pm
Location: Detroit,MI

Post 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.
srimitta
Premium Member
Premium Member
Posts: 187
Joined: Sun Apr 04, 2004 7:50 pm

Post 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
Post Reply