none
HIS 2010 Beta Documentation RRS feed

  • Question

  • Hi,

    Can anybody point me to the documentation for HIS 2010 beta, I am actually interested in the functionality provided by the BizTalk Pipeline Component for Host Data Conversion . Will this component be able to handle EBCDIC flat files.

     

    • Edited by DPS Bali Wednesday, June 2, 2010 7:36 PM .
    Wednesday, June 2, 2010 7:36 PM

Answers

  • This is the connection string I have setup in a C# applcaiton which reads a VSAM data file in offline mode (file was FTP'd down from the host, and is in EBCDIC format):

          this.textBox1.Text = "Provider=SNAOLEDB;Local Folder=C:\\HostFilesDemo;Metadata=C:\\HostFilesDemo\\HostFil" +
            "eReader\\HostFileReader\\WoodgrooveBankDemo.DLL";

    So, the first parameter is obvsious, the "Local Folder" paramter is the location where the offline file exists, and the "Metadata" paramter is the pointer to your DLL which contains the structure information (so you need the Cobol copybook).

    The code to read this to a datatable is simple:

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using Microsoft.HostIntegration.MsHostFileClient;
    using System.Data.OleDb;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    
    namespace CustomerDemo
    {
      public partial class Form1 : Form
      {
        public Form1()
        {
          InitializeComponent();
        }
    
        private void button1_Click(object sender, EventArgs e)
        {
          string cnStringDB2OLEDB = textBox1.Text;
          string qrString = textBox2.Text;
          dataGridView1.DataSource = Populate(cnStringDB2OLEDB, qrString);
          dataGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
        }
    
        private DataTable Populate(string cnstring, string sqlCommand)
        {
          DataTable dt = new DataTable();
          try
          {
            HostFileConnection conn = new HostFileConnection(cnstring);
            HostFileDataAdapter da = new HostFileDataAdapter(sqlCommand, conn);
            da.Fill(dt);
            return dt;
          }
          catch (OleDbException ex)
          {
            MessageBox.Show(ex.Source + ": " + ex.Message);
          }
          return dt = null;
        }
      }
    }
    

    Oh, my query string:

    this.textBox2.Text = "select * FROM CUSTOMERS";

    Ignore the 'DB2' references, I 'borrowed' the code from one of my DB2 test programs :).

    HTH


    Charles Ezzell - MSFT
    Wednesday, June 9, 2010 4:33 PM

All replies

  • If you download and install the HIS 2010 Beta, you can install the documentation with the product. In addition, you can download the documentation from the following link:

    http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=650ce385-8716-49ae-9f98-dccc4e85f5fb

    This link is available on the BizTalk Server 2010 Beta site at http://www.microsoft.com/downloads/details.aspx?FamilyID=0f852e77-f792-4784-b2d4-95113d40db64&displaylang=en.

    It doesn't look like there is much direct documentation for the BizTalk Pipeline Component for Host Data Conversion feature in the docs.

    There is a sample in the HIS 2010 SDK that you can install as part of the install. You want to go to the following path (assuming that you install in the default location):

    C:\Program Files\Microsoft Host Integration Server 2010\SDK\Samples\Pipelines

    Not much documentation for the sample, but maybe the sample code will help.

    Thanks...

     


    Stephen Jackson - MSFT
    Thursday, June 3, 2010 4:46 PM
  • Hi Stephan,

    Thanks for the pointers on the documentation, I have already looked at the sample that you mentioned. On a lighter note without proper documentation it is purely a sample that can be run only by people who created the sample.

    I had a related question though and would be great if you can give some direction. 

    Will it be possible for me to use this pipeline component to read flat files in EBCDIC Encoding using the FTP Adapter. I have a requirement where in I have to consume and generate a positional flat file structure in EBCDIC Encoding. The file does consist of elements which are COMP and COMP-3. I was wondering if this pipeline would help in data conversion, or will I have to write up custom code to encode/decode the file and unpack/pack cobol datatypes like COMP, COMP-3.

    • Edited by DPS Bali Friday, June 4, 2010 9:33 PM .
    Friday, June 4, 2010 9:32 PM
  • If this is a VSAM data file, you can use the BizTalk Adapter for Host Files, either in 'online' or 'offline' mode. In offline mode (where the data file has been brought down locally) you are limited to reading only. In online mode (file still exists on the host), it will allow you to read or write to an existing file, but not a new file.

     


    Charles Ezzell - MSFT
    Monday, June 7, 2010 4:35 PM
  • I brought this up with the HIS Program Manager that owns this feature. I got the following information from him. The BizTalk Pipeline Component for Host Data Conversion is based on the Transaction Integrator (TI) Managed conversion componets. The metadata is cotnained in an assempbly created with the desginer. It deals with records or recordsets and doesn't do consectutive reads through a file (it is basically transaction based like TI is).  This may not be much of an issue as you just need to define the size of the recordset when creating the assembly. Another option is that you could create an orchestration that contains code to do the reads and uses the pipeline to do the conversion. The same could be done with writes.

    He told me that he had done a simple test were he created an XML document that contained 13 records. He used the BizTalk  receive file adapter and the pipeline to convert the recordset. He also setup a send file adapter and used the pipeline to convert the records back. This all worked correctly. You might also be able to just setup the send adapter to be pass thru and then have the FTP adapter pick up the EBCDIC file and send it to the host. 

    Thanks...   


    Stephen Jackson - MSFT
    Monday, June 7, 2010 6:22 PM
  • Hi Charles,

    At this point I am not sure whether this is a VSAM data file. The flat file consists of about 8 records and when I asked for a copybook for this file, to my surprise the partner that I am integrating with sent me a different cobol copybook for each record that is present in the flat file. And in the flat file it seems like it is a positional flat file with each record in one row. I will have more information on this in a few days. I have BizTalk 2009 currently and am exploring the possibility of using Biztalk 2010 if it supports the requirement out of box.

    Even if it is a VSAM file, will I be able to create a xsd schema from the file in OFFLINE mode. I was struggling to get some help on working with this file in OFFLINE Mode but can't get hold of any documentation that talks about the same.

     

    • Edited by DPS Bali Monday, June 7, 2010 9:22 PM .
    Monday, June 7, 2010 8:48 PM
  • Thanks Stephan, I will work on this a bit more and try to use it with the File Adapter. However , I still have one hickup with regards to creating a xsd schema for a host file in OFFLINE mode and am not sure whether that is doable or not.

     

     


    • Edited by DPS Bali Monday, June 7, 2010 9:27 PM .
    Monday, June 7, 2010 9:27 PM
  • Offline mode was added in with HIS 2009. It's a bit tricky (you do it manually in 2009) to configure this, and in 2010 the goal is to make it easier, but I'm not sure all the code has been implemented yet. I'll fire up my 2009 test box when I'm in the office and get you a good UDL string. It's easy actually, there are only 2 parameters :).
    Charles Ezzell - MSFT
    Wednesday, June 9, 2010 9:15 AM
  • This is the connection string I have setup in a C# applcaiton which reads a VSAM data file in offline mode (file was FTP'd down from the host, and is in EBCDIC format):

          this.textBox1.Text = "Provider=SNAOLEDB;Local Folder=C:\\HostFilesDemo;Metadata=C:\\HostFilesDemo\\HostFil" +
            "eReader\\HostFileReader\\WoodgrooveBankDemo.DLL";

    So, the first parameter is obvsious, the "Local Folder" paramter is the location where the offline file exists, and the "Metadata" paramter is the pointer to your DLL which contains the structure information (so you need the Cobol copybook).

    The code to read this to a datatable is simple:

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using Microsoft.HostIntegration.MsHostFileClient;
    using System.Data.OleDb;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    
    namespace CustomerDemo
    {
      public partial class Form1 : Form
      {
        public Form1()
        {
          InitializeComponent();
        }
    
        private void button1_Click(object sender, EventArgs e)
        {
          string cnStringDB2OLEDB = textBox1.Text;
          string qrString = textBox2.Text;
          dataGridView1.DataSource = Populate(cnStringDB2OLEDB, qrString);
          dataGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
        }
    
        private DataTable Populate(string cnstring, string sqlCommand)
        {
          DataTable dt = new DataTable();
          try
          {
            HostFileConnection conn = new HostFileConnection(cnstring);
            HostFileDataAdapter da = new HostFileDataAdapter(sqlCommand, conn);
            da.Fill(dt);
            return dt;
          }
          catch (OleDbException ex)
          {
            MessageBox.Show(ex.Source + ": " + ex.Message);
          }
          return dt = null;
        }
      }
    }
    

    Oh, my query string:

    this.textBox2.Text = "select * FROM CUSTOMERS";

    Ignore the 'DB2' references, I 'borrowed' the code from one of my DB2 test programs :).

    HTH


    Charles Ezzell - MSFT
    Wednesday, June 9, 2010 4:33 PM