On Tue, 28 Apr 2009 15:50:11 -0500, Mark Steely <[email protected]> wrote:

>The file is just an ASCII txt file - instead of having new line at the
>end of each record it has a x'05'.
>

Then you have no problem! You have a single logical line on the UNIX system
which is being transferred to the z/OS system as a single logical record.
There is no way on God's green Earth to tell a ftp server "Oh, by the way,
instead of a normal end of line indicator, please use x'05' as the logical
end of a line."

Tell the UNIXoids to use standard line endings of 0x0a.

If this is impossible due to insanity at the other end, then you'll need to
upload the file to z/OS as RECFM U. Then write your own program to read the
file and parse it into logical records when it reads a x'05'.

If you have Co:Z installed, you can do this very simply:

//CONVERT EXEC DTLSPAWN
//STDOUT DD SYSOUT=*
//STDERR  DD SYSOUT=*
//STDIN DD *
fromdsn "//DD:INPUT" | tr '\t' '\n' | todsn "//DD:OUTPUT"
/*
//INPUT DD DSN=crappy.file.from.unix,DISP=SHR
//OUTPUT DD DSN=nice.file.output,DISP=(NEW,CATLG),
//... other required DD parameters


===

Another way to do this is to upload the UNIX file into a z/OS UNIX file
instead of a dataset. Once it is there, you can use the "tr" command to
translate the x'05' bytes to x'15' (z/OS UNIX end-of-line) characters. You
can then use a program such as IEBGENER to copy the UNIX file to a z/OS
legacy dataset. An example might of the "tr" command (but not the BPXBATCH
JCL to run it) might be:

tr '\t' '\n' <input.file >output.file
# translate tabs, \t, to newlines, \n

//COPY EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT1 DD PATH='/some/subdir/output.file',
// FILEDATA=TEXT,
// RECFM=...,LRECL=...
//SYSUT2 DD DSN=...,DISP=(NEW,CATLG),
// UNIT=SYSDA,SPACE=...
// RECFM=...,LRECL=...,BLKSIZE=0,DSORG=PS
//

Replace the ... with the correct values.

--
John

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to