Loading a file from the main frame to encina


Just received contract they are covered for cics and encina (and others)
If you have questions on entitlement, please call marketing.  
They are valid - please assist.

Loading a file from the main frame to encina using the cics/sdt command.
Data is garbage.


The customer has converted his mainframe data using an ISV tool called
FILEPORT.  It performs EBCDIC-to-ASCII conversion on multiple-format
record files automatically using supplied COBOL-copybooks.  The ASCII
output file the customer has received from this utility is viewable
using vi and textual portions are recognizable.  There are
packed-decimal fields that are not yet validated but the character
data appears good.  When this ASCII file is fed to cicssdt (ftos) the
resulting Encina SFS file appears filled with garbage characters.  I
am going to try to set up a conference call to
discuss the use of cicssdt.


The customer has a very complex data structure in his host VSAM files
that needs to be migrated into SFS.  The record layouts are variable
format, variable length and include data processed by a RYO
shrink/stretch (compression) process.  Consequently there are areas of
binary and packed-decimal data at unpredictable offsets into the
record.  The customer has a trial copy of "FILEPORT" by "SyncSort".
It ostensibly performs the complex conversion from EBCDIC to ASCII on
the RISC platform using a binary (i.e., non-converted) export of the
mainframe data.  The initial exercise of the product resulted in
apparently accurate conversion but when that data was supplied to the
cicssdt the bytes of binary zeros caused the conversion to SFS to
fail.  Dennis Weiand, DSC, developed a small filter and korn-shell
script to replace the binary-zeros with another bit-pattern (unused in
the rest of the file), convert newline-delimited output from the
"FILEPORT" into SDT format, and reinstate the binary-zeros.
.sp 1
The following is the source for the program unusedchar.  It's purpose
is to identify an 8-bit pattern that is not used in the contents of
the file.
.sp 1
\#include \

main ()
{       int c;
        int i;
        int tbl[256];

        while ((c = getchar()) != EOF)
        { tbl[c] = c; }

        for (i=1; i \< 256; i++)
          if ( tbl[i] == '\\0' )
            printf ("%c", i);
            return 0;

        return -1;
.sp 1
The following is the Korn-shell script that uses the unusedchar
program and converts an input newline-delimited file to an "SDT"
format file while retaining binary-zeros in the correct locations.
.sp 1

if [[ $\# -ne 1 ]]
        echo "Usage: tosdtformat \file name"
        echo " where file name is the file to be placed"
        echo " in sdt format"
        exit -1

export RetVal=$(unusedchar \< ${1} > /dev/null)
if [[ $RetVal -ne 0 ]]
            echo "All possible hex codes are used in this file - ending"
            exit $RetVal

cat ${1} | tr "\\000" "$(unusedchar \< ${1})" | \\
awk  \\
   "date" | getline theDate;
   print "Beginning of program on " theDate | "cat >&2";
   printf ("\\n%08d%s", length($0), $0);
   "date" | getline theDate;
   print LineCount " statements were changed by " theDate | "cat >&2";
}' | tr "$(unusedchar \< ${1})" "\\000"  ${1}.sdt_format

FONT size=2Support Line: Loading a file from the main frame to encina  ITEM: BE5345L
BRDated: July 1996 Category: N/A
BRThis HTML file was generated 99/06/24~13:30:22
BRComments or suggestions?
A href="../../../../feedback.htm"BContact us/B/ABR