On Mon, Sep 8, 2014 at 4:43 AM, Werner Kuehnel
<[email protected]> wrote:
> I have a file on a WIN server with variable data records in EBCDIC and the
> correct end-of-line marker of x'0D25'. In the end I need a file with
> LRECL=582, RECFM=VB.
>
> When I ftp this file binary with "quote site lrecl=582 recfm=fb" all
> records are written contigously in chunks of 582 bytes. A second ftp
> (within z/OS) then splits up the records at x'0D25', but additionally at
> byte 582, which is wrong when a record flows over into the next record.
> All attempts to get the right format failed up to now.
>
> Does anyone has an idea how to accomplish this?
>
> Werner Kuehnel

The good news is that I can duplicate your problem. The bad new is
that I don't have a simple solution. The good news is that I have a
somewhat complicated solution. The bad news is that it uses z/OS UNIX
facilities. OK, enough with the "good news / bad news" stuff.

I did try my solution with my test data. It does work. It _is_ a bit
complicated. And it assumes that the only use of x'0D' in your data
occurs immediately before a x'25' and is part of the CRLF control
sequence and never used as data in itself. The actually UNIX command
stream looks like (no JCL). The below is one long line, even if broken
up by email.

cp -B "//'some.input.dsn'" /dev/fd/1 | tr -d '\15' | tr '\45' '\n' |
cp -T -W "seqparms='LRECL=582,RECFM=FB,SPACE=(CYL,(10,1))' /dev/fd/0
"//'vb.output.file'"

What the above does is copy 'some.input.dsn' as a binary file (-B) to
"stdout" (/dev/fd/1). It then pipes this into the translate command
(tr) which deletes (-d) all the x'0D' (\15 which is octal) characters.
This is then piped into translate (tr) which converts the x'25' (\45
is octal of x'25') to '\n' which is the z/OS UNIX "new line" (NEL)
character. It then pipes this into the copy (cp) command in text
format (-T) passing the z/OS DSN allocation parameters (-W seqparms=).
/dev/fd/0 is the "file name" for "stdin" which is where the piped data
come in. It then outputs the data into the z/OS data set
'vb.output.file'

Why not just use REXX to read your input and write your data? If
necessary, I could probably create an example.

-- 
There is nothing more pleasant than traveling and meeting new people!
Genghis Khan

Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to