Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Mon, 24 Feb 2003 @ 20:06:19 GMT

  <Prev Next>   <<First <Prev Next> Last>>  

Subj:   Re: Fastload Error Table question
From:   Geoffrey Rommel

  Is there a way to unload the Dataparcel column from the Error1 table from a Fastload into a CHAR format?  

The following Perl program, although rudimentary, will do the trick. Convert::IBM390 is available from CPAN.

#!/usr/bin/perl -w
# Take the hex digits shown in a FastLoad or MultiLoad error table
# and display them in characters, either as ASCII or as EBCDIC.
# NOTE: The printed characters will not necessarily be the same as
# the input; they may contain blanks where the original was null, etc.
# Syntax: $0 [-ae] [filename]
#   -a  Display records as ASCII (default)
#   -e  Display records as EBCDIC
#   filename  File containing the printed hex digits as shown in the
#             error table.  stdin may be used.

use Getopt::Std;
use Convert::IBM390 qw(eb2ascp);

$opt_e = '';
$charset = ($opt_e) ? 'ebcdic' : 'ascii';

while (<>) {
   $orig = pack('H*', $_);
   if ($charset eq 'ebcdic') { print eb2ascp($orig), "\n"; }
   else                      { print "$orig\n"; }

  <Prev Next>   <<First <Prev Next> Last>>  
  Top Home Privacy Feedback  
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 28 Jun 2020