Quantcast
Channel: Visual COBOL Knowledge Base
Viewing all 214 articles
Browse latest View live

How to build the .exe in a different folder leaving the other generated files in the output path?

$
0
0
Revision 1 posted to Visual COBOL Knowledge Base by Fano_MF on 10/18/2017 9:04:32 PM

Problem:

When building a project, all output files are created in one location that is specified from the COBOL properties as Output Path. Is there a way to create the .exe in a different folder leaving all the other generated files in the output path?

Solution:

It is not possible to have the .exe created in a different folder while the rest of the generated files get created in the output folder. However, a post-build event can be used to have the .exe file to be copied to another folder after a successful build.

Here are the steps to create a post-build event that copies the .exe file to a folder (e.g. C:\Prod) after each successful build:
1. go to project properties
2. click on COBOL properties
3. click on Build Events
4. click on Edit Post-build
5. type copy or xcopy (with a trailing space)
6. click on Macros (to see all possible macro names)
7. double-click on TargetFileName
8. type the target folder to have the following:
xcopy $(TargetFileName) C:\Prod
9. click on OK
10. leave the Run the post-build event drop-down with On successful build
11. click on OK to exit


Visual COBOL/Enterprise Developer fails to install - Error shown: A matching Microsoft Visual Studio Shell (Isolated) language pack is required

$
0
0
Revision 2 posted to Visual COBOL Knowledge Base by Kim.Hoskin on 9/12/2017 6:37:50 AM

Problem

 

On Windows Operating Systems that use different locale to English, if installing Visual COBOL or Enterprise 2.3.x can fail.
Reviewing the installation log file, typically located in path:
e.g.
%temp%\Micro_Focus_Enterprise_Developer_for_Visual_Studio_2012_20170515140705_0_vs2012intshell.log

Entries such as the following are seen:
[1290:0F18][2017-05-16T11:21:13]: MUX:  Stop Block: IsoShellLPBlock : A matching Microsoft Visual Studio Shell (Isolated) language pack is required, but it is not installed on this computer. Please install the Microsoft Visual Studio Shell (Isolated) language pack for this language and retry.

 
Resolution:

 

To resolve the issue the relevant language pack should be installed, see Microsoft’s download website e.g. URL: https://www.microsoft.com/en-us/download/details.aspx?id=30671.

Visual COBOL/Enterprise Developer for Eclipse - Compile only certain sources in project with target “all gnt/int files”

$
0
0
Revision 1 posted to Visual COBOL Knowledge Base by Kim.Hoskin on 9/12/2017 11:40:51 AM

Problem

 

Using the Eclipse IDE  how can only certain sources within a project with target “all gnt/int files” be compiled?

 
Resolution:

 

In the Eclipse IDE and your project that compiles to output type “all Int/Gnt files”, to be able compile multiple sources files but not all in the project, this can be achieved by clicking on the relevant source files in the cobol explorer view and holding down the ctrl key to multi select the ones that should be compiled. Once the source files are selected then right click on one of the selected source files and click the compile option. Only those selected source files will be compiled.

Visual COBOL/Enterprise Developer - In Eclipse how to run with profiler?

$
0
0
Revision 1 posted to Visual COBOL Knowledge Base by Kim.Hoskin on 9/12/2017 11:46:37 AM

Problem

 

How to run a cobol program with the profiler enabled in the Eclipse IDE

 
Resolution:

 

To enable this open your Run Configuration, locate the dynamic analysis tab, locate the enable Profiler option “Enable Profiling”, Click OK/Run. The .ipf file is then generated in a ..\Profiler folder in the project directory for your analysis.

Visual COBOL - What to do for missing cblrtssi.lib?

$
0
0
Revision 1 posted to Visual COBOL Knowledge Base by Kim.Hoskin on 10/3/2017 2:55:33 PM

Problem

 

With Net Express, to use the single threaded runtime, the  following .lib file would need to be linked to the affected cobol program:
"C:\Program Files (x86)\Micro Focus\Net Express 5.1\Base\Lib\cblrtssi.lib".
In Visual COBOL this file is not present any more, what to do now, how to approach this?

 
Resolution:

 

There are two types of the imported library of the COBOL runtime system in Net Express, one is for single-threaded runtime system (CBLRTSSI.LIB) and the other multi-threaded (CBLRTSMI.LIB).

In Visual COBOL, there is no single-thread imported library since everything is multi-threaded.

For this reason, the solution is to link CBLRTSMI.LIB. This library can typically be found in "C:\Program Files\Micro Focus\Visual COBOL\lib" in 32-bit Windows or in "C:\Program Files (x86)\Micro Focus\Visual COBOL\lib" in 64-bit Windows, depending on where Visual COBOL is installed to.

Dialog System application fails with RTS 173 on mfdir2

$
0
0
Current Revision posted to Visual COBOL Knowledge Base by Fano_MF on 10/20/2017 2:39:44 AM

Problem:

A Dialog System application fails with the following error when it does a CALLOUT to "dsdir":

Load error: file 'mfdir2'
error code: 173, pc=0, call=1, seg=0,
173 Called program file not found in drive/directory.

Solution:

This RTS 173 on 'mfdir2' occurs when the application is linked as 'Console Application' in Visual COBOL. It should be linked as 'Windows Application' instead.

Here are the steps to resolve this issue:

  1. open the project in Visual Studio
  2. open the project properties
  3. select Windows Application from the Output Type drop-down under Application properties
  4. rebuild the project
  5. redeploy the application

The equivalent of the above from the command line is to use the -g switch in the cbllink command, e.g. cbllink -g -v -re ...

Tags: visual cobol

Error connecting to SQL Server - Connection is busy with results for another command

$
0
0
Revision 1 posted to Visual COBOL Knowledge Base by Matthew Coronado on 10/17/2017 8:54:26 AM

Problem:

When executing a COBOL application where the program tries to connect to an SQL Server database, you get an error: 'Connection is busy with results for another command '.

Resolution:

This SQL Server error message is thrown when you have multiple connections going to the same database (through the same connection driver e.g ODBC). The error is not specific to the COBOL language and can be resolved by enabling the MARS (multiple active results sets) SQL directive.

You can do this at a database level and/or in your SQL COBOL compilation directives by specifying SQL(MARS).

Cannot install Visual COBOL - exits automatically with: echo $? outputs 0

$
0
0
Revision 2 posted to Visual COBOL Knowledge Base by PhillR on 10/17/2017 9:48:29 AM

PROBLEM

When trying to install *.rpm file - it exits without installing properly with the message:

echo $? outputs 0 and product has not been installed.

RESOLUTION

rpm -ivv     will provide more information on what is going wrong.

If it shows openjdk which outputs "openjdk version" instead of "java version", it means it has not detected the correct java installation.

You will need the oracle java package for the *.rpm package to install properly.


Creating COBOL Copybook projects in Visual COBOL for Eclipse

$
0
0
Revision 5 posted to Visual COBOL Knowledge Base by blairm on 10/23/2017 3:29:51 PM

Problem

How do I create a separate project in Visual COBOL for Eclipse that can contain copybooks that I want available to multiple COBOL projects?

 

Solution

  1. In Visual COBOL for Eclipse, create a project of type "COBOL copybook", named for example, "my_copybooks".
    • From the menu, select File -> New -> COBOL Copybook Project, and enter a name for the project
  2. Move desired copy files from "main" project into "my_copybooks" project
    • Select the copy files in the COBOL project using CTRL-Click
    • Drag the selected files to the new COBOL Copybook project
  3. Add reference to "my_copybooks" project in       "main"project
    • In "main" COBOL project, go to Project Properties -> Micro Focus -> Build Path
    • Choose the "Projects" Tab
    • Click "add" button to add a reference to another project
    • Choose the "my_copybooks" project
  4. Remove the affected copy files from  "main" COBOL project
    • Right click each copy file in the main project, and choose Delete

Instructions tested with Visual COBOL for Eclipse 3.0

Using Visual COBOL compiled application does not run on Windows XP or Windows 2003

$
0
0
Revision 3 posted to Visual COBOL Knowledge Base by Kim.Hoskin on 10/25/2017 3:07:35 AM

Problem

When running a Visual COBOL compiled application on Windows XP, it fails to start.


Resolution

Ensure that the application is compiled using the command:

cbllink –y

Option y specifies that the application is to be built so that it can also run on Windows XP and Windows Server 2003.

If working within Visual Studio or the Eclipse IDE this option can be added to the Additional Directives area.

Enterprise Server deployed Java Web Service Interface calls COBOL program in UPPER case. How do you call a program in lower case?

$
0
0
Current Revision posted to Visual COBOL Knowledge Base by Kim.Hoskin on 10/26/2017 11:24:12 AM

Problem

An Enterprise Server deployed Java Web Service Interface calls COBOL program in UPPER case, resulting in RTS 173 errors as the COBOL program is compiled to lower case.

What needs to be done to set the Java Interface to call the COBOL program in lower case?

Resolution

Use the directive FOLD-CALL-NAME "LOWER" in the project that deploys the Java Web Service Interface to resolve this issue.

How to package Dialog system screenset .gs files into a LBR file using Visual COBOL

$
0
0
Current Revision posted to Visual COBOL Knowledge Base by Kim.Hoskin on 10/26/2017 11:26:48 AM

Problem 

Visual COBOL Project contains .gs screenset files but these need to be packaged to one .lbr file.

When building the project the following error may be encountered:

File obj\x86\Debug\<Filename> could not be copied, as the file was not found.

 
Resolution

All the screenset files present in the project , by default, would be marked as Build Action "none" in all the screenset file's properties.

Change this property to Build Action "content", at the next build attempt the .lbr file will be generated without no error.

Cannot start server/region: Error CASCF0052S casstart: Error reading console daemon configuration data

$
0
0
Revision 1 posted to Visual COBOL Knowledge Base by Dan.Wright on 10/30/2017 9:43:20 PM

Problem:


On Linux/UNIX, a server/region in Enterprise Server (ES) would not start: CASCF0052S casstart: Error reading console daemon configuration data

Solution:

Here is a link into the documentation showing an explanation:

http://documentation.microfocus.com/help/index.jsp?topic=%2Fcom.microfocus.eclipse.infocenter.visualcobol.vs2012%2FGUID-6081411C-F6E2-42BC-8FD8-3C748C9C05A8.html

It is a permissions problem with the "system directory" of the server/region, caused by trying to start or stop the server/region using a different UNIX user-id than the user-id used on the prior occasion.

The system directory is where files such as the console.log, log-1.html, etc are kept.  The directory is created and owned by the user-id that last started the server/region, and if you try to start the server/region with a different user-id, there will be a permissions problem on the system directory.

The quickest way to overcome this problem is to remove or re-name the existing system directory.  The system directory is named after the server/ region, and by default it is located in /var/mfcobol/es, though the location can be configured using the "casperm" command or by modifying the file $COBDIR/etc/cas/cas.cfg.  To reveal the current location, enter:

grep CASROOT $COBDIR/etc/cas/cas.cfg

After the existing system directory is removed or re-named, then when the server is next started, it will create a new system directory, and will start successfully.

If you start the server/region by clicking the "Start" button on the ES Admin page, then the UNIX-userid will be the "Default startup process user ID" that you see on the Start page.  But if you use "casstart" or "casstop" from the command line, you could possibly be logged in as a different user-id.  The long-term solution to this problem is to use the same user-id to start the server/region each time.  If you want to use "casstart" or "casstop", and sometimes you also want to use the "Start" and "Stop" buttons on the ES Admin page, then when you use "casstart" or "casstop", make sure you are logged in as the "Default startup process user ID" from the Start page.

Installing the Oracle SCOTT schema for testing with Visual COBOL

$
0
0
Revision 1 posted to Visual COBOL Knowledge Base by Mark B on 10/31/2017 7:40:48 PM

Problem:

I have installed Oracle 11gExpress and Pro*COBOL precompiler to test this COBOL program with embedded SQL that uses the SCOTT schema:

IDENTIFICATION DIVISION.

       PROGRAM-ID.  ORATEST.

       ENVIRONMENT DIVISION.

       DATA DIVISION.

       WORKING-STORAGE SECTION.

           EXEC SQL INCLUDE SQLCA END-EXEC

           EXEC SQL BEGIN DECLARE SECTION END-EXEC.

 

           01  USERNAME   PIC X(10).

           01  PASSWD     PIC X(10).

 

           EXEC SQL END DECLARE SECTION END-EXEC.

 

       PROCEDURE DIVISION.

           LOGON.

                   MOVE "SCOTT" TO USERNAME

                   MOVE "TIGER" TO PASSWD

                   EXEC SQL

                       CONNECT

                       :USERNAME IDENTIFIED BY :PASSWD

                   END-EXEC.

                   DISPLAY SQLCODE

                   STOP RUN.

However when I run my program I receive an error ORA-01017: invalid username/password; logon denied, what is wrong?

Resolution:

The SCOTT schema contains a number of tables that can be used for testing purposes, and needs to be installed.

The follow these steps to install the schema:

  • Open a command prompt
  • Change directory to C:\oraclexe\app\oracle\product\11.2.0\server\rdbms\admin
    this directory contains a number of SQL scripts including SCOTT.SQL
  • Start SQLPlus as follows:

    SQLPLUS /AS SYSDBA (this logs onto the database as SYSDBA in order to carry out some admin tasks :

  • Having successfully logged on, the SCOTT.SQL script needs to be run as follows:

    @SCOTT


  • Now check the tables exist by running the following query:

    SELECT TABLE_NAME FROM DBA_TABLES WHERE OWNER=’SCOTT’


Now run the program again - successfully:

XML-PARSE fails with exception 791043 when compiling using the XMLPARSE(XMLSS) directive

$
0
0
Current Revision posted to Visual COBOL Knowledge Base by Matthew Coronado on 11/2/2017 1:36:25 PM

Problem:

Programs that use the XML-PARSE directive, fail to compile with an exception 791043 in Visual COBOL version 2.3 Update 2 and 3.0

Resolution:

In Visual COBOL 2.3 Update 2 and 3.0, the new parser used by XML-PARSE in XMLSS mode does not recognise the encoding "Windows-1252".

Changing the XMLPARSE directive to use XMLPARSE(COMPAT) or changing the XSD's encoding from "Windows-1252" to "ISO-8859-15" can be used as a workaround.

A fix for this compilation error will be available in the 4.0 version of Visual COBOL.


Creating Record Layout (.str) files from from the command line with DFSTRCL

$
0
0
Current Revision posted to Visual COBOL Knowledge Base by Mark B on 4/19/2018 11:08:35 PM

Problem:

The Record Layout Editor within the Classic Data File Tools enables the creation of structure files (.str) for use when viewing and editing records in a structured or formatted way within the Data File Editor.

Typically a Record Layout File is created within a Visual COBOL project by right-clicking on the source file name within the solution explorer that contains the Data Division information you require, and selecting Create Record Layout File.

(Note: The program must be compiled and a .idy file must exist).
Select Create Record Layout File with Data Tools.

If there are several data files that require layouts, this process must be repeated for each file.

Resolution:

Note: DFSTRCL creates DEFAULT record layout (.str) files, if conditional record layout files are required use the New Record Layout Wizard from  within the Data File Editor

 
The Data File Structure Command Line (DFSTRCL) was added in Visual COBOL V2.3. The utility enables you to create DEFAULT record layout (.str) files from .idy files directly from the command line, and must be run from a Visual COBOL command prompt.
DFSTRCL can be used to process a single debug information (.idy) file. Alternatively, it can be configured to perform batch processing using a parameters file passed at the command line using the /r parameter. Please refer to the Visual COBOL documentation for further details.

In the example below a data file has two record layouts STUDENT-RECORD and COURSE-RECORD.
A default record layout based on the STUDENT-RECORD needs to be created, the .str will be saved in the same location as the .idy file.

create record layout (.str) file

1.The COBOL program must be compiled for debug
2.Run DFSCTRL passing the necessary parameters: e.g. DFSTRCL STUDENTS.IDY /D STUDENT-RECORD
  (where /D is record name)
3.Load the data file into the Data File Editor - type MFDATATOOLS STUDENTS.DAT




(Note: If conditional record layout files are required use the New Record Layout wizard from within the Data File Editor)

COBOL calling a C function within a library using the INITCALL directive.

$
0
0
Current Revision posted to Visual COBOL Knowledge Base by raquelc on 6/18/2018 9:02:31 AM

Problem:

On Linux/Unix, a COBOL program can call a C function within a library using INITCALL, but on Windows, it gives error: 173 Called program file not found in drive/directory.

Resolution:

INITCALL loads the dll/so, but it needs to know what entry is being called within it.  One way to achieve this is by having the same entry name as the binary module itself.  However, there might be several entries in the dll/so that would need to be called separately. In this scenario, INITCALL behaves differently in Linux/Unix compared to Windows.

When the entry and the shared object name are different, on Linux/Unix, the entry can be called by using the "-e name" flag at compilation time.

On Windows, if the Cobol program cannot find an entry with the same name as the dll/so, the first entry in ordinal position is called. To change this behaviour, any entry within the dll that is to be called by COBOL must be exported. For this, a .def file must be created for the dll containing the relevant entry points. Example:

EXPORTS

Entry1

Entry2

Entry3

Then, the .def file must be compiled together with the C source when creating the dll:

cl /LD program.c entryfile.def

Note that the Cobol program and the dll must be in the same directory or on %PATH%.

Tags: visual cobol, C, COBOL, initcall

Licensing error 244 occurs when running native applications with COBOL Server 4.0

$
0
0
Current Revision posted to Visual COBOL Knowledge Base by Fano_MF on 6/26/2018 8:01:01 PM

Problem:

Running a native COBOL application from a network server with COBOL Server 4.0 works fine the first time. Any subsequent runs fail with the following:

Execution error : file ''
error code: 244, pc=0, call=1, seg=0
244 Licensing initialization error

Resolution:

The Micro Focus development team is looking into this issue, and the workaround in the meantime is to add the following entry in the CES.INI file:

SETENV MFCES_INIT_LOCATION=\\ServerName\MicroFocusSrv\Bin\ces.ini

where Servernameis the name or IP address of the server and MicroFocusSrvis the network share name on the COBOL Server 4.0 installation folder.

Visual COBOL 2.3 setup fails with MSI error 0x80070643

$
0
0
Current Revision posted to Visual COBOL Knowledge Base by Fano_MF on 6/27/2018 12:33:59 PM

Problem:

Visual COBOL 2.3 for Visual Studio 2015 fails with the following error message:

Setup Failed

0x80070643 - Fatal error during installation.

Fix setup issue(s) and retry. For more information see the log file.

Resolution:

Visual COBOL setup verifies and installs few pre-requisites if missing. When one of these pre-requisites fails to install, then the error above occurs, and the log file should indicate where the problem occurred.

For instance, the error is reported in several lines:

Error 0x80070643: Process returned error: 0x643
Error 0x80070643: Failed to execute EXE package.
Error 0x80070643: Failed to configure per-machine EXE package.
Applied execute package: jre, result: 0x80070643, restart: None
Error 0x80070643: Failed to execute EXE package.

In the fourth line of the error messages above, it indicates that jre was the package that failed.

The actual command is reported in the same log file few or several lines before the error messages with an entry starting with "Applying execute package: <pre-requisite> [...]". In this case, it is jre

Applying execute package: jre, action: Install, path: C:\ProgramData\Package Cache\E0E42AAEEDBB77A19809004A576496DCDCF99ED5\prereqs\jre-8u51-windows-i586.exe, arguments: '"C:\ProgramData\Package Cache\E0E42AAEEDBB77A19809004A576496DCDCF99ED5\prereqs\jre-8u51-windows-i586.exe" /s'

The problem should be resolved by deleting the folder with the long string where the executable is started from, e.g. C:\ProgramData\Package Cache\E0E42AAEEDBB77A19809004A576496DCDCF99ED5\, and by relaunching the Visual COBOL setup.

The alternative, in the case of the Java run-time (jre), would be to install jre manually by downloading the file from http://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html

Once the Java runtime is installed, the Visual COBOL 2.3 setup will not need to install it anymore.

Visual COBOL for Eclipse 3.0 on Windows Server 2016

$
0
0
Revision 2 posted to Visual COBOL Knowledge Base by lmagalski on 7/12/2018 6:28:54 PM

Problem:

After selecting a workplace you receive the following error while loading into eclipse.

"TSUIN0126 At least one exception occurred during the initialization of the AWM meta model. See error log for more information."

Resolution:

This error is caused by the version of eclipse that VCE 3.0 is built on not recognizing windows server 2016 as a valid operating system. This is resolved by manually specifying an appropriate OS for it to act like it is running on. This is done by taking the following steps, alternatively you can upgrade to VCE 4.0.

1). Open C:\Users\Public\Micro Focus\Visual COBOL\eclipse\eclipse.ini

2) Add the following to the bottom of the file

-Dos.name=Windows Server 2015 R2 

3) Save the file and then reload eclipse

Viewing all 214 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>