Setting shell's control break statement in the standard input stream “EOD” to exit the COBOL program

后端 未结 3 892
慢半拍i
慢半拍i 2020-12-20 09:02

I would like to invoke a cobol program thru shell script by assigning command line prompt values in the \"EOD\" as below.

#!/bin/bash
run pub/coblprog<<         


        
3条回答
  •  臣服心动
    2020-12-20 09:26

    OK, not answering questions asked of you, so... shot-in-the-dark time.

    Your program is not looping.

    It looks like this, doesn't it?

    PROCEDURE DIVISION.
        ACCEPT VAR1.
        ACCEPT VAR2.
        ACCEPT VAR3.
        ACCEPT VAR4.
    

    I've even coded the pointless dots.

    You are stacking up three "user inputs" in your script.

    The first ACCEPT takes the first, the second the second, and the third the third.

    The fourth ACCEPT finds no data waiting for it, so it waits... for you. To type. It is not looping, it is just waiting for input. You Ctrl-C, and dismiss it as a loop.

    If you have four ACCEPTs, you need four entries of data. Either supply four in the script, or supply the fourth "manually", or change the program so that it only ACCEPTs three.

提交回复
热议问题