在COBOL中调用REXX脚本[转载]
来源:互联网 发布:洛奇英雄传优化补丁 编辑:程序博客网 时间:2024/06/10 07:56
例子转自IBM z/OS V1R9.0 information center
//* -->uidIEC JOB - Specify your Job card here
//*-----------------------------------------------------------*
//*
//* Interlanguage Communication in z/OS
//* Calling REXX from COBOL
//*
//*-----------------------------------------------------------*
//*
//* Licensed Materials - Property of IBM
//* 5695-013
//* (C) Copyright IBM Corp. 1989, 2003
//*
//*-----------------------------------------------------------*
//* Sample JCL for calling IRXJCL from COBOL program.
//* For a description also refer to the REXX Compiler guide
//* SH19-8160.
//* You may modify this sample for your needs by including
//* a REXX of your own. The argument for the REXX procedure
//* may be taylored for your needs.
//*
//* Change Activity: 030708 - new for Release 4
//*-----------------------------------------------------------*
//* JCLLIB accesses the CLG procs, modify to your needs
//*-----------------------------------------------------------*
//*MYLIB JCLLIB ORDER=RXT.INTLANG.CNTL
//*-----------------------------------------------------------*
//* Create REXX procedure HELLO into a temporary Library &&REXX
//* SYSUT1 is setup for card input, modify to a DSN if desired.
//*-----------------------------------------------------------*
//CREATE EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT2 DD DSN=&&REXX(HELLO),DISP=(NEW,PASS),
// UNIT=SYSDA,SPACE=(TRK,(1,1,1)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PO)
//SYSUT1 DD *,DLM=$$
/* REXX - A simple exec ****************** Start sample exec */
Parse source src /* sample exec */
Arg n /* sample exec */
Say 'I am' src /* sample exec */
Say 'Received parm:' n /* sample exec */
If n='' Then n=1 /* sample exec */
Do i=1 TO n /* sample exec */
Say 'Hello World the' i'. time ...' /* sample exec */
End /* sample exec */
Return n /* Set Return Code to n */ /* sample exec */
/******************************************* End sample exec */
$$
//*-----------------------------------------------------------*
//* Compile, link and execute a COBOL program
//*-----------------------------------------------------------*
//* Invoke the cataloged procedure IGYWCLG to compile, link and
//* execute the below listed Cobol program.
//* The Cobol program below calls the above listed REXX sample
//* exec as stored in the temporary dataset using the
//* TSO service IRXJCL.
//*-----------------------------------------------------------*
//IGYWCLG EXEC IGYWCLG
//COBOL.SYSIN DD *
CBL NOADV,NODYN,NONAME,NONUMBER,QUOTE,SEQ,XREF,VBREF,DUMP,LIST
TITLE "COBOL TEST PROGRAM ".
Identification Division.
Program-id. COBPRG.
IA0040 Author. ...
*** **
*** Invoke REXX procedure HELLO with parameter 3 using IRXJCL **
*** **
*** Expected display messages: **
*** "PROGRAM CONPRG - BEGINNING" **
*** "PROGRAM COBPRG - NORMAL END" **
*** **
*****************************************************************
Environment division.
IA0970 Configuration section.
Special-names.
Input-output section.
File-control.
Select PRINT-FILE
assign to SYS014-S-UPDPRNT
file status is UPDPRINT-FILE-STATUS.
Data division.
File section.
IA1570 FD PRINT-FILE
recording mode F
block 0 records
record 121 characters
label record standard.
IA1620 01 print-record pic x(121).
Working-storage section.
01 Working-storage-for-COBPRG pic x.
01 ARGUMENT.
03 ARG-SIZE pic 9(2) comp.
03 ARG-CHAR pic x(8).
77 UPDPRINT-file-status pic xx.
77 PGM-NAME pic x(8).
/****************************************************************
*** D O M A I N L O G I C **
*****************************************************************
procedure division.
000-do-main-logic.
display "PROGRAM COBPRG - Beginning".
display "Return code before call is " RETURN-CODE.
*
* Pass the procedure pame HELLO to IRXJCL.
* Pass 3 to REXX procedure 'HELLO'.
* Set the size of the argument.
*
move "HELLO 3" to ARG-CHAR.
move 8 to arg-size.
* Call "IRXJCL" in order to execute the REXX procedure
move "IRXJCL" to PGM-NAME.
CALL PGM-NAME USING ARGUMENT.
* Display the return code.
display "Return code after call is " RETURN-CODE.
display "PROGRAM COBPRG - Normal end".
stop run.
IA9990 end program COBPRG.
/*
//*-----------------------------------------------------------*
//* Define the library containing the REXX exec
//*-----------------------------------------------------------*
//GO.SYSEXEC DD DISP=(SHR,PASS),DSN=&&REXX
//*-----------------------------------------------------------*
//* Next DD is the data set equivalent to terminal input
//*-----------------------------------------------------------*
//GO.SYSTSIN DD DUMMY
//*-----------------------------------------------------------*
//* Next DD is the data set equivalent to terminal output
//*-----------------------------------------------------------*
//GO.SYSTSPRT DD SYSOUT=*
//GO.SYSOUT DD SYSOUT=*
//*-----------------------------------------------------------*
//
- 在COBOL中调用REXX脚本[转载]
- REXX 常用脚本(2)——JCL 调用REXX
- 在REXX中使程序暂时等待的方法
- Java 调用 Rexx Java Call Rexx In ZOS MVS
- C++中调用Python脚本(转载)
- 在shell脚本中调用另一个脚本
- 在COBOL中获取命令行参数
- 在COBOL程序中取得百万分之一秒精度时间(没有使用DB2的情况下)--转载
- 在Watir中调用JavaScript脚本
- 在shell脚本中调用sqlplus
- 在python中调用另一个python脚本
- 在loadrunner中调用QTP脚本
- 在java中调用Linux命令/脚本
- 在shell脚本中调用sqlplus
- 在Android app中调用shell脚本
- 转载在 C# 中调用 C++
- [转载]在VC中调用DLL文件
- 在多线程中调用WinForm(C#) (转载)
- DNS的资源记录总结
- 波士顿大学告诉我们什么才叫做「光世代」
- 如何从国有到民有?
- 关于提高自己Java水平十大技术
- U盘mp3移动硬盘“文件或目录损坏且无法读取”错误的修复
- 在COBOL中调用REXX脚本[转载]
- 在MSSQL的创建Split函数
- python 发邮件
- 美国知名科技博客简介
- Debug vs Release
- 英特尔迅驰二代风尚盛典亲身体验
- 解决VC中包含的unistd.h头文件问题
- Meet Flex
- 构架Domino CA中心之一