Page 1 of 1

Read Binary file from AS400

Posted: Wed Dec 12, 2018 12:28 pm
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?

Posted: Wed Dec 12, 2018 6:47 pm
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:

Posted: Thu Dec 13, 2018 6:30 am
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.

Posted: Thu Dec 13, 2018 10:50 am
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.

Posted: Thu Dec 13, 2018 11:33 am
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?

Posted: Thu Dec 13, 2018 11:58 am
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 #.

Posted: Thu Dec 13, 2018 12:19 pm
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.

Posted: Thu Dec 13, 2018 1:03 pm
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?

Posted: Thu Dec 13, 2018 1:12 pm
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.

Posted: Tue Dec 18, 2018 8:41 am
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.