Our vBulletin migration is complete.
Welcome vBulletin users! All content and user information from the Micro Focus Forums (vBulletin) site has been migrated to this site. READ MORE.
Oscar_Ramos Absent Member.
Absent Member.
853 views

rm cobol

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

Tags (3)
0 Likes
5 Replies
Micro Focus Expert
Micro Focus Expert

RE: rm cobol

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.
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: rm cobol

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.

0 Likes
Oscar_Ramos Absent Member.
Absent Member.

RE: rm cobol

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.
0 Likes
Bruce_Sinclair Absent Member.
Absent Member.

RE: rm cobol

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.
0 Likes
Bruce_Sinclair Absent Member.
Absent Member.

RE: rm cobol

Have you tried SystemWindowType=Hidden?
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.