开发者

JCL for running COBOL program calling subprogram

开发者 https://www.devze.com 2023-04-02 12:09 出处:网络
I have one COBOL pgm A which is calling another COBOL pgm B. In pgm B I need one file.How can I write 开发者_开发问答JCL so that I would be able to access this file in pgm B? I have written select cla

I have one COBOL pgm A which is calling another COBOL pgm B. In pgm B I need one file.How can I write 开发者_开发问答JCL so that I would be able to access this file in pgm B? I have written select clause and FD entry for this file in B.


You must include a DD statement in the JCL for the step that executes Program A.

If the file exists, that's quite easy.

//ABCDEFGH DD DISP=SHR,DSN=your.file.name.here

Where ABCDEFGH is the name you uses in your SELECT statement in Program B.

If you are creating a new file, you must take into account the estimated space your file will use and where you want to place it.

//ABCDEFGH DD DISP=(NEW,CATLG,DELETE),
//            DSN=your.file.name.here,
//            AVGREC=K,
//            RECFM=FB,
//            LRECL=your-lrecl-here,
//            MGMTCLAS=your-management-class-here,
//            SPACE=(your-lrecl-here,(primary-number-of-records,secondary),RLSE)

This is just freehand, you really should look at the JCL Reference and JCL User's Guide.


  1. Include the DD Statement in the step.
  2. Program B does not even have to be COBOL.
  3. Ideally design so that program B is a service program - opens, closes, reads, writes re-writes according to request and your needs. It will make your life a lot easier if this encapsulation is anticipated.

I have seen this where B is assembler and flushes writes to disk periodically when not run interactively, but writes immediately when debugging.

0

精彩评论

暂无评论...
验证码 换一张
取 消