Re: Layout Hell.

From: Robert Wagner (robert.deletethis_at_wagner.net)
Date: 07/24/04


Date: Sat, 24 Jul 2004 16:15:51 GMT


"Carol" <kgdg@helkusa.com> wrote:

>The files are being read by Novastor tape drive and software.
>This software converts the data, if only it knew how to read the copybooks.
>I have to do all the parameters by hand.

The NovaXchange manual is at
http://www.novastor.com/pub/docs/NovaXchange3.pdf

Go to Tape Inspector and select View to use the Hex Editor.

Toggle between ASCII and EBCDIC. Pic x fields will be readable in one, not the
other. That will be the type for pic x in your script.

Next look at comp-3 fields. On the hex screen, you should see a digit 0-9 in
each position (half byte) except the rightmost, which should have a C positive
sign. If you see anything different, post it here and someone will figure it
out.

Finally, look at comp fields to see whether zero values are predominantly on the
left or right side. These are called small-endian and big-endian, respectively.
If text is EBCDIC, the file was created on a mainframe, where comp is always
small-endian.

Now you are ready to write the script, where types will be:

Pic x -- EBCDIC or ASCII
Comp-3 -- pack_lowsign
Comp -- bin_msb if zeros were on left or bin_lsb if they were on the right
Pic 9 without comp -- ebc_zon_ls if text is EBCDIC. If text is ASCII and sign is
'zoned', you are out of luck. NovaXchange doesn't support that format.

Examples:

field = CTLGOP-CO-NO EBCDIC pic xxx
field = CTLGCONTROL-SET-SEQ-NO bin_msg pic 999999999.
field = CTLGINVOICE-SEQ-NO bin_msb pic 9999
...
field = CTLGAP-VENDOR-NO EBCDIC * 30
field = CTLGTOTAL-INVOICE-AM pack_lowsign pic 99999999999v99

field = DUE-DATE pack_lowsign date pic yymmdd -20
 (sliding date window of current year - 20)

If there are large comp fields, observe carefully how many bytes NovaXchange
allocates. Mathematically, pic s9(15) requires seven bytes for representation.
Most, but not all, Cobol compilers will allocate eight.
 

>"Robert Wagner" <robert.deletethis@wagner.net> wrote in message
>news:4101922c.20784546@news.optonline.net...
>> "Carol" <kgdg@helkusa.com> wrote:
>>
>> >just ask me!
>>
>> OK.
>>
>> Is the conversion running on a mainframe?
>>
>> Does the machine have a Cobol compiler?
>>
>> Could you move the file to a PC (by FTP, NDM or email) and convert it
>there?