Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
Problem: When executing a program from command-line, and you need to pass the program a parameter, use: "accept dataname from command-line" which gathers the parameter following the program name typed at the prompt. Resolution: When you execute your program from a command prompt like this: C:\\MYAPPS\\SYS4044B.EXE DAILY SUMMARY define this variable in working-storage (the actual name isn't critical): 77 runTimeParameter pic x(255). and use this statement in your procedure to collect the parameter: accept runTimeParameter from COMMAND-LINE If you were to display runTimeParameter you would see this output: DAILY SUMMARY KB19232 6/30/2004 Old KB# 7007
Problem: You may have run the ADISCF function to configure ADIS for certain screen/keyboard behaviour on your Net Express development environment, but found that the same behavior is not reflected in your Application Server environment in production. Resolution: The file ADISCTRL in your \\Net Express\\Base\\Bin directory in development contains the ADIS settings. Copy this file to your production machine and copy into the \\Net Express\\Base\\Bin directory on that machine. Old KB# 6976
Problem: AutoUpdate utility will not display available fixpacks for Net Express v4.0 Resolution: For Net Express v4.0 It is noted on the SupportLine web site, http://supportline.microfocus.com NOTE: Net Express 4.0 users - AutoUpdate no longer supports Net Express 4.0. To obtain updates please use the All WebSync WrapPack. Old KB# 6966
Problem: FETCH PREVIOUS and FETCH PRIOR not working using Oracle OCI If you attempt to do the scrolloption static and the declare mycursor static If you set the following directives; sql(usecurlib=ifneeded) and sql(usecurlib=yes) when a scrolloption static you get a sql error on the open The fetch prior will give the next record not previous. Resolution: OpenESQL does not support use of scrollable cursors with Oracle OCI, i.e. when the application is compiled with the SQL(TARGETDB=ORACLEOCI) directive. The Database Access manual lists OpenESQL functionality which isn't supported with Oracle OCI. Old KB# 6956
Problem: Which compiler directive initializes all the variables in a source? Resolution: DEFAULTBYTE Initializes each otherwise undefined byte of the Data Division to the character given. Syntax: >>-.----.--DEFAULTBYTE--"integer"----------->< -/- Parameters: integer ASCII code of the character, in decimal. Properties: Default: DEFAULTBYTE"00" ( Dialect ) Phase: Syntax check $SET: Initial Dependencies: Set to DEFAULTBYTE"32" immediately by CHARSET"ASCII". Set to DEFAULTBYTE"00" immediately by CHARSET"EBCDIC", MS, IBM-MS or PC1. Comments: integer is a decimal value. For example, if you want to specify an EBCDIC space use DEFAULTBYTE"64"; to specify an ASCII space use DEFAULTBYTE"32". Old KB# 6982
Problem: The Type keyword has been replaced in VB.NET to Structure. Resolution: You would define a Type in VB: Type CustFullName LastName As String * 20 '20 characters FirstName As String * 10 '10 characters End Type In VB.NET, it will have to be defined as follows: <StructLayout(LayoutKind.Sequential)> Structure CustFullName <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=20)> Public LastName As String '20 characters <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=10)> Public FirstName As String '10 characters End Structure Old KB# 6967
Problem: Even with Oracle include set, doesn't pick up sqlca.cob from Oracle directory Resolution: By default, the compiler will not pick up copy files with an extension of .cob. You should therefore use the COPYEXT compiler directive to ensure that the compiler searches for files with this extension, for example COPYEXT(cob,cpy,cbl) In addition, you should either set the COBCPY environment variable to include the Oracle directory containing sqlca.cob, or copy sqlca.cob into the current project directory. Old KB# 6945
Problem: SQL Server 2000 - global tables work, but need to use local temporary table and those are not working. Resolution: You need to use dynamic SQL and the EXECUTE IMMEDIATE statement to create the temporary table. Use something like the following: declared a string- 01 preptmp pic x(100). move create statement into the string string 'Create table #empbas2 (emp_id char(10), ' ' name varchar(30))' INTO preptmp end-string. used dynamic sql to execute the statement
Problem: Differences between Net Express 4.0 University Edition and Net Express 4.0 commercial edition Resolution: The main diffenences are 1) cobol programs are limited to 2200 lines of code. 2) applications can not be deployed to another machine. 3) University Edition cannot be used for any commercial use, while the commercial edition can. Old KB# 6948
Problem: Sometimes it is a requirement to distribute an application in only one .exe file. How do you do this with an application that uses Dialog System for its user interface and therefore, contains its screensets in many .gs files that can not be linked? Resolution: It is not possible to include screensets (.gs files) within a .exe. If what you want is to distribute everything within one file, your only alternative is to create a .lbr library file. In the earlier COBOL systems (Workbench), you could distribute an application as .int or .gnt files and any other read-only files packaged in .lbr files. You would have to include a small additional .exe file, called a trigger, to start the application. In Workbench you would use the Build utility to create this trigger, but this utility has not been included in Net Express. In Net Express, you distribute applications linked into .exe and .dll files. .int and .gnt files are only used for running within the ID
Problem: how to read parameters from a file? Resolution: To read paramaters from a file, use the INDD compiler directive: INDD Causes ACCEPT statements to be read from a specified file. Syntax: >>-.---.--.----.--INDD--"fname"------------.>< -/- ---- --INDD--------------------- -NO- Parameters: fname Name of file to be read for the specified ACCEPT statements. When this parameter is not specified the name used is SYSIN. Properties: Default: NOINDD Phase: Syntax check $SET: Initial Comments: When INDD is specified, all format 1 ACCEPT statements which either have no FROM option or specify FROM SYSIN (or the mnemonic-name associated with SYSIN) are transformed into READ statements, reading from a file with the specified external filename. The filename can be mapped onto physical filenames in the same way as other files with
Problem: The code pasted below is just on add-on to the cobreg demo available on MF WEB Netx sample page; the initial cobreg demo reads & updates registries on the "local" computer. With the code pasted below, you'll be able to read registry on a remote computer. cobreg: Accessing the Windows registry with COBOL and writing or reading information from the registry Resolution: use the WIN32 API RegConnectRegistry as pasted below ========================================================== RegConnectRegistry: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/regconnectregistry.asp MSDN registry APIs http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/registry_functions.asp ========================================================== ... working-storage section. 01 ComputerName pic x(100) value z"\\\\NameOfTheRemoteComputer". 01 result long. ... &nb
Problem: The simplest way is to retrieve the contents of the environment variable USERNAME, as in the code pasted below Others ways are to use the WIN32 APIs GetUSerName or WNetGetUser, as described in MF NeXx sample page getuser.zip : Using WIN 32 Api to get the current user logged using the win 32 api in Cobol getnuser.zip: Using WIN 32 Api to get the current user logged on the network using the win 32 api in cobol Resolution: working-storage section. 01 ENV-value pic x(200). 01 ENV-name. pic x(11) value "USERNAME". &n
Problem: Received an error when trying to open a file. The file status returned is '9 '. What does this mean? Resolution: There are several different file status code values that can be returned from an I/O operation. The default file status codes for this version of COBOL is ANSI'85 (Please read the documentation on the ANS85 compiler directive in the on-line help). The values returned from an I/O operation are in the range '00' through to '49'. The values are returned into a 2 character field. However, the Micro Focus file system also has an extended version of file status codes. To activate these, the NOANS85 compiler directive must be set. The values returned from an I/O operation are returned into a field where the first character is defined as pic x, and the second is defined as pic x comp-x (i.e. hex storage). When an I/O operation fails the first field will always be 9 and
Problem: A Java application is trying to call a COBOL program, which does nothing except throw out some displays. The code in the Java is extracted from the MF examples: private void callInterface() { int retcode; Object[] params = {record}; try { retcode = runtime.cobcall("TESTCALL", params); } catch (Exception e) { e.printStackTrace(); } } "record" implements "DataType" as required. When executing this (as a JUnit test within Eclipse), this gives a CobolException - program not found.&
Problem: The customer created a solution using Visual Studio .Net that contains two projects. He had a main Console application that invoked a wrapper class in a different Assembly. From this class, he was attempting to do a PIatform Invoke call to an unmanaged .dll developed in Net Express 4.0. He added a reference to the unmanaged .dll in his project but when he tried to do a dynamic call at run-time to call the unmanaged .dll he received a run-time error 174 (imported file not found) Resolution: The problem is that when using .NET Platform Invoke from a COBOL program, you cannot call the unmanaged .dll with a dynamic call. You must use a static CALL "progname" instead and the case of "progname" must exactly match what is used as the entry point name in the unmanaged .dll. So if the CASE or FOLD-CALL-NAME directives are being used then you must call the program using the appropriate name that will be generated
Problem: RTS 173 error on CHECKFIL Resolution: Recompile program with initcall"utils.lbr" to resolve the issue. utils.lbr contains the module and with the above directive that library is opened at the start of the module. Old KB# 6947
Problem: How to finalize an instance of a .NET class ? Resolution: The .Net CLR runtime will Garbage Collect at various points. It will clear objects that cannot be reached. In COBOL you could set and object reference to null (or to another object). The object would not be reachable and therefore Garbage Collected. Old KB# 6975
Problem: There is a known issue with the "Watch the Tour" link when the help is invoked by way of the Help menu in the Net Express IDE (Integrated Development Environment). It should work outside of the Net Express IDE however. Try starting the help from the Windows Start button, Programs, Micro Focus Net Expresss 4.0, Help menu item. Resolution: There is a known issue with the "Watch the Tour" link when the help is invoked by way of the Help menu in the Net Express IDE (Integrated Development Environment). It should work outside of the Net Express IDE however. Try starting the help from the Windows Start button, Programs, Micro Focus Net Expresss 4.0, Help menu item. Old KB# 6957
Problem: This document details what is needed to configure and use the Micro Focus External File Handler, File Tracing. When problems occur while using Micro Focus indexed files, such as data and/or index corruption, you may be asked to enable File Tracing in your application, in order to assist Micro Focus SupportLine personnel in resolving the file issues. After enabling File Tracing, you would run your application in the normal manner with the goal of reproducing the reported error within the indexed files. File Tracing will cause each file handling I-O operation, including data, to be written to the trace file. Micro Focus personnel can then use a special debugging tool to replay the trace file step-by-step using a "before" image of the files being traced. This allows us to locate the particular I-O operation which may have caused the files to become corrupt. For more general information on how to configure the External File Handler and a
Problem: File Type: LINE SEQUENTIAL File Charasteristics: Tab-delimited fields If you view a record via the "Examine" option when animating, or directly via the data file editor in a project, the tab characters are not visible. If, when in the animator, you toggle to view in HEX, it shows spaces where the tab characters are assumed to be. Resolution: To see the tab characters, you need to set the EXPANDTAB runtime configuration switch to OFF. You can do this by setting this in either extfh.cfg (which is the default file-handler configuration file) in the local directory, or by using the EXTFH environment variable to specify a different file-handler configuration file. For example: set EXTFH=C:\\working directory\\my.cfg An example of a config file is as follows (either my.cfg or extfh.cfg): [XFH-DEFAULT] EXPANDTAB=OFF By default EXPANDTAB is ON. This means that if the file is viewed via either the data fi
Problem: Support for CURRENT TIMESTAMP is likely to be required in migrations from Cobol AS/400 with Embedded SQL to Windows platforms using Micro Focus COBOL and OpenESQL. This is an example of a sentence where CURRENT TIMESTAMP is used. In this case, CURRENT TIMESTAMP is substituted by the current date time at execution and used as a value for column TSCOLUMN: EXEC SQL INSERT INTO MYTABLE (COLUMN1, COLUMN2,
Problem: Animation fails with 114, using a Net Express 3.1 project which has been migrated to Net Express 4.0 Resolution: When migrating a Net Express project, transfer only the project directory files. Do not include the DEBUG and RELEASE directories. Old KB# 6984
Problem: On rebuilding - after upgrading Net Express from 3.1 to 4.0 - our web-project (FKWEB3.1) we get this error message. Do you have a hint?? Resolution: Net Express 4.0: You should check in your Net Express environment this: Project Build Settings -> Link -> Category 'Advanced' It could be that you have included at this point under 'Link with these OBJs' the 'FKWEB3.1_RTECFG.OBJ' more than once. Please ensure to have this OBJ only 1 time to build your application. Old KB# 6962
Problem: A simple example of mult-threading in COBOL. Resolution: Net Express 4.0 comes supplied with a multi-threading demo in: \\Net Express\\Base\\DEMO\\MTHREAD In addition, the following code sample may be of interest. The demo has two threads: 1) The first thread simply increments a counter and displays the result on the screen. 2) The second thread displays the date and time on the screen. All this goes on whilst the parent updates its own counter. The demo is simple but it does show how to create a thread and to terminate them. Full details can be found in the multi-threading manual. Please note, ADIS (Display/Accept) will interrupt threading so that support should be used with caution. Also, you may find you get "funny" results inside the animator as debugging multiple threads seems tricky. It is always a good idea to run any example from the comm
Already have an account? Login
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.