Read Binary file from AS400

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
rumu
Participant
Posts: 286
Joined: Mon Jun 06, 2005 4:07 am

Read Binary file from AS400

Post by rumu »

Hi All,

There is one Binary file which needs to be accessed from AS400 server. I have asked to push the file to DS server but that seems to be not possible by the third party who support the application.

I need the file to be landed in DS server. Can I use the z/os stage to connect to the AS400 and land it to datastage server? I was going through the stage properties, not getting all the properties very clear though. What changes to be made at configuration side?
Rumu
IT Consultant
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So when you say "binary file" are we still talking about an EBCDIC file? And probably still from a COBOL source, I would guess.

And I would imagine that transfer is perfectly possible, they just don't want to do it for you. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
rumu
Participant
Posts: 286
Joined: Mon Jun 06, 2005 4:07 am

Post by rumu »

I know Craig,

They can do it for sure but they are so much no co operative....They say as the file size is big ie 30 gig so transfer can not be done...If I have to use FTP stage to get it transferred then similar issue will arise....Could you please suggest how do I proceed as they don't transfer it.
Rumu
IT Consultant
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

The z/OS stage still requires a connection channel which your source platform must support, and on which they must grant your application access. FTP, however, is simpler. All they need to do is grant your ftpid authority to logon to their system, and give it access to the file you need.

Code: Select all

FTP Enterprise ===> Sequential File
A file that size is beyond my experience with in-job FTP, where your data proceeds on one or more links to other stages. I would use a separate job that just uses FTP to land the file on your DS server. From there, if you preserve the EBCDIC set, you can use CFF to read the file.
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
rumu
Participant
Posts: 286
Joined: Mon Jun 06, 2005 4:07 am

Post by rumu »

Hi Frank,

Thanks, I will use FTP stage to read the file from AS400 and land it to a sequential in a separate Job.

In FTP enterrpise stage, under the Source there in URI, my AS400 directory is as below:

\\ibgp01/RFC7018FDR/IBSFDRCA. So I should mention the following in URI?

Under connection, do I need to use User name and Password to connect to the above folder of the AS400 system? Also, do i need to use ftp option also under connection ?
Also, under Transfer protocol, there is one option called Transfer method--which I assume should be FTP?

In Target Sequential stage , I will write the entire record in one row of Varbinary type?
When you say, preserve, EBCDIC format, does that mean to specify the following?

Format-->General-->Character Set=EBCDIC?Do I ned to mention anyother option under General? to preserve EBCDIC mode?
Do I need to set . Final redileter under Record Level?
Rumu
IT Consultant
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

Try the following:

Code: Select all

FTP Enterprise:
Source -- URI = ftp://#ftp server name#/'#[fully qualified file location and name]#'

Connection -- Password = #password parameter#
User name = #user name parameter#

Transfer Protocol -- empty, FTP is default

Sequential File Format tab:
Right-click on Record level and click on Remove all.
Right-click again and select Format as -- Mainframe (COBOL)

The default settings from that will preserve the EBCDIC set and formatting.
The # delimiter identifies the parameters for compiling and running. You can hard-code them to test your job, omitting #.
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
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

I missed your question about the output column. I define one column sql type Binary (not Var), and leave the length blank. With no delimiters in your data, it will output as one continuous stream.
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
rumu
Participant
Posts: 286
Joined: Mon Jun 06, 2005 4:07 am

Post by rumu »

Thanks Frank..

I think this approach will not work for my case as the the binary file is variable length file and if I output as one continuous record then I cant read it...This approach would have worked in case of true Fixed width file. Currently I am reading the file (test file pushed to datastage server) by converting it to fixed width record by adding spaces at the end and then reading using copybook.
Can I use record delimiter and 'end' under record level while writing to sequential file stage as data type binary?
Rumu
IT Consultant
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

rumu wrote:Can I use record delimiter and 'end' under record level while writing to sequential file stage as data type binary?
I honestly don't know. Try it, experiment, tell us how it turns out. I assume it will involve a transformer to do the padding.
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
rumu
Participant
Posts: 286
Joined: Mon Jun 06, 2005 4:07 am

Post by rumu »

Hi Frank,

Atlast, the mainfrate team has agreed to push the file to ETL server.

So, I am not extracting the file from mainframe.
Rumu
IT Consultant
Post Reply