Chinaunix首页 | 论坛 | 博客
  • 博客访问: 347997
  • 博文数量: 90
  • 博客积分: 847
  • 博客等级: 准尉
  • 技术积分: 1373
  • 用 户 组: 普通用户
  • 注册时间: 2012-08-02 10:54
个人简介

跌打滚爬中的小菜鸟...

文章分类

全部博文(90)

文章存档

2015年(5)

2013年(47)

2012年(38)

我的朋友

分类: 系统运维

2012-10-24 21:28:03

先解释下这个API...
Execute Command (QCMDEXC) API

  Required Parameter Group:

1Command stringInputChar(*)
2Length of command stringInputPacked (15,5)

  Optional Parameter:

3IGC process controlINPUTChar(3)

  Default Public Authority: *USE

  Threadsafe: Yes.

   See  for command considerations.

The Execute Command (QCMDEXC) API runs a single command. It is used to run a command from within a high-level language (HLL) program or from within a CL program where it is not known at compile time what command is to be run or what parameters are to be used.

QCMDEXC is called from within your HLL program and the command it runs is passed to it as a parameter on the CALL command.

After the command runs, control returns to your HLL program.

Notes:

  1. Command strings in System/38 syntax can use the QCAEXEC API. The QCAEXEC API accepts the same parameters as QCMDEXC.
  2. The Process Commands (QCAPCMD) API also provides similar functions.Start of change
  3. If the command to be executed is a proxy command, the QCMDEXC API will resolve to the target command. If the target command is also a proxy, the process repeats until either a non-proxy command is found, or the proxy chain becomes greater than the allowed maximum. Once a non-proxy command is found, the resolved command will replace the proxy command in the command string to be executed.
  4. Proxy commands will be resolved before the command exit points QIBM_QCA_CHG_COMMAND and QIBM_QCA_RTV_COMMAND are called.End of change
再具体就去查IBM信息中心。


使用方法一:    【CALL风格】
 FMT *   *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 .
        *************** Beginning of data *********************************
0001.00  *                                                                 
0002.00 DTMP1             S               Z                                
0003.00 DTMP2             S               Z                                
0004.00 DEXCMD            S            100A                                
0005.00 DCMDLEN           S             15P 5                              
0006.00  *                                                                 
0007.00 C                   EVAL      EXCMD='DLYJOB DLY(5)'                
0008.00 C                   EVAL      CMDLEN = 13                          
0009.00 C                   EVAL      TMP1=%TIMESTAMP                      
0010.00 C                   CALL      'QCMDEXC'                            
0011.00 C                   PARM                    EXCMD                  
0012.00 C                   PARM                    CMDLEN                 
0013.00 C                   EVAL      TMP2=%TIMESTAMP                      
0014.00 C     TMP1          DSPLY                                          
0015.00 C     TMP2          DSPLY                                          
0016.00 C                   SETON                                        LR
0017.00 C                   RETURN                                         
        ****************** End of data ************************************

结果就不上图了,延时5s嘛~

这种风格也是我接触的第一中风格,本来我以为API都是这么调用的。。。。后来,我被推翻了。。。




使用方法二:     【CALLP风格】
 FMT *   *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 .
        *************** Beginning of data *********************************
0001.00  *                                                                 
0002.00 DTMP1             S               Z                                
0003.00 DTMP2             S               Z                                
0004.00 Dqcmdexc          PR                  EXTPGM('QCMDEXC')            
0005.00 D COMMAND                     3000A   CONST OPTIONS(*VARSIZE)      
0006.00 D LENGTH                        15P 5 CONST                        
0007.00  *                                                                 
0008.00 C                   EVAL      TMP1=%TIMESTAMP                      
0009.00 C                   CALLP     QCMDEXC('DLYJOB DLY(5)': 13)         
0010.00 C                   EVAL      TMP2=%TIMESTAMP                      
0011.00 C     TMP1          DSPLY                                          
0012.00 C     TMP2          DSPLY                                          
0013.00 C                   SETON                                        LR
0014.00 C                   RETURN                                         
        ****************** End of data ************************************
刚看到这个方法时我很凌乱,不懂是什么意思。然后一顿查资料才知道有CALL,  CALLB,    CALLP!!!!

CALL   Call a Program
CALLB  Call a Bound Procedure
CALLP  Call a Prototyped Procedure or Program.   (D行用PR声明Prototype)

有看到别人说什么静态调用,动态调用的,真心不懂。。。等懂了再更新上来吧~



使用方法三:
有别的使用风格么?我也不知道了。。。


阅读(2724) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

tlwd12013-05-15 17:33:00

第三种,自由格式   /free     /end-free