Copying a PDF from USS into z/OS

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

Copying a PDF from USS into z/OS

Post by lbjerges » Mon Jan 02, 2017 5:45 am

Hi!
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 (http://community.dovetail.com/forum/vie ... =PDF#p4877).
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 = tIn.read(buf)) >= 0) ä                 
    tOut.write(buf, 0, len);                         
å                                                    
tIn.close();                                         
tOut.close();
The change of file attributes raises the suspicion that JZOS thinks this is a text file but I don´t know why.

Regards Lars

Post Reply