On Fri, May 14, 2010 at 2:09 AM, Paul Gilmartin <[email protected]> wrote:

> I used a PACK stage to make a VMFPLCD archive internet-friendly
> and sent it to a client who uploaded it to his CMS system with
> IND$FILE.  Then, at my instruction, he did:
>
>    PIPE < fn ft1 fm | FBLOCK 1024 | unpack | > fn ft2 fm
>
> Unfortunately, IND$FILE had padded with binary zeroes to a
> multiple of 80 and neither FBLOCK nor UNPACK detected the
> problem.  I don't want to conceal the problem by either
> padding or trimming the odd record.  I want it reported.

You may have located the wrong tree to bark upon. Trailing nulls cause
no problems. Since the packed file is F1024 it will be padded with
extra X'00' almost 99.9% of the time.

pipe literal rob | pack | > rob packed a f
Ready; T=0.01/0.01 03:27:16
pipe < rob packed | chop 32 | fmtdump | cons
0001 0000  000140E5 7FFFFFFF FC039996 8240FF00    *.. V......rob ..*
     0010  00000000 00000000 00000000 00000000    *................*
Ready; T=0.01/0.01 03:27:37
list rob packed ( date
FILENAME FILETYPE FM FORMAT LRECL       RECS     BLOCKS   DATE     TIME
ROB      PACKED   A1 F       1024          1          1  5/14/10  3:27:16
Ready; T=0.01/0.01 03:28:21
pipe < rob packed | unpack | cons
rob
Ready; T=0.01/0.01 03:28:32

More likely the data was translated from EBCDIC to ASCII and back
again in the process. When the record length of a RECFM V file is
misformed in that process, the unpack stage will even recognize.

Popular cause for confusion and despair is when the packed file was
not properly constructed to include the maximum record length (see the
example in the CMS Pipelines documentation for "pack"). Though
"unpack" can still handle that case, the UNPACK option of COPYFILE can
not (which customers try when looking for a second opinion, and then
claim that the unpack stage fails).

PIPE (END \)  literal rob | p: pack | d: > rob packed a f  \ p: | d:
Ready; T=0.01/0.01 03:40:23
copyfile rob packed a = unpacked a ( unpack oldd repl
Ready; T=0.01/0.01 03:40:29
pipe < rob packed | chop 32 | fmtdump | cons
0001 0000  000140E5 00000004 FC039996 8240FF00    *.. V......rob ..*
     0010  00000000 00000000 00000000 00000000    *................*
Ready; T=0.01/0.01 03:40:44

Happy Plumbing,
Sir Rob the Plumber

Reply via email to