Created On:  12 April 2012

Problem:

I have a COBOL program that will read a copybook and then generate statements for a new program. I need to read the copybook that is used by both this program and a normal compile.

How do I code JCL statements for local PC file instead of the catalog in my project? I do not want to keep two source files, one in ASCII and another in EBCDIC.

Resolution:

We do allow you to keep one copy of your copybooks in ASCII in a PC directory yet access them for compiles or JCL jobs using either character set.  

The latest maintenance levels of MFE and Studio will do character set translation on the fly for a PDS. So one can use a PDS in the MFE or Studio Catalog as a repository of source files or control cards for SORT, IDCAMS, SQL, etc. and depending on the character set of the program issuing the OPEN, our File Handler will present the file in its native character set meaning you can reference the PDS from JCL and the physical PC directory for compiles.  

So if you define a PDS named FRED.PDS.COPYS and it contains the physical file C8111990.CPY, we will be able to read it from a Cobol program provided the PDS has these DCB attributes when it was created:

DSORG=PO, RECFM=LSEQ, LRECL=80.

The blocksize does not matter, so leave it at Zero.

The RECFM of LSEQ (Line Sequential) is a Micro Focus only entity. These DCB attributes can be specified either in the Catalog or in your JCL.  

So if you run JCL that uses IEBGENER or IEBCOPY with the input named as FRED.PDS.COPYS(C8111990) then it will be copied to the output in ASCII.

But if you issue an OPEN against the same PDS from a Cobol program using a mainframe dialect or the Micro Focus compiler directive of CHARSET(EBCDIC) and do a READ, then data will be passed to the Cobol program in EBCIDC.

Micro Focus also allows use of a JCL extension naming an actual PC filename should one really want to direct the JCL to a specific PC file (as in the case of creating new program source code).  

The Micro Focus extension is named %PCDSN. Reference the Online Help by searching for ' %pcdsn ' to view additional details.

Incident #2195528