<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Unpack COBOL packed fields during FTP in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743304#M584064</link>
    <description>Dave,&lt;BR /&gt;&lt;BR /&gt;get perl from here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://hpux.cs.utah.edu/hppd/hpux/Languages/perl-5.6.1/" target="_blank"&gt;http://hpux.cs.utah.edu/hppd/hpux/Languages/perl-5.6.1/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Remember that you have to use BINARY mode to transfer the files in ftp.&lt;BR /&gt;&lt;BR /&gt;If the file is in EBCDIC, you can convert it to ascii using "dd" and the "conv ascii" or "conv ibm" option.&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
    <pubDate>Wed, 12 Jun 2002 19:01:37 GMT</pubDate>
    <dc:creator>harry d brown jr</dc:creator>
    <dc:date>2002-06-12T19:01:37Z</dc:date>
    <item>
      <title>Unpack COBOL packed fields during FTP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743300#M584060</link>
      <description>In ftp jobs from IBM mainframe to unix we have some comp 3 fields.&lt;BR /&gt;Has anyone had any experience in transmitting files with this type of field to HP-UX 11.0 that would change the comp 3 to an unsigned.&lt;BR /&gt;&lt;BR /&gt;If not via ftp, then once the file arrives is there a utility to unpack only those fields.&lt;BR /&gt;&lt;BR /&gt;Note: This is not a zipped file. Only fields within the file are packed.&lt;BR /&gt;&lt;BR /&gt;Appreciate any input.&lt;BR /&gt;&lt;BR /&gt;dl</description>
      <pubDate>Wed, 12 Jun 2002 18:25:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743300#M584060</guid>
      <dc:creator>Dave La Mar</dc:creator>
      <dc:date>2002-06-12T18:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: Unpack COBOL packed fields during FTP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743301#M584061</link>
      <description>If I remember my cobol right, a comp-3 has 4 bits per digit (2 digits per byte) and the last digit is a overpunch of the sign.&lt;BR /&gt;&lt;BR /&gt;Although I do not know of any pre-built utility, "perl" is quite capable of parsing text data (see pack/unpack function).&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Wed, 12 Jun 2002 18:32:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743301#M584061</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2002-06-12T18:32:43Z</dc:date>
    </item>
    <item>
      <title>Re: Unpack COBOL packed fields during FTP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743302#M584062</link>
      <description>FTP knows nothing about packed or unpacked data. All you can do is specify a binary transfer. That should be an exact copy. Data conversion can be a complex issue - especially coming from an IBM mainframe because you have the EBCDIC/ASCII conversion as well. This really becomes tricky when you have binary data as well as string data in a record. Dd's conv=ascii can't be used because it will destroy the binary data. In general, you are going to have to copy the data using FTP binary and then if data conversion is needed, you write that as a separate program/script.&lt;BR /&gt;</description>
      <pubDate>Wed, 12 Jun 2002 18:33:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743302#M584062</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-06-12T18:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: Unpack COBOL packed fields during FTP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743303#M584063</link>
      <description>Thanks Rodney. No one here has any perl experience (relatively new shop for HP-UX).&lt;BR /&gt;The last time I tried to do something in perl it appeared we do not have it installed.&lt;BR /&gt;Will note your answer and assign&lt;BR /&gt;mega points shortly.&lt;BR /&gt;&lt;BR /&gt;Thanks again.&lt;BR /&gt;dl</description>
      <pubDate>Wed, 12 Jun 2002 18:36:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743303#M584063</guid>
      <dc:creator>Dave La Mar</dc:creator>
      <dc:date>2002-06-12T18:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: Unpack COBOL packed fields during FTP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743304#M584064</link>
      <description>Dave,&lt;BR /&gt;&lt;BR /&gt;get perl from here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://hpux.cs.utah.edu/hppd/hpux/Languages/perl-5.6.1/" target="_blank"&gt;http://hpux.cs.utah.edu/hppd/hpux/Languages/perl-5.6.1/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Remember that you have to use BINARY mode to transfer the files in ftp.&lt;BR /&gt;&lt;BR /&gt;If the file is in EBCDIC, you can convert it to ascii using "dd" and the "conv ascii" or "conv ibm" option.&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Wed, 12 Jun 2002 19:01:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743304#M584064</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-06-12T19:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Unpack COBOL packed fields during FTP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743305#M584065</link>
      <description>Thank's people. &lt;BR /&gt;I was afraid there was no esay solution.&lt;BR /&gt;No wonder "everyone is not doing this" .....&lt;BR /&gt;&lt;BR /&gt;Thanks again.&lt;BR /&gt;&lt;BR /&gt;dl</description>
      <pubDate>Wed, 12 Jun 2002 22:57:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743305#M584065</guid>
      <dc:creator>Dave La Mar</dc:creator>
      <dc:date>2002-06-12T22:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: Unpack COBOL packed fields during FTP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743306#M584066</link>
      <description>Don't be too discouraged Dave. This stuff is usually not difficult but it is tedious. Perl can be made to read binary records (i.e. those that don't enr with LF's) although when I have to do this stuff, I usually use C simply because all my conversion tools are written are C routines. As I said earlier, the bad ones have records which contain text which must be converted from EBCDIC to ASCII and also have binary/packed data which must not go through the EBCDIC/BINARY conversion. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 12 Jun 2002 23:14:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743306#M584066</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-06-12T23:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: Unpack COBOL packed fields during FTP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743307#M584067</link>
      <description>Perl 4 is installed on all HP-UX systems since 10.00 in /usr/contrib/bin/perl. However, Perl4 is basically obsolete due to forward compatibility issues. To get the latest Perl (5) version for 11.00 and higher, just download it from software.hp.com and install it with swinstall.</description>
      <pubDate>Wed, 12 Jun 2002 23:23:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743307#M584067</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2002-06-12T23:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Unpack COBOL packed fields during FTP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743308#M584068</link>
      <description>Clay -&lt;BR /&gt;Thanks for the encouragement for an old time mainframe systems programmer trying to get into the &lt;BR /&gt;90's.&lt;BR /&gt;&lt;BR /&gt;Bill -&lt;BR /&gt;That's great news. Looking like I'll be learning another tool.&lt;BR /&gt;&lt;BR /&gt;"Never too old .... "&lt;BR /&gt;&lt;BR /&gt;dl</description>
      <pubDate>Thu, 13 Jun 2002 16:40:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743308#M584068</guid>
      <dc:creator>Dave La Mar</dc:creator>
      <dc:date>2002-06-13T16:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: Unpack COBOL packed fields during FTP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743309#M584069</link>
      <description>One important item on the EBCDIC to ASCII conversion. This will munge your comp-3 fields.&lt;BR /&gt;&lt;BR /&gt;My recommendation is to first write a tool that reads in the ibm file and builds two files. The first will have the comp-3 fields (or other binary like comp-6) and the other the EBCDIC data.&lt;BR /&gt;&lt;BR /&gt;Then you can use "dd" to convert ebcdic to ascii on the second file. The first file will require another program to translate the binary to ascii representations. That same program can then merge back in the first file.&lt;BR /&gt;&lt;BR /&gt;I assume you do not have access to the programs/system that generated the original file. If you did then it would be easier to have convert the comp-3 fields.&lt;BR /&gt;&lt;BR /&gt;My 2 cents.&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Thu, 13 Jun 2002 19:01:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743309#M584069</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2002-06-13T19:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: Unpack COBOL packed fields during FTP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743310#M584070</link>
      <description>I've always had the mainframe guys unpack the fields and produce a flat-file dataset.  That's easily converted in UNIX via 'dd'.  &lt;BR /&gt;&lt;BR /&gt;It seems to be easier to do from the mainframe side, since they already have the record descriptions programmed in COBOL, PL/1 or whatever they have been using, and can much more simply output the data in text format.&lt;BR /&gt;&lt;BR /&gt;In UNIX, the packed decimal format is not used, so it would be a nasty conversion of bit shifting.&lt;BR /&gt;&lt;BR /&gt;Good luck!&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Jun 2002 19:24:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743310#M584070</guid>
      <dc:creator>Vincent Fleming</dc:creator>
      <dc:date>2002-06-13T19:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Unpack COBOL packed fields during FTP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743311#M584071</link>
      <description>Vincent,&lt;BR /&gt;&lt;BR /&gt;putting on my cobol hat - you are right, that's what I used to do, plus they could seperate the fields by building a new record using a filler of ";" and doing a "move like".&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Thu, 13 Jun 2002 19:27:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743311#M584071</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-06-13T19:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: Unpack COBOL packed fields during FTP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743312#M584072</link>
      <description>I guess you could always buy the cobol compiler for hpux ;-)&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Thu, 13 Jun 2002 19:32:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743312#M584072</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2002-06-13T19:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Unpack COBOL packed fields during FTP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743313#M584073</link>
      <description>Rodney -&lt;BR /&gt;Yeh, I've gotta love your answer because it is the easiest for me with the exception of the fact we &lt;BR /&gt;are running both environments and the program is still in use.&lt;BR /&gt;So .... copy it, make my changes,&lt;BR /&gt;catalog as new prog and add a step to the driver proc.&lt;BR /&gt;I just didn't want to have to perform this on all interface programs.&lt;BR /&gt;&lt;BR /&gt;dl&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Jun 2002 20:00:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743313#M584073</guid>
      <dc:creator>Dave La Mar</dc:creator>
      <dc:date>2002-06-13T20:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: Unpack COBOL packed fields during FTP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743314#M584074</link>
      <description>Vincent -&lt;BR /&gt;Ditto my answer to Rodney.&lt;BR /&gt;&lt;BR /&gt;Harry -&lt;BR /&gt;Thanks for the confirmation.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks people.&lt;BR /&gt;Like to close this thread now.&lt;BR /&gt;&lt;BR /&gt;Thanks again.&lt;BR /&gt;&lt;BR /&gt;dl</description>
      <pubDate>Thu, 13 Jun 2002 20:02:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743314#M584074</guid>
      <dc:creator>Dave La Mar</dc:creator>
      <dc:date>2002-06-13T20:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: Unpack COBOL packed fields during FTP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743315#M584075</link>
      <description>1) Transfer the file from Mainframe to Unix as a binary file&lt;BR /&gt;&lt;BR /&gt;2) Unblock the file and set the record length :&lt;BR /&gt; dd if=(infile) of=(outfile)     cbs=(reclength)    conv=unblock&lt;BR /&gt;&lt;BR /&gt;3) Load the file to to your Oracle8i database using sql*loader. Your control file should look like this:  :&lt;BR /&gt;&lt;BR /&gt;Load data&lt;BR /&gt;characterset we8ebcdic500 &lt;BR /&gt;infile '/mims/den/mims_run_t/work/jmc.ldi2'&lt;BR /&gt;badfile '/mims/den/mims_run_t/work/jmcjobldi.bad'&lt;BR /&gt;Append into table JMC_JOB&lt;BR /&gt;(APPL_NBR        position(5:11) char "'E'||:APPL_NBR",&lt;BR /&gt; JOB             position(1:12) char,      &lt;BR /&gt; SITE_RESP       position(13:15) DECIMAL(5,2),&lt;BR /&gt; EST_CHG_DEP     position(42:46) DECIMAL(9,2),                         &lt;BR /&gt; EST_CHG_CONN    position(47:51) DECIMAL(9,2),                         &lt;BR /&gt; EST_CHG_PRIV    position(52:56) DECIMAL(9,2),                         &lt;BR /&gt; EST_CHG_PUB     position(57:61) DECIMAL(9,2),                         &lt;BR /&gt; EST_CHG_PAFC    position(62:66) DECIMAL(9,2),&lt;BR /&gt; EST_CHG_XDEP    position(67:71) DECIMAL(9,2),&lt;BR /&gt; PD_CHG_DEP      position(72:76) DECIMAL(9,2),&lt;BR /&gt; PD_CHG_CONN     position(77:81) DECIMAL(9,2),&lt;BR /&gt; PD_CHG_PRIV     position(82:86) DECIMAL(9,2),&lt;BR /&gt; PD_CHG_PUB      position(87:91) DECIMAL(9,2), &lt;BR /&gt; PD_CHG_PAFC     position(92:96) DECIMAL(9,2),&lt;BR /&gt; PD_CHG_XDEP     position(97:101) DECIMAL(9,2),&lt;BR /&gt; PD_DTE_DEP      position(102:109) char,&lt;BR /&gt; PD_DTE_CONN     position(110:117) char,&lt;BR /&gt; PD_DTE_PRIV     position(118:125) char,&lt;BR /&gt; PD_DTE_PUB      position(126:133) char,&lt;BR /&gt; PD_DTE_PAFC     position(134:141) char,&lt;BR /&gt; PD_DTE_XDEP     position(142:149) char,&lt;BR /&gt; DTE_VOUCHER     position(584:591) char,&lt;BR /&gt; EST_CHG_VAT     position(592:595) DECIMAL(7,2),&lt;BR /&gt; PD_CHG_VAT      position(596:599) DECIMAL(7,2),&lt;BR /&gt; PD_DTE_VAT      position(600:607)  char &lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 01 Aug 2002 04:37:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743315#M584075</guid>
      <dc:creator>Kes Moodley</dc:creator>
      <dc:date>2002-08-01T04:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: Unpack COBOL packed fields during FTP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743316#M584076</link>
      <description>Kes -&lt;BR /&gt;Thanks for the input. As I mentioned, I will not be back in the shop for another 2-3 weeks and will give it a shot then.&lt;BR /&gt;Presently, we are just changing the progs to output two files, one for the mainframe and a sequential(flat) for unix.&lt;BR /&gt;If I can incorporate your suggestion we can script this from the unix side for the said problem.&lt;BR /&gt;Thanks again.&lt;BR /&gt;dl</description>
      <pubDate>Fri, 02 Aug 2002 12:44:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unpack-cobol-packed-fields-during-ftp/m-p/2743316#M584076</guid>
      <dc:creator>Dave La Mar</dc:creator>
      <dc:date>2002-08-02T12:44:07Z</dc:date>
    </item>
  </channel>
</rss>

