Quantcast
Channel: Net Express/Server Express Knowledge Base
Viewing all 42 articles
Browse latest View live

Error: "FS077-S A Fileshare Server of the same name has already been defined"

$
0
0
Current Revision posted to Net Express/Server Express Knowledge Base by Dan.Wright on 11/1/2016 2:20:16 PM

Problem:


Error when starting a Fileshare Server: "FS077-S A Fileshare Server of the same name has already been defined"

Resolution:

The end-user was trying to start more than one Fileshare Server having the same name, though on different machines.  They were running ccitcp2 processes on each machine, and were not setting the CCITCP2 environment variable on any machine.  This conflicts with the design intention of Fileshare and CCITCP2.  The ccitcp2 process is a registration process, similar to a nameserver, and the intention is that just one machine in the network will run the registration process and act as the nameserver, while on all other machines, the environment variable CCITCP2 will be set to the name of the machine where the ccitcp2 process is running, so all machines will use one registration process.

When the CCITCP2 environment variable is not set, the assumption is that the ccitcp2 process running on the local machine is the intended registration process for the whole network.  By starting a ccitcp2 process on multiple machines, the end-user was establishing multiple and potentially conflicting registration processes on the network.

Under prior versions of Server Express, when the ccitcp2 process was named exactly "ccitcp2", this approach worked, and they could have multiple Fileshare servers of the same name on the network, but in recent versions of Server Express, the mfds32 process takes the role of the ccitcp2 process, and mfds is smart enough to look across the network and see occasions when a user tries to start a fileshare server having the same name as a fileshare server already started.

The solution in modern versions of Server Express, when using mfds as the ccitcp2 process, is to use unique names for all Fileshare Servers.


Installing or upgrading Server Express or Server for COBOL on Linux/UNIX

$
0
0
Revision 3 posted to Net Express/Server Express Knowledge Base by Dan.Wright on 2/2/2017 5:10:56 AM

Problem:

I am responsible for installing or upgrading Server Express or Server for COBOL on Linux or UNIX. Where can I find general instructions and considerations on this subject?

Solution:

Here are general instructions and considerations for installing or upgrading Server Express or Server for COBOL on Linux/UNIX.

The product named Server Express is the main product. It includes both the compiler and the runtime system. The product named Server for COBOL does not include the compiler; it includes only the runtime system. Think of Server for COBOL as a sub-set of Server Express.

In early versions, the product Server for COBOL was named differently; it was named "Application Server for Server Express", or "Micro Focus Server".  Server for COBOL is meant for installation on production machines that will be used only for running COBOL applications, not for compiling. Sometimes application designers want to prevent people from compiling on production machines; they want to make certain that COBOL code can be compiled only on development machines. By installing Server for COBOL on a machine, a person can be assured the compiler is not present.

Because Server Express includes both the compiler and the runtime system, it can be used for development, production, or both. When Server Express is installed on a machine, it is not necessary also to install Server for COBOL on the same machine. On a machine having Server Express installed, both types of license can be installed: Server Express licenses (a.k.a. development licenses) and Server for COBOL licenses (a.k.a. runtime licenses). In this way a single installation of Server Express can be licensed both for development and production.

Log into supportline.microfocus.com with your username and password. Click Product Updates on the left. Click "Search all updates available to you" and click "Find Updates".

Put a checkmark in the legal box, so the links will no longer be grayed-out, then navigate to Server Express or Server for COBOL (may not be on the first page).

Click the + sign to expand Server Express or Server for COBOL, then see a bunch of + signs for each 5.1 release. Click the + sign next to the latest 5.1 release (WrapPack 14 as of this writing) to expand it. If you do not intend to upgrade to the latest release, then choose the release you like.

Then click the + sign to expand the appropriate platform (AIX, Red Hat, etc).

There is a green down-arrow link to download the product. There is also a blue link named Readme. The Readme is a PDF with the Release Notes and installation instructions. Download both the product installable file and the Readme.

Server Express version 5.1 WrapPacks are stand-alone full installations (in other words, they don't install "on top of" existing installations). The instructions say:

1. On the target system, log in as root.

2. Create the directory into which you want to install the product.
For example:

mkdir /opt/microfocus/cobol

3. Decompress and extract the contents of the tar file into that
directory. For example:

cd /opt/microfocus/cobol

tar xvf /tmpdir/<web_download_file>.tar

4. Run the install script in that directory:

sh ./install

5. Follow the instructions displayed to complete the installation.

When upgrading an older version of Server Express or Server for COBOL on the same machine, there are two approaches:

1) Install the new version in the location where the older version was, by first re-naming the old directory. For example, if you have Server Express 5.1 WP8 installed in /opt/microfocus/cobol, then with root permissions:

mv /opt/microfocus/cobol /opt/microfocus/cobol_SX51_WP8

to re-name the existing directory, then follow the steps 1 through 5 above, including "mkdir /opt/microfocus/cobol". This will install the new version where the old one was, while keeping the old one backed-up in an appropriately-named directory. As an alternative:

2) Install the new version into a new and separate directory, then use environment variables to switch between the old and new, as described in this Knowledgebase article:

http://community.microfocus.com/microfocus/mainframe_solutions/enterprise_server/w/knowledge_base/18129.using-more-than-one-version-of-server-express-on-the-same-machine.aspx

If you already had Server Express or Server for COBOL licenses on the machine, the upgraded version will use the same existing licenses, so you will not need to install new licenses.

If you are installing Server Express or Server for COBOL for the first time on a machine, and there are no prior installations and no installed licenses, you will have to order licenses for that machine, or remove licenses from another of your machines and install the licenses on the new machine. If you need a period of time when both the old and new machines must run until a migration is complete, contact your Micro Focus Sales representative and order temporary licenses for the migration. Install the temporary licenses on the new machine. When the migration is complete and the old machine is decommissioned, remove the original licenses from the old machine and install them on the new machine. At that point you need not remove the temporary licenses from the new machine; you can leave them installed and allow them to time-out.

The licensing systems are documented within the overall Server Express documentation. Begin at this page:

https://supportline.microfocus.com/documentation/books/sx51ws02/sx51indx.htm

then look under Bookshelf > Start Here > Development System Licensing Guide

and also Bookshelf > Micro Focus Server > Deployment License Management Guide

If you encounter a problem with either of these licensing systems, go to the web site:

http://community.microfocus.com/microfocus

and enter symptoms of the problem in the Search field at upper-right to discover pertinent knowledgebase articles.  If knowledgebase articles do not help, log into supportline.microfocus.com with your username and password, and create a new Support Incident describing the licensing problem.

WrapPacks are inclusive, that is, each WrapPack includes everything that the prior WrapPacks did, so to upgrade to a particular WrapPack, it is not necessary to install all prior WrapPacks first.

The Readme.PDFs that accompany each WrapPack are also inclusive, so it is not necessary to read each of the Readmes in series, but only to read the latest one.

When adopting a new version of Micro Focus COBOL, the COBOL source code for the application must be recompiled using the new version. Compiled COBOL programs must be run under the same version of Micro Focus as was used to compile them. For example, to run under WrapPack 14, the COBOL modules must have been compiled under WrapPack 14.

Generally speaking, you need not worry that the new version of MF COBOL will introduce new and different behavior, or "break" the application. The COBOL language is governed by standards including the ANSI standard. Each release of MF COBOL, including each WrapPack, successfully passes QA certification tests, such as the US government's COBOL Compiler Validation Suite (CCVS), plus a regression test suite, before being released. Micro Focus hasn't intentionally changed the behavior of the COBOL compiler or runtime, except to fix bugs or add new features. You can expect the application to behave as it did before, after you recompile the COBOL sources under the new version. If any problems occur, log into supportline.microfocus.com and open a support incident, or call 800-632-6265 and have the serial number of your licensed product to hand during the call.

During installation, you may see the message:

Your Enterprise Server requires configuration. You can either do it now
or later. To do it now you need to know the alphanumeric user ID of the
Enterprise Server System Administrator.
To do it later, enter the following commands whilst logged in as root :
/opt/microfocus/cobol/bin/eslminstall
/opt/microfocus/cobol/bin/casperm

Do you wish to configure Enterprise Server now? (y/n):

Enterprise Server is an optional feature allowing COBOL programs to be deployed as Web Services. Relatively few Server Express customers use Enterprise Server. Answer "n" to this question unless you know that your application needs Enterprise Server. As the message says, you can go back and configure it later if necessary. If you answer "y", it will demand that you enter a user-id. Refer to this knowledgebase article:

http://community.microfocus.com/microfocus/mainframe_solutions/enterprise_server/w/knowledge_base/6287.what-user-id-to-use-for-enterprise-server-administration.aspx

During installation, you may see the following message:

A possibly older version of License Manager than this one is currently running
on the system. It is installed in [location]

It is recommended that you upgrade by installing this version. Existing
installed licenses will be retained and not affected. If you want to install
this new version of License Manager into [location], then the currently running
version must be stopped.

Do you want to proceed with installation into [location]

(this will STOP the currently running License Manager) ? (y/n)

You may not see this message.  But if you do, it is important to answer "y" for "yes" so the LMF version will be updated. Existing licenses will not be lost or changed. After the installation, remember to re-start the license manager using the 'mflmman' command. If you answer "n", later you may receive this message:

LMF 006 You are not licensed to use this product or version

For a remedy to this LMF 006 error, see the following knowledgebase article:

http://community.microfocus.com/microfocus/licensing/w/knowledge_base/19282.checklist-for-unix-license-manager-issues.aspx

The application developers, for example the COBOL developers within your own company, or COBOL developers at the vendor from whom you purchased an application, are responsible for configuring the COBOL product, and you should follow their advice in configuring the new version.

Custom settings for Micro Focus compiler directives in an old version might accidentally be left behind when switching to a new version. Consider this Knowledgebase article:

http://community.microfocus.com/microfocus/cobol/net_express__server_express/w/knowledge_base/19285.setting-compiler-directives-for-server-express.aspx

Compiler directives are a way to configure the compiler's behavior. There are several different ways to specify compiler directives. If you originally used any of the first three methods in the Knowledgebase article, these might be accidentally left behind when switching to a new version.

If a file named 'cobol.dir' exists in the current directory at compile time, compiler directives in that file will be acted upon. Same for a file named 'cobol.dir' in the $COBDIR directory (as opposed to the current directory). If these files exist in an old version of MF COBOL, remember to copy them to the new version.

Likewise, customized directives might have been specified in the old version in the file $COBDIR/etc/cobopt. A fresh install of Server Express will contain only default specifications in $COBDIR/etc/cobopt. If you made customized specifications in $COBDIR/etc/cobopt in the old version, remember to copy that file into the new $COBDIR. Also, the environment variable COBOPT can specify directives; if COBOPT is used, make sure both the old and new MF installation have a matching value of the COBOPT environment variable.

After installing and licensing Server Express, here is a method you can use to prove that COBOL can be compiled and run successfully:

http://community.microfocus.com/microfocus/cobol/net_express__server_express/w/knowledge_base/1589.what-is-a-quick-way-to-test-whether-server-express-can-compile-and-run.aspx

Invoke a UNIX command from within COBOL using CALL "SYSTEM" and retrieve return code

$
0
0
Revision 2 posted to Net Express/Server Express Knowledge Base by Dan.Wright on 2/8/2017 5:25:53 PM

This article explains how to invoke a UNIX command from within COBOL using CALL “SYSTEM” and retrieve the return code of the command.

Problem:

Micro Focus Server Express or Visual COBOL provides a way for UNIX commands to be issued from within COBOL. This is done by calling a routine named SYSTEM. Individual UNIX commands such as "ls" or "pwd" can be invoked, or entire shell scripts or executable programs can be invoked. How can the return code from the UNIX command be retrieved and communicated back to COBOL?

Resolution:

Here is an example of the COBOL syntax for invoking a UNIX command:


CALL "SYSTEM" USING CMD-LINE.

"SYSTEM" (uppercase) preserves the COBOL screen and state of the terminal, then calls the UNIX system() routine, then afterwards restores the COBOL screen and terminal. For more information about "system", see the system(3) man page. It is possible to call "system" (lowercase) from COBOL, but then the COBOL screen would not be preserved, and might be corrupted.

To pass data back to COBOL from a UNIX command, have the command write the data to a file, then have COBOL read the file. For example, CALL "SYSTEM" with the command "ls -l >lsout.txt", and then program COBOL to open "lsout.txt" as a line sequential file and read the file line by line.

COBOL can retrieve the return code from the UNIX command. However, this is not simply the RETURN-CODE special register, or the optional RETURNING clause of the CALL statement; instead it is embedded in an individual byte within these values, and must be extracted. Here is example code:


--------- file "test.sh" --------
echo "Now executing test.sh"
echo "enter return code"
read rtncode
exit $rtncode

--------- file "callsys.cbl" -------
000001 working-storage section.
000002 01 return-code-ws pic s9(8) comp-5.
000003 01 filler redefines return-code-ws.
000004 $if little-endian defined
000005 05 filler pic x.
000006 05 high-order-byte pic s9 comp-5.
000007 05 filler pic x.
000008 05 low-order-byte pic s9 comp-5.
000009 $else
000010 05 filler pic xx.
000011 05 high-order-byte pic s9 comp-5.
000012 05 low-order-byte pic s9 comp-5.
000013 $end
000014 01 null-terminated-command.
000015 05 command pic x(2048).
000016 05 filler pic x value x"00".
000017 01 done-flag pic x value "n".
000018 88 done value "y".
000019 procedure division.
000020 perform get-user-input
000021 perform until done
000022 call "SYSTEM" using null-terminated-command
000023 returning return-code-ws
000024 if low-order-byte = 0
000025 display "return code from shell is: ",
000026 high-order-byte
000027 end-if
000028 perform get-user-input
000029 end-perform.
000030 stop run.
000031
000032 get-user-input.
000033 display spaces
000034 display "Enter command to be executed by shell"
000035 display " (enter 'done' to quit)"
000036 accept command
000037 if command = "done" move "y" to done-flag.

The program asks the user to enter a command. Then it calls "SYSTEM" using this command, and displays the return code. If you enter a fundamental command like "ls -l", you will see the command's output and a return code of +000. If you try "exit 6", COBOL will report that the shell exited with return code +006.

Try the command "sh test.sh" (which runs the example script above). The script prompts for a return code. Enter an integer between 0 and 127. The script will exit with that value, then the COBOL program will display it. This demonstrates that COBOL can get the return code from a script.

The return code is affected by the byte order on the platform. AIX, Solaris, HP/UX PARISC and HP/UX Itanium are "big-endian". HP/Tru64, Linux, SCO, and UnixWare are "little-endian". To handle these differences, this program uses "conditional compilation" with $if, $else, and $end statements (similar to #ifdef statements in the C preprocessor). When compiling this program on a little-endian platform, define a constant like this:


cob -C 'constant little-endian "yes"' callsys.cbl

Note that single quotes enclose the entire compile option, and double quotes surround the "yes" value.

As an alternative, insert a 78-level item in working-storage prior to the $if:


78 little-endian value "yes".

For big-endian platforms, no special options are necessary -- you can compile the program like this:


cob callsys.cbl

The program has been tested successfully using Server Express 2.x, 4.x, and 5.x, and also with Object COBOL Developer Suite version 4.x.

The program is based on macros in the system header file <sys/wait.h>. See the wstat(5) man page for more information. A call to system() actually involves two return codes: one from the invoked command and one from the system() routine itself. The conventional UNIX behavior, when system() completes normally, is to embed the command's return code in the high-order bytes of the return code from system(). By studying the macros in <sys/wait.h>, a person could write code so COBOL could additionally recognize occasions when the command was terminated by a signal, and if so exactly which signal was received.

 

Old KB# 14406

File OPEN fails with RTS 114 in 64-bit

$
0
0
Current Revision posted to Net Express/Server Express Knowledge Base by Fano_MF on 3/16/2017 9:33:19 PM

Problem:

The file OPEN fails with the following error only when the program is compiled in 64-bit:

Execution of the program EXTSM has been interrupted. This program is not animatable, but you can view the call/perform stack.
The cause of the interrupt was: 114   Attempt to access item beyond bounds of memory
(Signal 11)

There is no issue with the file OPEN when it is compiled in 32-bit.

Resolution:

This problem occurs when the program is compiled in 64-bit with the NOFCD3 directive.

When setting the "64 Bit" check box from the Project Properties or when using the P64 directive to compile in 64-bit, the FCD3 directive is required and set automatically. The default when compiling in 32-bit is NOFCD3.

This directive is reserved for internal use by the COBOL system and should not be set or overridden.

The resolution is then to remove or avoid setting the NOFCD3 directive.

How to set up SSL-secured access to MFDS and the ES Administration web page

$
0
0
Revision 1 posted to Net Express/Server Express Knowledge Base by Dan.Wright on 4/28/2017 10:42:47 PM

Problem:

MFDS acts as a web server and displays the Enterprise Server Administraion web page.  By default it is not set up for SSL secure access using https:.  How can a person set up SSL-secured access to MFDS from a local or remote browser without the browser showing a certificate error?

Solution:

A demonstration Certificate Authority is provided with the product for practice and proof of concept in setting up secure connections.  After the concept is proven, end-users can design their own PKI (Public Key Infrastructure) and begin using an official CA in place of DemoCA.  See the following link into the documentation, named "SSL and PKI Technology Primer":

http://documentation.microfocus.com/help/topic/com.microfocus.eclipse.infocenter.visualcobol.eclipseux/GUID-7B2327C6-A987-49E1-B04C-10FBEE9CB5E3.html


Step 1:

Install DemoCA on the machine that will run Enterprise Server and MFDS.

For Windows machines, installation of DemoCA is documented here:

http://documentation.microfocus.com/help/topic/com.microfocus.eclipse.infocenter.visualcobol.vs2013/BKCKCKINTRS002.html

For Linux/UNIX machines, installation of DemoCA is documented here:

http://documentation.microfocus.com/help/topic/com.microfocus.eclipse.infocenter.visualcobol.eclipseux/BKCKCKINTRS002.html

Note: on Linux/UNIX the script "DemoCA_Setup.sh" must be run as root.  Environment variables COBDIR and OPENSSL_CONF must be set before running DemoCA_Setup.sh.  Set COBDIR to the location where the Micro Focus product is installed, for example:

COBDIR=/opt/microfocus/VisualCOBOL
export COBDIR

(substitute the actual location if different than above).

Set OPENSSL_CONF to $COBDIR/DemoCA before running DemoCA_Setup.sh.  Enter:

OPENSSL_CONF=$COBDIR/DemoCA
export OPENSSL_CONF

During installation on either Linux/UNIX or Windows, you will be asked to specify the Common Name (CN).  Specify the fully-qualified domain name (FQDN) of your machine (this may already appear as the default value).  For example, enter "server1.yourcompany.com".  Later when accessing the secure ES Admin web page you will have to use a URL that includes the FQDN.


Step 2:

Modify the file openssl.cnf in the DemoCA install directory, changing this line:

default_md       = md5

to this:

default_md       = sha256

On Windows, use Administrator privileges to modify the file.  For example, run Notepad as Administrator.  On Linux/UNIX, use root privileges and an editor such as vi.


Step 3:

Run the re-install script.

On Linux/UNIX this is named reinstall_DemoCA.sh in the directory where DemoCA was installed.  Before running, set environment variables OPENSSL_CONF and SSLDIR to the directory where DemoCA was installed.  Run as root with COBDIR set to where the Micro Focus product was installed.

On Windows, run CMD (a command prompt) as Administrator.  Change to the folder where DemoCA was installed.  Set the environment variable OPENSSL_CONF to the file openssl.cnf, for example:

set OPENSSL_CONF=C:\Program Files (x86)\Micro Focus\DemoCA\openssl.cnf

Then run "reinstall_demoCA.cmd".

When the screen says:

writing new private key to 'private\CAkey.pem'
Enter PEM pass phrase:

Enter a phrase that you would remember, such as "srvrootpwd".


Step 4:

Run the "create_srv_req" script

On Windows, this is create_srv_req.cmd.  Run with Administrator privileges.

On Linux/UNIX, the script is "create_srv_req.sh".  Run with COBDIR, OPENSSL_CONF, and SSLDIR set as above.

When the script asks:

Enter PEM pass phrase:

enter srvrootpwd.  On Windows, accept all the defaults for the Distinguished name.  Make sure the Common Name specifies the fully-qualified domain name.  You do not need to specify a challenge password.


Step 5:

Run the "sign_srv" script.

On Windows, this is "sign_srv.cmd".  On Linux/UNIX it is "sign_srv.sh"

If prompted for a passphrase, enter srvrootpwd


Step 6:

Access the ES Admin page using the URL http://<FQDN>:86, where FQDN is the Fully-Qualified Domain Name of the machine running MFDS.

Configure MF Directory Server security with "Restrict administration access" and "Use encrypted connections".

Specify a port number of your choosing.

Select "Use custom server ID certificate".

For Certificate, enter the full path and filename of the file srvcert.pem.  For example, on Windows:

C:\Program Files (x86)\Micro Focus\DemoCA\srvcert.pem

Or for example on Linux/UNIX:

/opt/microfocus/DemoCA/srvcert.prm

depending on where DemoCA was installed.

For Certificate passphrase: leave blank

For Keyfile: enter the full path and filename of the file srvkey.pem

For Keyfile passphrase:  enter srvrootpwd

Press Apply or OK.

The screen will say: "(Specified SSL options pending...Directory Server restart required)". The secure options will go into effect when MFDS is re-started.


Step 7:

Set the environment variables MF_ROOT_CERT and MFDS_DNS_RESOLVE before re-starting MFDS

On Windows, establish these environment variables at the system level.  For example with Windows 7, use Control Panel > System and Security > System > Advanced System Settings > Environment variables:

MF_ROOT_CERT=C:\Program Files (x86)\Micro Focus\DemoCA\private\CArootcert.pem

(or the path to wherever DemoCA was installed)

MFDS_DNS_RESOLVE=Y

On Linux/UNIX, $COBDIR/bin/mfds is a shell script.  Modify this script adding MF_ROOT_CERT and MFDS_DNS_RESOLVE=Y, for example:

MF_ROOT_CERT=/opt/microfocus/DemoCA/private/CARootcert.pem
export MF_ROOT_CERT

MFDS_DNS_RESOLVE=Y
export MFDS_DNS_RESOLVE


Step 8:

Re-start MFDS so it picks up the environment variables.

On Windows, stop and re-start the MFDS service.  The service is named mf_ccitcp2 and the description is "Micro Focus Directory Server".  You can start and stop using Control Panel > Administrative Tools > View local services, or from a CMD prompt with Administrator privileges:

net stop mf_ccitcp2
net start mf_ccitcp2

On Linux/UNIX, with root credentials, set the COBDIR environment variable to the install location of the MF product, for example:

COBDIR=/opt/microfocus/VisualCOBOL
export COBDIR

(where /opt/microfocus/VisualCOBOL is the place you installed Visual COBOL).

Invoke $COBDIR/bin/mfds -s  to stop MFDS.

Invoke $COBDIR/bin/mfds to re-start MFDS


Step 9:

Configure a browser, either local or remote, by importing CArootcert.pem from DemoCA as a Trusted Root Certificate Authority.  You can use FTP to transfer CArootcert.pem to the machine where the browser is running.  CArootcert.pem is in the "private" sub-folder of the DemoCA install directory.  So on Windows, typically:

C:\Program Files (x86)\Micro Focus\DemoCA\private\CArootcert.pem.

On Linux/UNIX, CArootcert.pem is typically:

/opt/microfocus/DemoCA/private/CARootcert.pem


Step 10:

Access the ES Admin page with the URL:

http://<FQDN>:86


Step 11: Click "Log On".  MFDS changes the URL to:

https://<FQDN>:<secure port>/?page_000?action_LOGON

Since MF Directory Server security was configured with "Restrict administration access", MFDS will require a login and password.  Until you configure the credentials differently, by default the credentials are:

User: SYSAD
Password: SYSAD

At that point, verify that you have access to the ES Administration screen, that the URL begins with https:, and that the browser shows no certificate error.

 

Successfully using DemoCA proves the concept, and shows that MFDS behaves correctly as a web server should behave, that is, MFDS cooperates with browsers such as Internet Explorer, Firefox, and Chrome in securing web connections.  In other words, MFDS does not have a bug in this area.  At that point you are free to establish your company's security policies and design your own PKI.  DemoCA is not meant for use in production situations.  See this documentation link named "Is the Demonstration CA a Real CA?":

http://documentation.microfocus.com/help/topic/com.microfocus.eclipse.infocenter.enterprisedeveloper.eclipsewin/BKCKCKDECAUREA.html

See also this documentation link named "Designing a PKI":

http://documentation.microfocus.com/help/topic/com.microfocus.eclipse.infocenter.enterprisedeveloper.eclipsewin/BKCJCJDESI.html

 

 

Installing or upgrading Server Express or Server for COBOL on Linux/UNIX

$
0
0
Current Revision posted to Net Express/Server Express Knowledge Base by Dan.Wright on 6/13/2017 4:32:26 AM

Problem:

I am responsible for installing or upgrading Server Express or Server for COBOL on Linux or UNIX. Where can I find general instructions and considerations for this?

Solution:

Here are general instructions and considerations for installing or upgrading Server Express or Server for COBOL on Linux/UNIX.

The product named "Server Express" is the main product.  It includes both the compiler and the runtime system.  The product named "Server for COBOL" includes only the runtime system.  Think of "Server for COBOL" as a sub-set of "Server Express".

In early versions, the product "Server for COBOL" was named differently; it was named "Application Server for Server Express" or "Micro Focus Server".

Server for COBOL is meant to be installed on production machines where COBOL will run, but where COBOL should never be compiled.  System administrators may want to prevent people from compiling COBOL on production machines.  By installing Server for COBOL on a machine, a person can be assured the compiler is not present.  This is the reason Micro Focus distributes the Server for COBOL product separately.

Because Server Express includes both the compiler and the runtime system, it can be used for development, production, or both.  When Server Express is installed on a machine, it is not necessary to install Server for COBOL on the same machine.  On a machine with Server Express installed, both types of license can be installed: development licenses and runtime licenses.  In this way a single installation of Server Express can be licensed both for development and production.

Log into supportline.microfocus.com with your username and password.  Click Product Updates on the left. Click "Search all updates available to you" and click "Find Updates".

Put a checkmark in the legal box, so the links will no longer be grayed-out, then navigate to Server Express or Server for COBOL (may not be on the first page).

Click the + sign to expand Server Express or Server for COBOL, then see a bunch of + signs for each 5.1 release. Click the + sign next to the latest 5.1 release (WrapPack 14 as of this writing) to expand it.  If you do not intend to upgrade to the latest release, then choose the release you like.

Then click the + sign to expand the appropriate platform (AIX, Red Hat, etc).

There is a green down-arrow link to download the installable product.  There is also a blue link named Readme.  The Readme is a PDF with the Release Notes and installation instructions.  Download both the installable product and the Readme.

Server Express version 5.1 WrapPacks are stand-alone full installations (in other words, they don't install "on top of" existing installations).  The instructions inside the Readme say:

1. On the target system, log in as root.

2. Create the directory into which you want to install the product.
For example:

mkdir /opt/microfocus/cobol

3. Decompress and extract the contents of the tar file into that
directory. For example:

cd /opt/microfocus/cobol

tar xvf /tmpdir/<web_download_file>.tar

4. Run the install script in that directory:

sh ./install

5. Follow the instructions displayed to complete the installation.

When upgrading an older version of Server Express or Server for COBOL on the same machine, there are two approaches:

1) Install the new version in the location where the older version was, by first re-naming the old directory.  For example, if you have Server Express 5.1 WP8 installed in /opt/microfocus/cobol, then with root permissions:

mv  /opt/microfocus/cobol  /opt/microfocus/cobol_SX51_WP8

to re-name the existing directory, then follow the steps 1 through 5 above, including "mkdir /opt/microfocus/cobol".  This will install the new version where the old one was, while keeping the old one backed-up in an appropriately-named directory.  The advantage of this approach is that it requires no change to .profiles or login scripts that set COBDIR and other environment variables for users.  As an alternative:

2) Install the new version into a new and separate directory, then use environment variables to switch between the old and new, as described in this Knowledgebase article:

http://community.microfocus.com/microfocus/mainframe_solutions/enterprise_server/w/knowledge_base/18129.using-more-than-one-version-of-server-express-on-the-same-machine.aspx

If you already had Server Express or Server for COBOL licenses on the machine, the upgraded version will use the same existing licenses, so you will not need to install new licenses.

If you are installing Server Express or Server for COBOL for the first time on a machine, and there are no prior installations and no installed licenses, you will have to order licenses for that machine, or remove licenses from another of your machines and install the licenses on the new machine.  If you need a period of time when both the old and new machines must run until a migration is complete, contact your Micro Focus Sales representative and order temporary licenses for the migration.  Install the temporary licenses on the new machine.  When the migration is complete and the old machine is decommissioned, remove the original licenses from the old machine and install them on the new machine.  At that point you need not remove the temporary licenses from the new machine; you can leave them installed and allow them to time-out.

The licensing systems are documented within the overall Server Express documentation. Begin at this page:

https://supportline.microfocus.com/documentation/books/sx51ws02/sx51indx.htm

then look under Bookshelf > Start Here > Development System Licensing Guide

and also Bookshelf > Micro Focus Server > Deployment License Management Guide

If you encounter a problem with either of these licensing systems, go to the web site:

http://community.microfocus.com/microfocus

and enter symptoms of the problem in the Search field at upper-right to discover pertinent knowledgebase articles.  If knowledgebase articles do not help, log into supportline.microfocus.com with your username and password, and create a new Support Incident describing the licensing problem.

WrapPacks are inclusive, that is, each WrapPack includes everything that the prior WrapPacks did, so to upgrade to a particular WrapPack, it is not necessary to install all prior WrapPacks first.

The Readme.PDFs that accompany each WrapPack are also inclusive, so it is not necessary to read each of the Readmes in series, but only to read the latest one.

When adopting a new version of Micro Focus COBOL, the COBOL source code for the application must be recompiled using the new version.  Compiled COBOL programs must be run under the same version of Micro Focus as was used to compile them.  For example, to run under WrapPack 14, the COBOL programs must have been compiled under WrapPack 14.

Generally speaking, you need not worry that the new version of MF COBOL will introduce new and different behavior, or "break" the application.  The COBOL language is governed by standards including the ANSI standard. Each release of MF COBOL, including each WrapPack, successfully passes QA certification tests, such as the US government's COBOL Compiler Validation Suite (CCVS), plus a regression test suite, before being released.  Micro Focus hasn't intentionally changed the behavior of the COBOL compiler or runtime, except to fix bugs or add new features.  You can expect the application to behave as it did before, after you recompile the COBOL sources under the new version.  If any problems occur, log into supportline.microfocus.com and open a support incident, or call 800-632-6265 and have the serial number of your licensed product to hand during the call.

During installation, you may see the message:

Your Enterprise Server requires configuration. You can either do it now
or later. To do it now you need to know the alphanumeric user ID of the
Enterprise Server System Administrator.
To do it later, enter the following commands whilst logged in as root :
/opt/microfocus/cobol/bin/eslminstall
/opt/microfocus/cobol/bin/casperm

Do you wish to configure Enterprise Server now? (y/n):

Enterprise Server is an optional feature allowing COBOL programs to be deployed as Web Services.  Relatively few Server Express customers use Enterprise Server.  Answer "n" to this question unless you know that your application needs Enterprise Server.  As the message says, you can go back and configure it later if necessary.  If you answer "y", it will demand that you enter a user-id.  Refer to this knowledgebase article:

http://community.microfocus.com/microfocus/mainframe_solutions/enterprise_server/w/knowledge_base/6287.what-user-id-to-use-for-enterprise-server-administration.aspx

During installation, you may see the following message:

A possibly older version of License Manager than this one is currently running
on the system. It is installed in [location]

It is recommended that you upgrade by installing this version. Existing
installed licenses will be retained and not affected. If you want to install
this new version of License Manager into [location], then the currently running
version must be stopped.

Do you want to proceed with installation into [location]

(this will STOP the currently running License Manager) ? (y/n)

You may not see this message.  But if you do, it is important to answer "y" for "yes" so the LMF version will be updated.  Existing licenses will not be lost or changed.  After the installation, remember to re-start the license manager using the 'mflmman' command.  If you answer "n", later you may receive this message:

LMF 006 You are not licensed to use this product or version

For a remedy to this LMF 006 error, see the following knowledgebase article:

http://community.microfocus.com/microfocus/licensing/w/knowledge_base/19282.checklist-for-unix-license-manager-issues.aspx

The application developers, for example the COBOL developers within your own company, or COBOL developers at the vendor from whom you purchased an application, are responsible for configuring the COBOL product, and you should follow their advice in configuring the new version.

Custom settings for Micro Focus compiler directives in an old version might accidentally be left behind when switching to a new version.  Consider this Knowledgebase article:

http://community.microfocus.com/microfocus/cobol/net_express__server_express/w/knowledge_base/19285.setting-compiler-directives-for-server-express.aspx

Compiler directives are a way to configure the compiler's behavior.  There are several different ways to specify compiler directives.  If you originally used any of the first three methods in the Knowledgebase article, these might be accidentally left behind when switching to a new version.

If a file named 'cobol.dir' exists in the current directory at compile time, compiler directives in that file will be acted upon.  Same for a file named 'cobol.dir' in the $COBDIR directory (as opposed to the current directory).  If these files exist in an old version of MF COBOL, remember to copy them to the new version.

Likewise, customized directives might have been specified in the old version in the file $COBDIR/etc/cobopt.  A fresh install of Server Express will contain only default specifications in $COBDIR/etc/cobopt.  If you made customized specifications in $COBDIR/etc/cobopt in the old version, remember to copy that file into the new $COBDIR.  Also, the environment variable COBOPT can specify directives; if COBOPT is used, make sure both the old and new MF installation have a matching value of the COBOPT environment variable.

After installing and licensing Server Express, here is a method you can use to prove that COBOL can be compiled and run successfully:

http://community.microfocus.com/microfocus/cobol/net_express__server_express/w/knowledge_base/1589.what-is-a-quick-way-to-test-whether-server-express-can-compile-and-run.aspx

Knowledge Base

$
0
0
Current Revision posted to Net Express/Server Express Knowledge Base by BrianMcCaughey on 2/7/2017 8:26:08 AM

Welcome to the Net Express/Server Express Knowledge Base. The Knowledge Base contains a large amount of information that may answer technical questions you may have. To take full advantage of the Knowledge Bases across the Community please use the site search found at the top of the page. This search offers a wide range of customisation to narrow down your search to find your article.  If you fail to find a solution here SupportLine will be able to assist you further.

Application fails to call WinHTTP with HTTPS

$
0
0
Current Revision posted to Net Express/Server Express Knowledge Base by Fano_MF on 10/19/2017 2:30:40 AM

Problem:

The same application that calls WinHTTP successfully with HTTP fails to work with HTTPS even if zero is returned (in ws-res on the example below):
INVOKE ws-winhttp "Open"
    USING z"POST"
          WS-CALL-HOST *> containing URL with HTTPS
          ws-boolfalse
    RETURNING ws-res

INVOKE ws-winhttp "Send"
    USING ws-vartext
    RETURNING ws-res

Solution:

There is no code change required.

As explained in the following Microsoft link, an update for Windows and setting up a registry key are required:
https://support.microsoft.com/en-gb/help/3140245/update-to-enable-tls-1.1-and-tls-1.2-as-a-default-secure-protocols-in-winhttp-in-windows

The program should work fine after adding DefaultSecureProtocols with the DWORD value of A00 in HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp

Tags: winHttp, Net Express

Accented characters in an HTML file, displayed through a COBOL program are not displaying correctly.

$
0
0
Revision 1 posted to Net Express/Server Express Knowledge Base by PeteH on 10/24/2017 10:17:05 AM

Problem

Accented characters in an HTML file, displayed through a COBOL program are not displaying correctly.


Resolution

The problem is that although the characters look fine in Ultra Edit or VI editor on UNIX, they are being mis-interpreted due to an incorrect setting of LANG (locale) environment variable.

Using the locale command, displayed the following environment variables..
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

As the accented characters are not UTF-8, there will always be display issues if the program is run with UTF8 locale.

The characters are displayed correctly as long as any xtem’s locale is set to iso88591 or iso885915  before you compile and run the program.

Use the command

export LANG=en_US.iso88591 or export LANG=en_US.iso885915

to set the correct locale.

Using the locale command, displayed the following environment variables..

LANG=en_US.iso88591
LC_CTYPE="en_US.iso88591"
LC_NUMERIC="en_US.iso88591"
LC_TIME="en_US.iso88591"
LC_COLLATE="en_US.iso88591"
LC_MONETARY="en_US.iso88591"
LC_MESSAGES="en_US.iso88591"
LC_PAPER="en_US.iso88591"
LC_NAME="en_US.iso88591"
LC_ADDRESS="en_US.iso88591"
LC_TELEPHONE="en_US.iso88591"
LC_MEASUREMENT="en_US.iso88591"
LC_IDENTIFICATION="en_US.iso88591"
LC_ALL=

or

LANG=en_US.iso885915
LC_CTYPE="en_US.iso885915"
LC_NUMERIC="en_US.iso885915"
LC_TIME="en_US.iso885915"
LC_COLLATE="en_US.iso885915"
LC_MONETARY="en_US.iso885915"
LC_MESSAGES="en_US.iso885915"
LC_PAPER="en_US.iso885915"
LC_NAME="en_US.iso885915"
LC_ADDRESS="en_US.iso885915"
LC_TELEPHONE="en_US.iso885915"
LC_MEASUREMENT="en_US.iso885915"
LC_IDENTIFICATION="en_US.iso885915"
LC_ALL=

These values are case sensitive.

Incident#3115402

Tags: visual cobol, UNIX, Enterprise Server, utf-8, Server Express

How to solve the problem - Application reports 114 out of bounds error on ADIS

$
0
0
Revision 1 posted to Net Express/Server Express Knowledge Base by PeteH on 10/24/2017 10:42:47 AM

Problem


How to solve the problem - Application reports 114 out of bounds error on ADIS


Resolution

The PC with the problem has a high resolution set to 1680 x 1050.


If the resolution is changed to 1490 x 900 the problem is fixed.

Alternatively if the resolution stays at 160 x 1050, if the font type in the SSH emulator is increased this also fixes the problem.

For example - font type = courier new 18 x 10 
This is increased to 21 x 11

This behaviour happens when using the EMTEC ZOC Emulator to conect to the server throught SSH.

 

 Incident#3110741

Tags: UNIX, SSH, EMTEC ZOC Emulator, Server Express

Can AppTrack functions be run in batch or from a script ?

$
0
0
Current Revision posted to Net Express/Server Express Knowledge Base by PeteH on 10/24/2017 3:35:00 PM

Problem


Can AppTrack functions be run in batch or from a script ?


Resolution

Using the command $COBDIR/aslmf/apptrack batch 3 <serialnumber> <licensekey> will install a license


Using the command $COBDIR/aslmf/apptrack batch 4 <serialnumber> <licensekey> will uninstall a license


Using the command $COBDIR/aslmf/apptrack batch 1 and $COBDIR/aslmf/apptrack batch 2 will produce AppTrack lists.

The lists can be piped to a file by adding > filename.ext

 

Incident#3102795

Tags: AppTrack, licensing, UNIX, Server Express

iso2000_dialect was used in Server express, is it needed in Visual Cobol ?

$
0
0
Current Revision posted to Net Express/Server Express Knowledge Base by PeteH on 10/24/2017 3:38:06 PM

Problem

iso2000_dialect was used in Server express, is it needed in Visual Cobol ?


Resolution

iso2000_direct was used in cob.cfg and cob64.cfg files.

It is not needed in Visual COBOL.


Incident#3119248

Tags: visual cobol, COB.CFG, Server Express

COBSQL/Pro*COBOL on Intel- /Alpha-based chips

$
0
0
Current Revision posted to Net Express/Server Express Knowledge Base by blairm on 10/25/2017 4:10:04 PM

This article addresses the use of COBSQL/Pro*COBOL on Intel-/Alpha-based chips.

Problem:

  • What are the byte ordering requirements for Pro*COBOL applications?
  • How should I compile a Pro*COBOL which also interacts with CICS?
  • Executing my Pro*COBOL application on Linux returns RTS114 against SQLBEX.
  • Executing my Pro*COBOL application on Windows returns RTS114 against SQLBEX.
  • How does the COBSQL MAKESYN option work?
  • How should I use the Pro*COBOL COMP5 option?

Resolution:

Note: For more background on building Pro*COBOL applications on UNIX platforms, please refer to this KB article:

https://community.microfocus.com/microfocus/cobol/net_express__server_express/w/wiki/20446.building-and-executing-pro-cobol-applications-on-unix.aspx

Pro*COBOL and Byte Ordering

The Oracle client expects host variables along with parameters to Oracle API calls -- as generated by Pro*COBOL in the same byte order, or endianness, of the operating system that it is running on.

  • Machines that store the integer value 2 as h"0002" are called big-endian machines.
  • Machines that store the integer value 2 as h"0200" are called little-endian machines.

Intel and Alpha platforms are little-endian. The problem for COBOL is that variables that are of type COMP are always big-endian regardless of operating system but Oracle expects data to be little-endian. On Intel/Alpha platforms, if the wrong byte ordering is used, this can lead to RTS114 errors.

Full details on this can be found in Oracle documents, which can be found under the Oracle Metalink site, under documents 70245.1, and 70012.1. You need to have Oracle maintenance support in order to view these documents.

In order to ensure that host variables are correctly ordered, you can use either the Pro*COBOL COMP5 directive, or the COBSQL MAKESYN directive ; note well, that this is not the same as the Checker MAKESYN directive!

Problems can occur when you specify particular combinations of COBSQL's MAKESYN and Pro*COBOL's COMP5 options, as they can prevent conversion of host variables -- e.g. COMP5=NO NOMAKESYN -- which would lead to an RTS114. See section 4 below for details of (in)valid combinations.

Pro*COBOL "COMP5" option

If COMP5=YES:

 

  • All data items defined as USAGE COMP are converted to USAGE COMP-5.
  • All data items generated by Pro*COBOL itself will be declared USAGE COMP-5.

If COMP5=NO:

 

  • The precompiler ignores host variables defined as USAGE COMP-5.
  • Precompiled files generally do not run on either Intel or Alpha platforms.

On relevant platforms, COMP5=YES is the default in Oracle 8.1.7 and later.

COBSQL MAKESYN directive

Scope of this directive

COBSQL relies on a BEGIN DECLARE SECTION and END DECLARE SECTION to be coded, in order to use the correct scope for updating the definition of data items listed below.

However, explicit coding of those section markers is optional for Pro*COBOL, as of the Oracle 8i release.

If these clauses do not exist, then COBSQL will not change any host variables from USAGE COMP to USAGE COMP-5, which will cause errors when executing your application.

To force the user to explicitly code the BEGIN/END DECLARE SECTION clauses -- required for COBSQL to function correctly -- you can pass DECLARE_SECTION=YES to Pro*COBOL.

 

  • If this option is passed, and all host variables are declared within those section markers, COBSQL will behave as expected.
  • If no such section markers are coded, Pro*COBOL will generate errors against any host variable referenced within the application.

What the directive does

COBSQL operation can be a little confusing as there are 3 scenarios:

 

  • Scenario 1: Default, i.e. neither MAKESYN nor NOMAKESYN are specified

    All data items, regardless of them being host variables or not, defined as either USAGE COMP or USAGE COMP-4 will be converted to USAGE COMP-5.

  • Scenario 2: MAKESYN specified

    All host variables defined as USAGE COMP will be converted to USAGE COMP-5.

  • Scenario 3: NOMAKESYN specified

    All data items are left as-is.

Valid/Invalid combinations for Intel/Alpha combinations

For Intel/Alpha platforms, the following table shows which combinations are and are not valid:

ORACLECOBSQLResult
Comp5=noNOMAKESYNInvalid
Comp5=yesNOMAKESYNValid
Comp5=noMAKESYNValid
Comp5=yesMAKESYNValid
Comp5=nono directive specifiedValid
Comp5=yesno directive specifiedValid
Comp5=noNot UsedInvalid1
Comp5=yesNot UsedValid

1 You must use compiler directive (MAKESYN "COMP-5" = "COMP") to make this work. See the section Using CICS and Oracle below.

 

Using CICS and Oracle

CICS and Enterprise Server MTO expect any numeric parameters on EXEC CICS calls to be defined as USAGE COMP. This can clash with the requirements of Oracle.

If using Pro*COBOL and CICS within the same application, on Intel-order machines, you should therefore pass these directives:

p(cobsql) MAKESYN CSQLT=ORACLE8 END-C DECLARE_SECTION=YES COMP5=NO ENDP

Using Pro*COBOL directly

If you are bypassing COBSQL and using the COBOL product to compile the output of an Oracle preprocessor, you must pass COMP-5 data items to all Oracle calls.

Old KB# 3957

9/194 "File size too large" on a sequential file -- checking that EXTFH is set correctly

$
0
0
Revision 1 posted to Net Express/Server Express Knowledge Base by Dan.Wright on 10/30/2017 8:59:37 PM

Problem:

File status 9/194 "File size too large" was reported against a sequential file.  The file size on disk was 7.5 gig.  The file handler configuration file included:

[XFH-DEFAULT]
FILEMAXSIZE=8

This FILEMAXSIZE=8 setting should allow the file handler to handle sequential files larger than 4 gig, but for some reason the error was still occuring.

Solution:

The environment variable EXTFH is supposed to point to the location of the file handler configuration file.   In the environment in which the application ran, EXTFH did appear to be set pointing to the correct file handler configuration file.   But when we added code to the COBOL program to reveal the run-time value of EXTFH, we learned that a script used to trigger the application had modified the value of EXTFH, so by the time the COBOL program was invoked, EXTFH was not set correctly.   Here is the technique used to reveal the run-time value of this environment variable:

Insert the following line of code at the top of the procedure division of the COBOL program, then re-compile the program:

 call "SYSTEM" using "sh extfh-check.sh" & x"00". 

Then create a file in the current working directory named extfh-check.sh, and insert this one line:

cat $EXTFH > extfh-out.txt 2>&1 

Then run the program.  Afterward, check the file on disk named extfh-out.txt.  In this case it showed that EXTFH was not set correctly.  After modifying the script used to trigger the application, so it set EXTFH correctly, the error 9/194 "File size too large" no longer appeared and the problem was solved.

Character Shift when moving cursor left/right in Data File Editor

$
0
0
Revision 1 posted to Net Express/Server Express Knowledge Base by blairm on 10/31/2017 1:06:36 AM

Problem:

When using the Data File Editor in Server Express, characters appear in the wrong columns and suddenly shift while scrolling sideways in a file

Resolution:

In some terminal emulators, certain byte values may not be printable in the current character set used. For example, in the terminal emulator Putty, the character set may be set to ISO 8859-1 West Europe, or similar. Changing the character set to UTF-8 will correct this problem, and allow Data File Editor to correctly display records containing this kind of binary data. In Putty, this setting is found under Window->Translation.


Projmake not handling project files from Net Express 3.1

$
0
0
Revision 2 posted to Net Express/Server Express Knowledge Base by Fano_MF on 4/20/2018 8:19:43 PM

Problem:

The Projmake utility in Net Express 5.1 does not handle Net Express 3.1 (.app) project files. Although it reports "Rebuild complete" for each build type and creates the build type folders (DEBUG and/or RELEASE), the compile and link did not actually take place, and no files were generated.

Here is what the output looks like:

S:\Test>projmake -buildall NX31.APP
Micro Focus Net Express - Project Make Utility - Version IDE_5-1-85
Copyright (C) Micro Focus IP Development Limited 1984-2011. All rights reserved.

Processing Generic Debug Build
Starting rebuild
Rebuild complete
Processing Generic Release Build
Starting rebuild
Rebuild complete

Resolution:

The Net Express 3.1 project file needs to be converted in Net Express 5.1. This is done by opening the project file in Net Express 5.1, which converts the file by creating a new .APP file and saving the old one with the .OLD extension. The new .APP file can then be used with the ProjMake utility in Net Express 5.1.

The above might not be an adequate workaround when there are 100+ projects to be converted.

Since there is no external command available to convert the old Net Express project files to the new version, a macro in AHK (see attached NXappConv.zip) was written and provided as is by Micro Focus Support to automate the load of project files in Net Express 5.1.

The macro loads all .APP files with Net Express 5.1, one after the other, in the current folder and subfolders.

(Please visit the site to view this file)

What is the equivalent of the Micro Focus wholock utility in Windows?

$
0
0
Current Revision posted to Net Express/Server Express Knowledge Base by Fano_MF on 4/21/2018 12:12:47 AM

Problem:

What is the equivalent of the wholock utility available on Linux/UNIX systems with Server Express and Visual COBOL in Windows?

The wholock utility is used on Linux/UNIX systems to report what process has a lock on a file.

Resolution:

The wholock utility is not available in Net Express and Visual COBOL on Windows, but there are equivalent third party tools, such as Process Explorer, Process Monitor, WhoLockMe, etc.

For instance, here are the steps to determine the process that has a lock on a file with Process Explorer, which is a free Microsoft utility:

  1. Launch Process Explorer

  2. Hit Ctrl+F (or select Find a Handle or DLL under the Find menu)

  3. Enter the full name or part of the name of the data file

  4. Click Search from the Search dialog

It should report the name of the process and its Process ID in the search result.

What is a quick way to test whether Server Express can compile and run?

$
0
0
Current Revision posted to Net Express/Server Express Knowledge Base by Dan.Wright on 6/27/2018 10:40:41 PM

Problem:

I've just installed COBOL for UNIX (i.e. Server Express) for the first time, or I've made changes to the installation or to the licensing.  What is a quick way to test whether Server Express can compile and run successfully?

Resolution:

Set the COBDIR environment variable to the Server Express location to be tested.  For example:

COBDIR=/opt/microfocus/cobol

export COBDIR

Your machine might have more than one installation of Server Express (an old and a new version) in different locations.  Decide which one you want to test, and set COBDIR to that location.

After COBDIR is set and exported, enter the following commands:

LD_LIBRARY_PATH=$COBDIR/lib

export LD_LIBRARY_PATH

    [On AIX, specify LIBPATH instead of LD_LIBRARY_PATH,

    and on HP/UX, specify SHLIB_PATH instead]

PATH=$COBDIR/bin:$PATH

export PATH

COBPATH=.

export COBPATH

Next, copy and paste the following six commands onto the command line:

mkdir /tmp/cob_test

cd $COBDIR/demo/debug

cp pi.cbl /tmp/cob_test

cd /tmp/cob_test

cob pi.cbl

cobrun pi

A calculation of the mathematical constant "pi" should appear.  If it does, you have proven that Server Express can successfully compile and run from that COBDIR location.  This means both your development licensing and runtime licensing is set up correctly.

If not, the error messages are diagnostic.  Take careful note of them, look them up in the Server Express documentation, or contact Supportline.

The Server Express documentation is available on the Micro Focus web site, for free and without requiring a login.  Go to www.microfocus.com and click Support --> Documentaion.

For completeness, here is a line-by-line description of the commands:

# mkdir /tmp/test

A temporary work directory is created (in UNIX, /tmp is a traditional scratch area).

# cd $COBDIR/demo/debug

Change directories to the demo/debug subdirectory of $COBDIR.

# cp pi.cbl /tmp/test

Copy "pi.cbl" (a COBOL demonstration program) to /tmp/test (because we should work in a scratch directory instead of modifying anything in $COBDIR/demo/debug)

# cd /tmp/test

cd to our scratch directory

# cob pi.cbl

Compile "pi.cbl" using the "cob" command.  This should return to the shell prompt with no output (indicating success), and should create "pi.int" and "pi.idy" in the current directory.

# cobrun pi

Run the program.  A calculation of the mathematical constant "pi" should appear.

Old KB# 2163

HTML splitter error 002

$
0
0
Current Revision posted to Net Express/Server Express Knowledge Base by Peter.Kalfsbeek on 9/26/2018 10:06:58 AM

Problem:

Compiling a CGI program produces the following error:

Server Express Embedded HTML Preprocessor
Version 5.1.0.2 Copyright (c) 1984-2008 Micro Focus (IP) Limited.
*  645P         copy 'mic1999.html'.
* 803-S*******************                                             (   0)**
**    Integrated preprocessor message
**    HTML splitter error 002

Resolution:

The HTML file being included in a COBOL Source cannot be marked with READ-ONLY attribute.  This is because if any line in the HTML file is too long to be processed by the checker, it will be modified by the HTML Splitter before feeding into the checker. Thus it has to be a writeable file.

This will be added to the documentation in wrappack 17.

C program to validate NFS locking ability

$
0
0
Revision 5 posted to Net Express/Server Express Knowledge Base by Dan.Wright on 10/9/2018 2:32:47 AM

For Server Express to work across NFS-mounted file systems, NFS must be configured to handle locks correctly. This C program tests the NFS configuration.

Problem:

NFS-mounted file systems may cause file access errors when used with Server Express. Problems may occur, not only at runtime involving indexed files and data files, but also when compiing or using the Animator.

When opening a file, even a flat ASCII file such as a COBOL source file (.cbl), Micro Focus uses the UNIX system call "fcntl" to establish a lock, preventing other processes or programs from opening the file for "exclusive" access.

NFS-mounted file systems are sometimes configured such that the UNIX system call "fcntl" does not work. This is not the fault of COBOL, though it can result in an error reported by the COBOL system.

Resolution:

The following C program tests whether an NFS-mounted file system is configured to handle locks and the UNIX system call "fcntl" correctly. The program can demonstrate the problem outside of COBOL, to show that the fault lies with NFS and not with COBOL. If this program reports an error, you must fix the NFS configuration before you can expect COBOL to work. If, instead, the program runs to completion without producing a message, the "fnctl" lock was successful, and NFS has passed this test.

Change directories (cd) to the NFS-mounted file system in question, then place this C program there in a file named 'nfs_lock.c'. Compile it with the command "make nfs_lock", and run it.

#include 
#include 
main()

{
    printf("nfs_lock2 program starting...\n");
    int fd , ret;
    struct flock strlock;
    printf("nfs_lock2 program attempting open...\n");
    fd = open("testfile", O_CREAT | O_RDWR , 0666 );

    if (fd == -1)
       {
        printf("FATAL ERROR: Could not open file\n");
        exit(-1);
       }
        /* Set a write lock on the first 1024 butes of the file.
             It doesn't matter that they don't actually exist yet. */

      printf("nfs_lock2 program attempting lock...\n");
      strlock.l_type = F_WRLCK;
      strlock.l_whence = 0;
      strlock.l_start = 0L;
      strlock.l_len = 1024L;
      ret = fcntl (fd, F_SETLK , &strlock);

     if (ret == -1)
        {
         printf("FATAL ERROR: Could not lock file\n");
         exit(-1);
        }

      printf("nfs_lock2 program attempting close...\n");
      ret = close( fd );
      if (ret == -1)
         {
          printf("FATAL ERROR: Could not close file\n");
          exit(-1);
         }
    printf("nfs_lock2 program exiting.\n");
}

Old KB# 14008
Tags: COBOL, ACUCOBOL, Net Express, RM/COBOL, Server Express
Viewing all 42 articles
Browse latest View live


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