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

Error while loading shared libraries

$
0
0
Current Revision posted to Net Express/Server Express Knowledge Base by PhillR on 4/16/2015 4:23:32 PM

Problem

When trying to install Micro Focus Server Express 5.1, the install program shows the following error:

Please confirm your understanding of the above reference environment
details (y/n): y
bin/cobconvstrtest: error while loading shared libraries: libgcc_s.so.1: wrong ELF class: ELFCLASS64.

Resolution

Even though the products are supported on 32 bit and 64 bit platforms the installer itself will still need a 32 bit C compiler. 

Install the 32 bit C compiler and the installation will then be possible.


Example of COBOL calling the 64-bit file handler xfhfcd3.cpy

$
0
0
Revision 2 posted to Net Express/Server Express Knowledge Base by MF_Fano on 7/1/2015 5:24:56 PM
Created On:  17 September 2010

Problem:

We are experiencing problems when calling the 64-bit file handler from COBOL.

Resolution:

Attached is a same program that will demonstrate how a COBOL program calls EXTFH 64-bit. 

Ensure you use xfhfcd3.cpy (not xfhfcd2.cpy or xfhfcd.cpy).  xfhfcd3.cpy is located in $COBDIR/cpylib.

Make certain you set FCD-VERSION = 1 as shown below. 
 

  FCD-VERSION = 0, is used for 32-bit only. 

If you notice the COBOL program refers to the External-File-Handler "FHREDIR".  The reason for this is that you can use this COBOL program with Fileshare.  If you are not using Fileshare, it will call EXTFH.
Incident #2457812
Old KB# 31733(Please visit the site to view this file)
Tags: 64-bit File Handler, xfhfcd3

Installation fails with Error 1606

$
0
0
Current Revision posted to Net Express/Server Express Knowledge Base by MF_Fano on 7/13/2015 1:26:18 PM

Problem:

Installation of Net Express or Server for COBOL fails with the following error after hitting Next from the Welcome screen:

"error 1606 Could not access network location \\MachineName\ShareName\FolderName"

Resolution:

It appears Microsoft Installer needs to validate the locations that are specified for the following registry keys before starting the actual installation:

  1. Personal
  2. My Music
  3. My Pictures
  4. My Video

These registry keys are found from HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders, and they need to point to a valid location.

Here are their respective value by default:

Personal%USERPROFILE%\Documents
My Music%USERPROFILE%\Music
My Pictures%USERPROFILE%\Pictures
My Video%USERPROFILE%\Videos

View environment variables while debugging

$
0
0
Current Revision posted to Net Express/Server Express Knowledge Base by MF_Fano on 7/15/2015 6:30:17 PM

Problem:

It is possible to set an environment variable from the system level or right before starting Net Express. How to view the environment variables that are set while debugging?

Resolution:

Here are the steps to view environment variables while debugging:
1. click Project> Properties
2. click Application under Environment section
3. click Import
4. click Import
5. view the environment variables and their respective values
6. click Cancel when done viewing
7. click Cancel to close Application Environment screen
8. click Cancel to close Project Properties screen

Event Viewer reports Event ID 1 from source cas0perf cannot be found

$
0
0
Current Revision posted to Net Express/Server Express Knowledge Base by MF_Fano on 10/26/2015 6:42:56 PM

Problem:

Although no application is failing, the following error is reported in Event Viewer:

Event Type: Error
Log Name: Micro Focus Server
Source: cas0perf
Date: 8/7/2013 1:50:22 PM
Event ID: 1
Task Category: (1)
Level: Error
Keywords: Classic
User: N/A
Computer: machine-name
Description:
The description for Event ID 1 from source cas0perf cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The information below was also included with the event:

Unable to retrieve registry info for - Active Servers

The message resource is present but the message is not found in the string/message table

Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
 <System>
  <Provider Name="cas0perf" />
  <EventID Qualifiers="16384">1</EventID>
  <Level>2</Level>
  <Task>1</Task>
  <Keywords>0x80000000000000</Keywords>
  <TimeCreated SystemTime="2013-08-07T18:50:22.000000000Z" />
  <EventRecordID>26316</EventRecordID>
  <Channel>Micro Focus Server</Channel>
  <Computer>machine-name</Computer>
  <Security />
 </System>
 <EventData>
  <Data>Unable to retrieve registry info for - Active Servers</Data>
 </EventData>
</Event>

Resolution:

The problem is caused by a missing Active Servers' registry entry.

There are a couple of work arounds:

  1. Any server can be started with the 'Allow Performance Monitoring' box checked under the general tab of a servers properties. When this server starts up, it will detect that there is no 'Active Servers' entry in the registry and create it. Once this registry entry has been created, the messages should no longer appear.
  2. If you have no intention of using performance counters for enterprise server then the following registry key can be removed:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Micro Focus Server
    This will prevent cas0perf.dll from being called by perfmon (or any other consumer)
  3. If you do not intend to use Enterprise Server at all, then you can simply uninstall it from Programs and Features or Add or Remove Programs where you need to:
    a. select Micro Focus Net Express 5.1
    b. click on Change
    c. click on Enterprise Server to mark the feature with a X, i.e "This feature will not be available"
    d. click OK to uninstall Enterprise Server and its related components

Current Users option in Apptrack is not working

$
0
0
Revision 1 posted to Net Express/Server Express Knowledge Base by Peter.Kalfsbeek on 11/6/2015 3:22:51 PM

Problem:

Trying to find out about the licenses being used currently within apptrack appears to not do anything when select 7 Current Users. How to make this work?

Resolution:

There is an apptrack.log file in /var/mfaslmf

This registers all licenses being used from apptrack

You can then do the following to find out more what process is using a license:

touch apptrack.log

cd $COBDIR/aslmf

./apptrack

7 Current Users

 

This will show the actual users and more importantly the process ID. You can then find out more regarding the process ID by using:

ps –eaf | grep ‘process ID’

"Auxiliary Trace Activation" disappears after reboot

$
0
0
Revision 1 posted to Net Express/Server Express Knowledge Base by Peter.Kalfsbeek on 11/6/2015 3:25:56 PM

Problem:

When activating the auxiliary trace it works as expected and runs for a while. Then all of a sudden without any changes to the system it is deactivated after a region restart. How can this be prevented from happening?

Resolution:

Stop the region, go into the region and click on diagnostics and enable the aux trace and click on OK.

Then start the region and both the aux trace on the admin page / diagnostics as well as control > ESMAC > control - aux trace should be enabled.

After a restart they should still be there selected.

Reserved word missing or incorrectly used

$
0
0
Current Revision posted to Net Express/Server Express Knowledge Base by Peter.Kalfsbeek on 11/6/2015 3:37:53 PM

Problem:

A simple compilation on an AIX machine causes an error:

cob64 -C nolist -v -C LIST() tictac.cbl

* Micro Focus Server Express         V5.1 revision 000           Compiler

* Copyright (C) Micro Focus IP Development Limited 1984-2015.

* Accepted - verbose

* Accepted - nolist

* Accepted - LIST()

* Compiling tictac.cbl

   120     perform with test after

* 11-S*********************                                           (   0)**

**   Reserved word missing or incorrectly used

CONTINUE COMPILING PROGRAM ?   Yes/No/Zoom-all/zoom-This

OK

   136     end-perform.

* 564-S***************                                                 (   3)**

**   A scope-delimiter did not have a matching verb and was discarded.

Resolution:

In this instance the AIX machine was 32bit and needed a 32bit license key for Server Express. Once this was installed compiling the simple COBOL program tictac.cbl compiled successfully.

Net Express 5.1 Update (or WrapPack) fails with error 1305

$
0
0
Current Revision posted to Net Express/Server Express Knowledge Base by MF_Fano on 11/17/2015 5:12:26 PM

Problem:

Installing Net Express 5.1 Update (or WrapPack) fails with the following error:

Error 1305. Error reading from file C:\Windows\Installer\xxxxx.msi. Verify that the file exists and that you can access it.

Resolution:

This problem occurs when the SYSTEM account does not have a full permission on the folder that the installation was launched from.

By default, the SYSTEM account is granted full control to all files on local NTFS volumes. If Net Express 5.1 Update file is located on a network drive, you might want to copy it to your local drive, such as in C:\Users\YourID\Downloads or C:\Users\YourID\Documents where the SYSTEM account has full control.

Net Express command prompt returns 'The input line is too long'

$
0
0
Current Revision posted to Net Express/Server Express Knowledge Base by MF_Fano on 11/30/2015 2:15:34 PM

Problem:

Opening Net Express 32-bit Command Prompt or Net Express 64-bit Command Prompt returns the following at the prompt:

The input line is too long.

Resolution:

createnv.bat is the script behind the Net Express command prompt. It creates another batch file (setenv.bat) that will contain all the variable settings required to set up the Net Express environment, calls setenv.bat to set environment variables, and then deletes setenv.bat:
"%cd%\cblpromp.exe" >> "%temp%\setenv.bat"
call "%temp%\setenv.bat"
del /q "%temp%\setenv.bat"

As shown above, cblpromp.exe creates setenv.bat in %temp%. This is where the problem arises. If the TEMP environment variable is missing as a user variable, then %temp% will automatically point to C:\Windows\Temp, which is the system temp folder. By default, it should point to the user's temp folder, i.e. %USERPROFILE%\AppData\Local\Temp or C:\Users\<UserID>\AppData\Local\Temp

In the above case, setenv.bat was created in C:\Windows\Temp, but due to security in Windows, createnv.bat was unable to delete setenv.bat. Each time cblpromp.exe is executed, it appends the variable settings into the existing setenv.bat causing the same environment variables to be set over and over and reach the command line limit. Thus, the operating system reports "The input line is too long".

The TEMP environment variable needs to be set as a user variable with the value of %USERPROFILE%\AppData\Local\Temp

Here are the steps to set TEMP as a user variable:

  1. click Start
  2. right-click on Computer
  3. click Advanced system settings
  4. click Environment Variables
  5. click New under the section of "User variables for <UserID>"
  6. enter the following:
    Variable name: TEMP
    Variable value: %USERPROFILE%\AppData\Local\Temp
  7. click OK
  8. click OK
  9. click Apply (if enabled)
  10. click OK

Relinking COBOL runtime with MQseries 8 returns undefined symbol error but it works with version 7.5

$
0
0
Revision 1 posted to Net Express/Server Express Knowledge Base by Peter.Kalfsbeek on 1/11/2016 2:23:42 PM

Problem

Undefined                       first referenced

symbol                             in file

xcsConvertString                   /opt/mqm/lib64/libmqicb.so

CSCtrl                             /opt/mqm/lib64/libmqicb.so

xcsGetMemFn                         /opt/mqm/lib64/libmqicb.so

xcsQueryCCSIDTypeFn                 /opt/mqm/lib64/libmqicb.so

Resolution

With the MQ Client installed on the machine there is the necessity to link with libmqic not libmqicb.

If it is the MQ Server installed instead of the client then link with libmqm.

Changing the command line to use one of the libraries above then it will work.

C program to validate NFS locking ability

$
0
0
Revision 2 posted to Net Express/Server Express Knowledge Base by Dan.Wright on 1/18/2016 8:26:45 PM

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 <stdio.h> 
#include <fcntl.h>

main()
{

int fd , ret;
struct flock strlock;

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. */
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);
}
ret = close( fd );
if (ret == -1){
printf("FATAL ERROR: Could not close file\n");
exit(-1);
}
}
Old KB# 14008
Tags: COBOL, ACUCOBOL, Net Express, RM/COBOL, Server Express

DEMO - How to create an MD5 hash

$
0
0
Current Revision posted to Net Express/Server Express Knowledge Base by PhillR on 1/29/2016 4:01:47 PM

Problem:

Micro Focus products do not contain any built-in support for MD5 hashing, but it can still be used programmatically.

There are no library routines within Net Express to implement MD5 hashing directly.  If you search google for MD5 and COBOL and there are a number of links.  One of these suggests using C to access the MD5 as it is easier than in COBOL.  If so then consider using C and compiling/linking this to a DLL.  

You can then access this from COBOL via CALL statements.

Resolution:

BUILD W/RELEASE:  Net Express v4.0 with ALL07N40     

============

INTRODUCTION

==========

We've seen a number of requests for a COBOL implementation of the popular cryptographic hash function MD5.  MD5 is widely used for file checksums and similar purposes. It's also widely used for digital signature hashes and message authentication codes, though due to recent successful attacks it's no longer preferred for those purposes. It's still useful for many purposes, though.  

The MD5 algorithm is freely available and legally unencumbered, and a COBOL implementation was created based (loosely) on the reference C implementation in RFC 1321. It is attached in the form of a sample program that reads a file and displays the MD5 hash of its contents. The program was tested on Windows and AIX.

Note, however, that this is unsupported sample code.  

Note also that this program is written using MF COBOL extensions and is not portable COBOL. MD5 requires a lot of bit-fiddling and modular arithmetic, for which portable COBOL is ill-suited.

SOURCE FILES:

=========

Program Files           Description

--------------------     -----------------------------------------------------------

COBMD5.CBL           Computes MD5 hash of a file's contents

Copy Files:

--------------------     -----------------------------------------------------------

COBMD5.TXT          Test input for COBMD5

REQUIREMENTS:

==========

To test this program using the Net Express provided project you need to ensure that the command line setting is set to COBMD5.TXT.  This can be done by pulling  down the Animate menu choose settings and fill the appropriate parameter.

To test from a command line add the file name parameter after the name of the program, for example;

COBMD5.EXE COBMD5.TXT

The output should be:

c36fbf21a1e2cb18e73bd3707555df4c

Note that if you transfer COBMD5.TXT to a Unix system for testing, you must transfer it in binary mode to get the correct output.

OPERATION:

========

REFERENCES:

========

NOTE:

====

==========================================================

Keywords: demonstration, sample, example, demo, cobmd5.zip

demo.ex

demo.me

demo.ne

demo.se

Attachments:

cobmd5.zip

Attachments

Old KB# 4228

The application was unable to start correctly (0xc000007b)

$
0
0
Current Revision posted to Net Express/Server Express Knowledge Base by MF_Fano on 2/18/2016 7:20:45 PM

Problem:

The application runs fine in Net Express IDE or Net Express 32-bit Command Prompt, but it fails to run from the deployment machine and reports the following error:

"The application was unable to start correctly (0xc000007b). Click OK to close the application."

Resolution:

The above error is usually a result of running a 32-bit COBOL program against a 64-bit COBOL runtime.

A 32-bit COBOL application needs CBLRTSS.DLL (for single-thread) or CBLRTSM.DLL (for multi-thread) from C:\Program Files (x86)\Micro Focus\Server 5.1\Base\Bin.

If you do not have Server 5.1 installed, then make sure the runtime files, such as CBLRTSS.DLL and CBLRTSM.DLL are taken from either:

  • C:\Program Files (x86)\Micro Focus\Server 5.1\Base\Bin
  • C:\Program Files (x86)\Micro Focus\Net Express 5.1\Base\Bin

Notfrom:

  • C:\Program Files (x86)\Micro Focus\Server 5.1\Base\Bin\WIN64
  • C:\Program Files (x86)\Micro Focus\Net Express 5.1\Base\Bin\WIN64

Knowledge Base

$
0
0
Current Revision posted to Net Express/Server Express Knowledge Base by Robert Milligan on 4/21/2016 10:01:55 AM

Welcome to the Net Express/Server Express Knowledge Base. The Knowledge Base contains a large amount of information that may answer any technical questions you may have. To take full advantage of the Knowledge Bases across the Community please use the site search found in the top right hand corner of your Internet 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.


Error message: "REBUILD aborted - File type requires use of o option"

$
0
0
Current Revision posted to Net Express/Server Express Knowledge Base by Dan.Wright on 4/26/2016 12:45:45 PM

Problem:

When issuing a rebuild command of this form:

 rebuild infile,outfile -t:MF8

The error appears:

REBUILD aborted - File type requires use of o option

Resolution:

This error appears when the input file is not an indexed file, for example, when the input file is a sequential or relative file.  The purpose of a rebuild command with this general syntax:

 rebuild infile,outfile -t:MF8

is to convert an indexed file into IDXFORMAT"8" format, which is often done to facilitate large file support for indexed files.

If the file in question is a line sequential, record sequential, or relative file, and is one of the files you are concerned might grow larger than 1 gig for shared access, or 4 gig for exclusive access, then refer to this knowledgebase article:

http://community.microfocus.com/microfocus/mainframe_solutions/enterprise_server/w/knowledge_base/17683.file-size-limits-for-server-express-and-net-express.aspx

wherein it explains that a person can specify the FILEMAXSIZE=8 file handler configuration option, to allow line sequential, record sequential, and relative files to grow as large as 4 exbibytes for shared access or 8 exbibytes for exclusive access.  Line sequential, record sequential, or relative files do not need to be rebuilt into IDXFORMAT"8" indexed files for the purpose of large file support; they just need the FILEMAXSIZE=8 file handler configuration option to be set.

On Linux/UNIX, run many COBOL programs simultaneously to test licensing (busy.sh)

$
0
0
Current Revision posted to Net Express/Server Express Knowledge Base by Dan.Wright on 4/26/2016 1:20:50 PM

Problem:

After installing runtime licenses (a. k. a. Server for COBOL licenses) on a Linux/UNIX machine, or to test existing licenses, it would be helpful if there were a way to run a given number of COBOL programs simultaneously, without actually running the real-world application, to prove how many COBOL programs can be run simultaneously.

Resolution:

Below is a shell script that will create a simple COBOL program, compile it, then run a given number of simultaneous instances of it.  Each instance of the program will do nothing but sleep for a certain number of seconds and then exit.

If the machine in question does not have the COBOL compiler installed (in other words, if the Server for COBOL product is installed and not the Server Express product), then run the script first on a machine that does have Server Express installed, then FTP the file "sl.int" to the machine having just Server for COBOL, then comment-out the part of the script that creates and compiles the "sl.cbl" program.

Before running the script, a person can modify the values:

Number_of_programs_to_run=15
Sleep_time=20

to experiment in different ways.

#!/bin/ksh
# Script traditionally named "busy.sh"
# Create a simple COBOL program, compile it, then run a given number
# of simultaneous instances of it in the background.  Each instance
# of the program will simply sleep for a certain number of seconds
# and then exit.  For testing runtime licensing, to prove how many
# COBOL programs can successfully be run simultaneously, without
# actually running the real application.

Number_of_programs_to_run=15
Sleep_time=20

unset COBPATH COBDATA COBCPY COBOPT

exec 6>&1          # save stdout before redirecting it
exec >sl.cbl       # redirect stdout to a file named "sl.cbl"

echo "       call \"SYSTEM\" using \"sleep $Sleep_time\" & x\"00\"."
echo "       exit program giving 0."

exec 1>&6 6>&-     # restore stdout and close file descriptor 6

cob sl.cbl         # Compile the program "sl.cbl"

n=1
while [ $n -le $Number_of_programs_to_run ]
do
cobrun sl &        # Run an instance of the program in the background
n=`expr $n + 1`
done

On Linux/UNIX, the first phase of the COBOL compiler, named 'cobchecker', runs slowly

$
0
0
Current Revision posted to Net Express/Server Express Knowledge Base by Dan.Wright on 4/26/2016 1:25:06 PM

Background information:

The checker is named 'cobchecker32' or 'cobchecker64' in $COBDIR/bin, and can be seen in 'ps -ef' output while it is running.

The checker is the first phase of the COBOL compiler.  It translates COBOL source code into .int and .idy files.  Later, the second phase named the Native Code Generator translates .int into .gnt or .o or .so or executable code.

Problem:

In some cases, the checker began running very slowly, up to 20 times more slowly than usual.

Resolution:

The checker's job is to read COBOL source code as input, and write .int and .idy files as output, so it performs a lot of I/O.

One way of increasing performance is to make certain that the files the checker reads and writes, are hosted on file systems with high I/O performance.   A worst-case scenario would be if the COBOL sources were held on a remotely-mounted file system with relatively slow I/O performance, and if the output files .int and .idy were also on a file system with slow performance.  A best-case scenario would be if the input and output files were on file systems having high I/O performance, such as file systems on local solid-state drives or other high-speed drives.

The checker creates some scratch files on-the-fly during compilation, and deletes the scratch files after it is done.  It creates these files in the directory indicated by the TMPDIR environment variable, or if TMPDIR is not set, the system default temporary directory, which is usually /var/tmp, or P_tmpdir as defined in stdio.h, for example:

	$ grep P_tmpdir /usr/include/stdio.h

	#define P_tmpdir        "/var/tmp/"

If TMPDIR is set to a location on a slow file system, or if TMPDIR is not set and /var/tmp is located on a slow file system, the problem can be solved by setting TMPDIR to a location on a faster file system.  In more than one case, this was the solution Micro Focus customers used to successfully overcome this problem.

(original support incident 2858869)

How can one access locale date/time within Cobol?

$
0
0
Revision 2 posted to Net Express/Server Express Knowledge Base by Chris Glazier on 5/19/2016 10:53:36 AM

Problem:

How can one access locale date/time within Cobol?

Resolution:

This demo demonstrates using strftime to format the local time in the default representation for the current locale:

       $set sourceformat(free) mf

working-storage section.

    01 time-parameters.

       03 time-now          pic x(4) comp-5.

    01 localtime-parameters.

       03 localtime-tm      pointer.

    01 strftime-parameters.

       03 locale-time       pic x(60).

       03 buffer-size       pic x(4) comp-5.

       03 format-string     pic xxx value z"%c".

procedure division.

    *> Get current time in UTC

    call "time" using by reference time-now

    *> Translate to local timezone

    call "localtime" using by reference time-now returning localtime-tm

    *> Translate to string representation of date and time in current

    *> locale

    move length of locale-time to buffer-size

    call "strftime"

       using

          by reference locale-time

          by value buffer-size

          by value format-string

          by value localtime-tm

    *> Remove C null-byte string terminator

    inspect locale-time replacing all x"00" by " "

    *> Display the result

    display locale-time

    stop run.

Sample output, on RedHat EL4

> export LANG=en_GB

> cobrun demo

Mon 05 Mar 2007 17:28:17 GMT

> export LANG=es_ES

> cobrun demo

lun 05 mar 2007 17:28:44 GMT

Old KB# 2065

Getting 173 error when calling C functions from NX executable

$
0
0
Revision 1 posted to Net Express/Server Express Knowledge Base by Chris Glazier on 5/19/2016 11:42:39 AM

Problem:

When attempting to call a C function such as "time" directly from a Net Express program linked as an .exe, a 173 error is returned on the call. How can I get the call to find these C system functions?

Resolution:

In order to call C functions such as "time" directly from a linked Net Express executable, you either need to specify the litlink option for the call so the function will be resolved at link time to the MSVCRT.LIB import library or you need to load the C library dynamically at run-time.

Example:
    call "time" using by reference time-row 

If you compile this for .int/.gnt then it should be found OK as the C run-time will be loaded automatically and the entry point will be available.

If you are linking your program as an .exe/.dll then you must load the C run-time support manually in order to make these entry points available..

You can do this dynamically at run-time by using the following:

01 pp procedure-pointer.

    set pp to entry "MSVCRT"
    call "time" using by reference time-row 

An alternative to this approach is to use the following directive when compiling:

$set initcall"cob32api"

You can also resolve these entry points at link time by adding the following directives to the compile:

$set case litlink

This will force the call to be resolved in the link library MSVCRT.LIB which is automatically referenced during the build.

If you do not want all call literal statements in your program to be litlinked you can selectively use a call-convention for only the C functions.

Use $set case directive and then use call-convention 8 as shown here:

special-names.                  
   call-convention 8 is litlink. 

    call litlink "time" using reference time-row.

Viewing all 42 articles
Browse latest View live


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