Geeks With Blogs
Paul's Petrov Whiteboard [BizTalk, Enterprise Application Integration, Business Process Automation, SOA, .NET]

Recently, I had to create an orchestration that transfers files to the IBM mainframe running z/OS (also called sometimes MVS - Multiple Virtual Storage because of the legacy). The orchestration used dynamic FTP port to correlate incoming messages to the destination. During this exercise I learned something about FTPing to the mainframe with BizTalk adapter.

First, flat files obviously must be passed in ASCII mode so the FTP server is able to convert them to EBCDIC format. Passed in binary mode files will not be readable as text files since these two formats have incompatible code pages. To ensure proper conversion set FTP.RepresentationType to "ASCII" on the message context.

Second, records in files must be separated with CR LF not just LF as I was getting from UNIX system. Otherwise, only one record was transferred. You'd likely get a message like "250 Transfer completed (data was truncated)".

Third, record size must be passed to the mainframe system. This is done by setting FTP.BeforePut property to command options like: SITE DCB LRECL=50 RECFM=FB where LRECL sets the record size of 50 characters.

Finally, on some MVS datasets we experienced data truncation even if the LRECL was set properly when record size in flat file exceeded 80 characters. Those unlucky files kept getting truncated to 80 characters per records (which is default value for z/OS) until I sent command WRAPRECORD. So, for such cases setting FTP.BeforePut to something like "SITE DCB LRECL=600 RECFM=FB WRAPRECORD" did the trick.

Posted on Friday, October 19, 2007 12:17 AM BizTalk , EAI | Back to top


Comments on this post: Sending flat files to IBM z/OS mainframe by BizTalk FTP adapter

# re: Sending flat files to IBM z/OS mainframe by BizTalk FTP adapter
Requesting Gravatar...
How were you getting the files from Unix? I have a project where I need to poll a Unix folder for a flat file to send to a mainframe....
Left by Brad on Jan 29, 2008 6:03 PM

# re: Sending flat files to IBM z/OS mainframe by BizTalk FTP adapter
Requesting Gravatar...
I created Windows service that used custom file watcher (.Net file watcher did not work with Unix location through NSF services).
Left by Paul Petrov on Jan 29, 2008 6:25 PM

# re: Sending flat files to IBM z/OS mainframe by BizTalk FTP adapter
Requesting Gravatar...
so how do u send a gdg file to a unix env. and returning back to the mainframe...
Left by ronr on Jan 06, 2010 9:13 PM

# re: Sending flat files to IBM z/OS mainframe by BizTalk FTP adapter
Requesting Gravatar...
Hi:

If your file has packed decimals (PACK-3), sending file in ASCII representation messes up these fields. I tried binary mode, but it messes up the whole file (file appears as one big record). Any thought on how to handle packed fields?

Thanks
Left by Maam Deen on May 25, 2010 12:07 PM

# re: Sending flat files to IBM z/OS mainframe by BizTalk FTP adapter
Requesting Gravatar...
I have a Problem when BizTalk receive a File from z/OS. How does the FTP adapter can be configured BizTalk.
Left by André on Sep 25, 2011 11:32 PM

# re: Sending flat files to IBM z/OS mainframe by BizTalk FTP adapter
Requesting Gravatar...
Has anybody been able to come up with a solution for sending file with packed decimal fields to IBM mainframe using FTP? I came across many such questions, but no definite answer. Any input woould be much appreciated. Thanks
Left by Milan on Mar 13, 2012 3:30 AM

Your comment:
 (will show your gravatar)


Copyright © Paul Petrov | Powered by: GeeksWithBlogs.net