Copying a PDF from USS into z/OS

General discussion on the JZOS batch launcher and toolkit
Posts: 8
Joined: Mon Feb 02, 2009 7:41 am
Location: Stockholm, Sweden

Copying a PDF from USS into z/OS

Postby lbjerges » Mon Jan 02, 2017 5:45 am

I am using FOP (2.1) to create PDF documents by means of JZOS and have encountered a probmle similar but not equal to the one described in JZOS PDF encoding (
After running FOP I get the result in a USS subdirectory (/pfd) and I would like to copy that result into a regular z/OS file referenced by the invoking JCL.
Everything works all right but when I try to open the PDF I get: There was an error openeing this document. The file is damaged and could not be repaired.
If I use the TSO command OGET:

Code: Select all

OGET '/ppo/chgmand/itm/fop/pdf/barcodes.pdf' barcodes.pdf BINARY

and then open the result it is all right, no PDF problems. The command will create a file (if not existing) as RECFM=VB,LRECL32756 but if I preallocate such a file and let JZOS write to it the attributes are changed into RECFM=FB,LRECL=6080.
My ZFile dfinition is:

Code: Select all

ZFile tZosfile = new ZFile("//DD:PDFOUT", "wb");
and the actual copy code is:

Code: Select all

FileInputStream tIn = new FileInputStream(aFromFile);
OutputStream tOut;                                   
if (aZos) ä                                         
    tOut = aToFile.getOutputStream();               
å else ä                                             
    tOut = new FileOutputStream(aToFileName);       
byteݨ buf = new byteÝ8092¨;                         
int len;                                             
while ((len = >= 0) ä                 
    tOut.write(buf, 0, len);                         

The change of file attributes raises the suspicion that JZOS thinks this is a text file but I don´t know why.

Regards Lars

Return to “JZOS”

Who is online

Users browsing this forum: No registered users and 1 guest