How do I get Visual COBOL runtime to accept a blank or generic TERM environment variable? All of our COBOL programs run on Linux with no user session (started by cron or other daemon processes). All of these programs have stdout redirected to log files and use the "DISPLAY" statement to put info into the log files. Most of this works fine, but in a few cases (and I cannot see anything special about the DISPLAY statements) I get a message like com.microfocus.cobol.program.COBOLRuntimeException: 191 Terminal type not defined [ts236h (while in native code - see cause for more information)] There is no TERMINAL per se, so I just want the DISPLAY the string. The last line in the log file before the error is from this source line display 'values returned to topend: ' out-detail-tbl. where out-detail-tbl look like. 01 out-detail-tbl. 05 dtl-div-nr pic x(3). 05 dtl-div-name pic x(31). 05 dtl-div-ltr pic xx. 05 dtl-reg-id pic xx. this DISPLAY occurs in a loop which should occur 19 times, but only occurs once. If I run the program (unchanged) from Linux logon session instead of launching it from the daemon , it works.
↧
Forum Post: Visual COBOL 3.0 and TERM environment variable on linux
↧
Forum Post: RE: Help with XML
Hi We are now at the stage in our development where we want to send SOAP messages from our Windows forms application to a government website and receive messages back in the process. We are creating the actual XML use .NET classes, XMLDocument, etc. For SOAP, we need to wrap the XML in an envelope, sign the message, and send to an endpoint. To sign the message: we need to extract a certificate from a .p12 file using an encrypted passord add a binary security token add a timestamp add a digital signature, which involves extracting a private key from the cert. After much trawling, it seems that .net does not have everything we need to achieve our goals. Adding all the elements to the SOAP envelope should be fairly straightforward, it is creating them in the correct format that we are having difficulty with. We are using Visual Cobol 2.3 for Visual Studio. We were given sample code written in Java. If we have to use Java then what version of Java do we download? In other words, what version of Java is compatible with the version of VC we have? Please nobody mention Eclipse, we would only be calling a relatively few lines of Java code to achieve what we want, surely this is achievable in VS. Any help and other suggestions welcome. Thank you Brendan
↧
↧
Forum Post: Tutorial or example for calling a URL and processing the response
I was wondering if there is a tutorial or example for calling a URL and manipulating the response.
↧
Forum Post: RE: Tutorial or example for calling a URL and processing the response
Hi, Can you provide a bit more detail? What do you mean exactly by calling a URL? Are you trying to call a Web Service at a particular URL? What type of Web Service? What type of code is your client program, native, managed .NET, managed JVM? Thanks
↧
Forum Post: RE: Tutorial or example for calling a URL and processing the response
I wish to call an internal website by URL (http://). This site constructs a report, and sends back a location where the report is created. So, the program would have to call a link (http://) and send the request. Then would receive the http response, and manipulate the text sent back. In C# it is done by instantiating a web browser object, setting the url, and using the methods to send the request and receive the response.
↧
↧
Forum Post: RE: "Call winapi..." fails in chained-to prog, works in called prog?
I cannot get it to fail with VC 3.0 either. You might have to load in the Windows User32.dll at the beginning of the program that is creating the MessageBox. 01 pp procedure-pointer. set pp to entry "User32" Letting the run-time system clean up open resources in your application by issuing a CHAIN is certainly not the approach I would take. Couldn't you simply create your own cleanup routine that you executed prior to displaying the MessageBox that closed all open files, disconnected from the database etc.? If you are worried about the user not clicking on the message box, if you already performed your cleanup routine prior to displaying the message wouldn't that take care of that issue? It might be better to display your own window using a timeout as an alternative to a MessageBox if you are concerned with the user ignoring it.
↧
Forum Post: RE: Tutorial or example for calling a URL and processing the response
Are you using managed .NET COBOL? If you are then you should be able to perform this function using the same class and methods that you do in C#. If you post the example C# code I will convert it to the equivalent COBOL for you...
↧
Forum Post: RE: Tutorial or example for calling a URL and processing the response
I ran into issues at work, and I was unable to create this. I will get to it ASAP.
↧
Forum Post: RE: Visual COBOL 3.0 and TERM environment variable on linux
I can't guess what in your program is triggering this error. It sounds like some DISPLAYs are causing the runtime to want to send terminal-control sequences. A couple of things you might try: Set TERM=dumb in /etc/environment (or on the command line, if the command line is interpreted by a suitable shell), so that TERM is always set to something . Enable the S5 runtime switch for your program. You can do that by including " (+S5) " on the command line (including the parentheses, which need to be escaped if the command line will be interpreted by the shell), or by setting COBSW=+S5 in the environment. That tells the runtime to make DISPLAY UPON CONSOLE redirectable. It might have an effect on your issue. Note there's no such thing as a "generic" value for $TERM. The TERM environment variable was standardized by POSIX.1 and XPG3, and used by convention long before that in both the AT&T and BSD UNIX families, but none of those define behavior when TERM is unset or empty. (In fact, they don't standardize its value at all.) If "there is no terminal per se", then where are the DISPLAYs going?
↧
↧
Forum Post: Eclipse precompile cobol-source with gcc not working
the precompile-step "P(gcc) -E -P -x c -I/home/max/workMax/include ENDP" gets always the error "COBCH0018S Preprocessor error on initialization" Any idea, what went wrong?
↧
Forum Post: RE: Eclipse precompile cobol-source with gcc not working
system ist redhat-linux, visual-cobol 4
↧
Forum Post: RE: Eclipse precompile cobol-source with gcc not working
Hello lennart.wegner, Can you give us some background about what you are trying to accomplish? Are you trying to use compiler options that you have previously used at the command line, or in a build script? Are you trying to use Visual COBOL to compile a mixture of COBOL and C routines? The Micro Focus COBOL preprocessor directive, P, can be used to specify a preprocessor that will operate on COBOL source code before it is processed by the COBOL compiler. This preprocessor must be written specifically to cooperate with the Micro Focus COBOL compiler. I am only familiar with "gcc" as a C compiler, not as a Micro Focus conforming COBOL preprocessor.
↧
Forum Post: RE: Eclipse precompile cobol-source with gcc not working
Hello Blair, i have a lot of cobol-code, running on a mainframe bevore. the cobol-code has a lot of c-includes with cobol-code inside, such as INPUT-OUTPUT SECTION. FILE-CONTROL. #include "I1VOR01" therefore i have to use a c-precompile to get proper cobol-code. i like to use gcc with -E option (precompile only). this works fine on the command line: #!/bin/bash #set -x P=TTMRK rm -f $P.cob gcc -E -P -x c -D _VERSION="'6040'" -I/home/max/workMax/marmInclude -o $P.cob $P.in do you have suggestions for this problem? regards lennart
↧
↧
Forum Post: RE: Eclipse precompile cobol-source with gcc not working
Thank you for the additional info. So, it sounds like you are used to invoking gcc as a first "step" to bring in portions of the COBOL source file. Then in a second step, you separately submit the resulting source file to the COBOL compiler. I have a couple of ideas, but first, a few more questions. When your "include" files are brought in, is gcc doing any additional processing to the included files? Perhaps replacing strings of text in the files? Are there "nested" #include statements, where one of these included files might also contain #include statements? Or, is gcc just bringing in the #include files as-is?
↧
Forum Post: RE: Eclipse precompile cobol-source with gcc not working
Sorry, one more question. Is this a one-time conversion, where you would be able to modify the source files if necessary? Or, do you need to leave them as-is, so that they could also continue to work in the old environment where using gcc is required?
↧
Forum Post: RE: Tutorial or example for calling a URL and processing the response
I used HttpWebRequest instead, but this returns a value from Google's main site. Console app. using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; using System.Text; namespace WebBrowserConsoleApplication { class Program { static void Main(string[] args) { var webAddr = " https://www.google.com"; var httpWebRequest = (HttpWebRequest) WebRequest.Create(webAddr); httpWebRequest.ContentType = "application/x-www-form-urlencoded"; httpWebRequest.Method = "GET"; var httpResponse = (HttpWebResponse) httpWebRequest.GetResponse(); using(var streamReader = new StreamReader(httpResponse.GetResponseStream())) { var result = streamReader.ReadToEnd(); Console.WriteLine(result); } } } }
↧
Forum Post: RE: Eclipse precompile cobol-source with gcc not working
yes, there ist string replacing like #define _VERSION '6040' .. move _VERSION to picXXXX furthermore then ist code like #ifdef _zos ... #else .. #endif where #define _zos ist only set at the mainframe-compile and not at unix no nested includes
↧
↧
Forum Post: RE: Eclipse precompile cobol-source with gcc not working
no, not a one-time conversion. the code has to run at different target-machines (mainframe,linux)
↧
Forum Post: RE: Tutorial or example for calling a URL and processing the response
The Visual COBOL equivalent to this using a program instead of a class would be (you could use either) $set ilusing"System" $set ilusing"System.Collections.Generic" $set ilusing"System.IO" $set ilusing"System.Net" $set ilusing"System.Text" program-id. Program1 as "WebBrowserConsoleApplication.Program1". procedure division. declare webAddr = " https://www.google.com" declare httpWebRequest = type WebRequest::Create(webAddr) as type HttpWebRequest set httpWebRequest::ContentType = "application/x-www-form-urlencoded" set httpWebRequest::Method = "GET" declare httpResponse = httpWebRequest::GetResponse as type HttpWebResponse perform using streamReader as type StreamReader = new type StreamReader(httpResponse::GetResponseStream) declare result = streamReader::ReadToEnd invoke type Console::WriteLine(result) end-perform goback. end program Program1.
↧
Forum Post: RE: Eclipse precompile cobol-source with gcc not working
Thanks for your updates. I would suggest trying the option in the Visual COBOL for Eclipse IDE for a pre-build event, to get the COBOL source generated by gcc using a script. You can do this by right-clicking on the Project, and selecting Properties. Then, navigate to Micro Focus->Build Configurations-> Events. On the Events pane, you can enter commands that are to be executed before (or after) the actual Build (COBOL compile) takes place. You might try entering a command in the "Pre-build event command line" field to invoke a script, which would run the gcc preprocessor against each program in the project.
↧