使用EXECIO将rexx输出逻辑写入数据集中吗?

问题描述

我有这个Rexx程序,我想将输出写入特定的数据集。但是我无法将终端上产生的确切输出打印到数据集。

public ngAfterViewInit(): void {
        this.digitFields = [];
        for (let i = 0; i < this.digits.length; i++) {
            this.digitFields[i] = document.getElementById('digitField' + i) as HTMLIonInputElement;
        }
    }

public onFieldInput($event,fieldindex: number) {
        const newInput = $event.detail.data;
        const nextIndex = (fieldindex + 1) % this.digits.length;
        const currentElement = this.digitFields[fieldindex];
        let nextElement = this.digitFields[nextIndex];

        if (!/\d/.test(newInput)) {
            this.digits[fieldindex] = '';
            currentElement.setFocus();
        } else {
            this.digits[fieldindex] = newInput;
            nextElement.setFocus();
        }

    }

我在z / OS终端上运行Rexx脚本,并获得以下示例输出,我希望以完全相同的方式将其复制到数据集。

/* REXX */
"FREE FI(outdd)"
"ALLOC FI(outdd) DA('Z01510.OUTPUT(SAMPLCBL)') SHR REUSE" 
row = 0
hline = '      *-----------------------'
mline.0 = '       IDENTIFICATION DIVISION.'
mline.1 = '      *'
mline.2 = '       PROGRAM-ID. '
mline.3 = '      *'
mline.4 = '      *'
mline.5 = '      * Description :'
mline.6 = '      *'
mline.7 = '      * Created on : 'date()
mline.8 = '      * Created by : '
mline.9 = '      *            : Userid('')'
mline.10 = '      *            : Using' '()'
mline.11 = '      *'
mline.12 = '      * Called by :'
mline.13 = '      *'
mline.14 = '      * Calls :'
mline.15 = '      * Change Activity :'
mline.16 = '      *             ©copyright of -----.'
mline.17 = '       ENVIRONMENT DIVISION.'
mline.18 = '       INPUT-OUTPUT SECTION.'
mline.19 = '       DATA DIVISION.'
mline.20 = '       WORKING-STORAGE SECTION.'
mline.21 = '       LINKAGE SECTION.'
mline.22 = '       PROCEDURE DIVISION.'
mline.23 = '       A-MAIN SECTION.'
mline.24 = '           STOP RUN.'

mline.25 = '      *           End of '
say hline
say mline.0
say hline
say mline.2
say hline
do i = 4 to 16
    say mline.i
end
say hline
do i=17 to 24
    say mline.i
    say hline
end
say mline.25
"EXECIO * disKW outdd (stem mline."
"EXECIO 0 disKW outdd (FINIS"
"FREE FI(outdd)" 
exit

解决方法

您不应将数据存储在mline.0中,而应将茎尾的计数(mline.1 mline,2等)存储在其中,并将其作为要写入的记录数传递给EXECIO。使用mline.0并没有错,但是“正常”的做法是将其用作计数-就像EXECIO读入茎一样。 如果要编写Hline,则需要先将其添加到Mline词干中的适当位置。

,

至少,您不应该使用mline.0。 EXECIO DISKW将从mline.1开始写入,索引0被忽略。

除此问题外,除非您要在输出文件中使用hline变量,否则我看不到任何输出错误。在这种情况下,只需在正确的位置插入mline索引以及hline的内容。

如果这不是您的问题,请更精确地描述“我无法打印确切的输出”是什么意思

,

有几种方法可以实现您想要的,但是最简单的方法可能是:

  1. 将每个QUEUE替换为DELSTACK,以将行放置在堆栈上
  2. 更改EXECIO以适应写出堆栈
  3. 使用/* REXX */ "FREE FI(outdd)" "ALLOC FI(outdd) DA('Z01510.OUTPUT(SAMPLCBL)') SHR REUSE" row = 0 hline = ' *-----------------------' mline.0 = ' IDENTIFICATION DIVISION.' mline.1 = ' *' mline.2 = ' PROGRAM-ID. ' mline.3 = ' *' mline.4 = ' *' mline.5 = ' * Description :' mline.6 = ' *' mline.7 = ' * Created on : 'date() mline.8 = ' * Created by : ' mline.9 = ' * : Userid('')' mline.10 = ' * : Using' '()' mline.11 = ' *' mline.12 = ' * Called by :' mline.13 = ' *' mline.14 = ' * Calls :' mline.15 = ' * Change Activity :' mline.16 = ' * Copyright of -----.' mline.17 = ' ENVIRONMENT DIVISION.' mline.18 = ' INPUT-OUTPUT SECTION.' mline.19 = ' DATA DIVISION.' mline.20 = ' WORKING-STORAGE SECTION.' mline.21 = ' LINKAGE SECTION.' mline.22 = ' PROCEDURE DIVISION.' mline.23 = ' A-MAIN SECTION.' mline.24 = ' STOP RUN.' mline.25 = ' * End of ' QUEUE hline QUEUE mline.0 QUEUE hline QUEUE mline.2 QUEUE hline do i = 4 to 16 QUEUE mline.i end QUEUE hline do i=17 to 24 QUEUE mline.i QUEUE hline end QUEUE mline.25 "Execio "Queued()" DISKW outdd (FINIS" "FREE FI(outdd)" "DELSTACK" exit 清除堆栈

因此,您的脚本应如下所示:

2.3.0
,

我编辑了上一个答案,因此可以满足您的要求。这是调整后的答案:

/* REXX */
queue '      *-----------------------'
queue '       IDENTIFICATION DIVISION.'
queue '      *-----------------------'
queue '       PROGRAM-ID. '
queue '      *-----------------------'
queue '      *'
queue '      *'
queue '      * Description :'
queue '      *'
queue '      * Created on : 'date()
queue '      * Created by : '
queue '      *            : Userid('')'
queue '      *            : Using' '()'
queue '      *'
queue '      * Called by :'
queue '      *'
queue '      * Calls :'
queue '      * Change Activity :'
queue '      *             ©Copyright of -----.'
queue '      *-----------------------'
queue '       ENVIRONMENT DIVISION.'
queue '      *-----------------------'
queue '       INPUT-OUTPUT SECTION.'
queue '      *-----------------------'
queue '       DATA DIVISION.'
queue '      *-----------------------'
queue '       WORKING-STORAGE SECTION.'
queue '      *-----------------------'
queue '       LINKAGE SECTION.'
queue '      *-----------------------'
queue '       PROCEDURE DIVISION.'
queue '      *-----------------------'
queue '       A-MAIN SECTION.'
queue '      *-----------------------'
queue '           STOP RUN.'
queue '      *-----------------------'
queue '      *           End of '
queue '      *-----------------------'

do i = 1 to queued()
    parse pull line
    say line
    mline.i = line
end

rc = BPXWDYN( 'alloc fi(outdd) da(''Z01510.OUTPUT(SAMPLCBL)'') shr reuse' )
address 'MVS' 'EXECIO * DISKW' outdd '(finis stem mline.'
rc = BPXWDYN( 'free fi(outdd)' )
exit rc