Skip to main content

Good morning, I have a question regarding the RM-COBOL we do not have the xcentrisity so we use programs in C or Java to make consumptions of webservice or make communications with dataphones or perform specialized management of devices such as scale etc, to execute these programs we make this sentence

            CALL "SYSTEM" USING COMMAND-TO-EXECUTE
                    ON EXCEPTION
                       ERROR
                    NOT ON EXCEPTION
                       CANCEL "SYSTEM"
            END-CALL

But depending on how loaded the web service or databases or devices you lose control of the program while waiting for an answer and this causes delays especially in invoicing processes is critical, there is some way to make a call to programs external or COBOL to perform their operations but that I immediately return control of my application something like in the background


#RMCOBOL
#COBOL
#rm

Good morning, I have a question regarding the RM-COBOL we do not have the xcentrisity so we use programs in C or Java to make consumptions of webservice or make communications with dataphones or perform specialized management of devices such as scale etc, to execute these programs we make this sentence

            CALL "SYSTEM" USING COMMAND-TO-EXECUTE
                    ON EXCEPTION
                       ERROR
                    NOT ON EXCEPTION
                       CANCEL "SYSTEM"
            END-CALL

But depending on how loaded the web service or databases or devices you lose control of the program while waiting for an answer and this causes delays especially in invoicing processes is critical, there is some way to make a call to programs external or COBOL to perform their operations but that I immediately return control of my application something like in the background


#RMCOBOL
#COBOL
#rm
Of course it's possible. You can, for example, change whatever external program you're invoking with SYSTEM to start a background process (or communicate with one that's already running) and return as quickly as possible. Then the COBOL program will have to poll for completion, which can be signaled by whatever means you prefer.

It's not an ideal approach, but many systems have been built using this sort of loosely-coupled independent-process architecture, for decades.

I can't be more specific because you haven't given us any details about the application or its environment, and I don't know how comfortable your team is with the more advanced features of that environment.

Good morning, I have a question regarding the RM-COBOL we do not have the xcentrisity so we use programs in C or Java to make consumptions of webservice or make communications with dataphones or perform specialized management of devices such as scale etc, to execute these programs we make this sentence

            CALL "SYSTEM" USING COMMAND-TO-EXECUTE
                    ON EXCEPTION
                       ERROR
                    NOT ON EXCEPTION
                       CANCEL "SYSTEM"
            END-CALL

But depending on how loaded the web service or databases or devices you lose control of the program while waiting for an answer and this causes delays especially in invoicing processes is critical, there is some way to make a call to programs external or COBOL to perform their operations but that I immediately return control of my application something like in the background


#RMCOBOL
#COBOL
#rm

You didn't mention your platform, but on Windows, you should be able to invoke CMD.EXE as the COMMAND-TO-EXECUTE, with a command line like this:

  CMD.EXE /C "START program.exe parameters"

That will asynchronously launch your-program.  You can launch a non-interactive RM/COBOL program by using RUNCOBOL.EXE as your program (specify a path).

I'll confess that I didn't actually try this, but it should work.  Try your START command from a Windows command prompt -- it has a lot of options.  Type START /? for a list.


Good morning, I have a question regarding the RM-COBOL we do not have the xcentrisity so we use programs in C or Java to make consumptions of webservice or make communications with dataphones or perform specialized management of devices such as scale etc, to execute these programs we make this sentence

            CALL "SYSTEM" USING COMMAND-TO-EXECUTE
                    ON EXCEPTION
                       ERROR
                    NOT ON EXCEPTION
                       CANCEL "SYSTEM"
            END-CALL

But depending on how loaded the web service or databases or devices you lose control of the program while waiting for an answer and this causes delays especially in invoicing processes is critical, there is some way to make a call to programs external or COBOL to perform their operations but that I immediately return control of my application something like in the background


#RMCOBOL
#COBOL
#rm
hello thank you very much for the help given, effectively for the external programs (exe and jar) it works perfectly I return the control and I can continue with my main process but I have an additional concern, I am running a cobol process to extend the application, and start with / B parameter is running in the background CMD but the program in cobol is leaving visible the window of execution there is a way to lift the window in a hidden

I'm doing the execution like this:

CALL "SYSTEM" USING "CMD.EXE / C START / B runcobol PROGRAM"
ON EXCEPTION
DISPLAY "ERROR ON CALL SYSYEM"
NOT ON EXCEPTION
CANCEL "SYSTEM"
END-CALL

I try to use this function but it only hides the execution of system programs

CALL "C $ GUICFG" USING "MAIN WINDOW TYPE = HIDDEN"
EXIT-CODE
ON EXCEPTION
CONTINUE
NOT ON EXCEPTION
CANCEL "C $ GUICFG"
END-CALL

the specific question is whether I can execute a hidden call from a cobol program, that is to say that it does the effect when one changes the properties of the RMCONFIG.EXE where one can change it to the Main Window Type property and it can be hidden to hidden here I can change to specific programs but I need to be able to have that effect at the time of the call since there are several programs that I need to have that behavior.

Agradesco the initial response helped me to regain control.

Good morning, I have a question regarding the RM-COBOL we do not have the xcentrisity so we use programs in C or Java to make consumptions of webservice or make communications with dataphones or perform specialized management of devices such as scale etc, to execute these programs we make this sentence

            CALL "SYSTEM" USING COMMAND-TO-EXECUTE
                    ON EXCEPTION
                       ERROR
                    NOT ON EXCEPTION
                       CANCEL "SYSTEM"
            END-CALL

But depending on how loaded the web service or databases or devices you lose control of the program while waiting for an answer and this causes delays especially in invoicing processes is critical, there is some way to make a call to programs external or COBOL to perform their operations but that I immediately return control of my application something like in the background


#RMCOBOL
#COBOL
#rm
Your examples keep showing a CANCEL statement that references a built-in subprogram. I believe that in RM/COBOL, this does nothing, that is, is ignored. I have seen dialects of COBOL where a cancel of a built-in subprogram makes that built-in subprogram unavailable for the rest of the run unit or can lead to crashes if the built-in subprogram is used again. Built-in subprograms are usually not COBOL subprograms. CANCEL is a COBOL construct that simply means the referenced program should be placed in its initial state if called again. The referenced subprogram might be removed from memory, which was important in older memory-constrained systems. However, since the 1985 COBOL standard, CANCEL does not require this.

I would recommend removing these unnecessary and possibly harmful CANCEL statements. I know this doesn't address your question, but I couldn't keep ignoring this poor practice in your examples.

Good morning, I have a question regarding the RM-COBOL we do not have the xcentrisity so we use programs in C or Java to make consumptions of webservice or make communications with dataphones or perform specialized management of devices such as scale etc, to execute these programs we make this sentence

            CALL "SYSTEM" USING COMMAND-TO-EXECUTE
                    ON EXCEPTION
                       ERROR
                    NOT ON EXCEPTION
                       CANCEL "SYSTEM"
            END-CALL

But depending on how loaded the web service or databases or devices you lose control of the program while waiting for an answer and this causes delays especially in invoicing processes is critical, there is some way to make a call to programs external or COBOL to perform their operations but that I immediately return control of my application something like in the background


#RMCOBOL
#COBOL
#rm
Have you tried SystemWindowType=Hidden?