Browse all forums dedicated to the Rocket® COBOL product family.
Recently active
Problem: Is this working correctly WS-UNSIGNED PIC 9(15) COMP-5 VALUE ZERO. WS-SIGNED PIC S9(15) COMP-5 VALUE ZERO. WS-BYTES PIC X(20) VALUE '-1380985813' MOVE FUNCTION NUMVAL(WS-BYTES) TO WS-UNSIGNED MOVE FUNCTION NUMVAL(WS-BYTES) TO WS-SIGNED After the above operation was performed: WS-UNSIGNED = 2057592656942123 WS-SIGNED = -0000001380985813 Can this be explained? Resolution: The explanation has to do with the definition of the compiler directive comp-5. COMP-5 compiler directive by default is set to COMP-5"2" COMP-5(2) says that negative numbers are stored in an unsigned COMP-5 item in 2's complement form. This is exactly what is happening. If you want the sign preserved then you need to store the value in a signed data item.
Problem: This set of samples is meant as an introduction for the PC_PRINTER library calls Resolution: INTRODUCTION ============ This set of samples is meant as an introduction for the PC_PRINTER library calls. This demo contains 4 separate samples; PCPrinterIntro - This sample is an introduction to the following PC_Printer calls; PC_PRINTER_OPEN PC_PRINTER_INFO PC_PRINTER_SET_FONT PC_PRINTER_CONTROL PC_PRINTER_WRITE PC_PRINTER_LOAD_BMP PC_PRINTER_WRITE_BMP  
Problem: Customer wanted to know if there is any Server Express command-line tool to convert EBCDIC files to ASCII. Resolution: Server Express does not have a command-line utility to convert ASCII and EBCDIC. This is of course often an issue for customers with existing applications on mainframes. In this case it's often true that they can convert files using the file transfer software on a mainframe, or alternatively they purchase Mainframe Express which does let you do this at the command line. It is of course possible to convert between EBCDIC and ASCII using the CHARSET compiler directive. Old KB# 4076
Problem: Is it possible to change the CTF (Consolidated Tracing Facility) level from within a COBOL program, rather than at the start of the run? Resolution: Two API routines, CBL_CTF_LEVEL() and CBL_TRACER_LEVEL_GET(), can be used to interrogate and to change the trace level. These are unsupported at present, and the API interfaces may change in future releases of the product. This information is therefore made available on the grounds that it may be found of interest and/or use. CBL_CTF_LEVEL() - Specify a Trace Level call "CBL_CTF_LEVEL" using by value flags by value trace-level &
Problem: Opening a line sequential file in EXTEND mode will put an exclusive lock on that file by default. In this case, you can't open that file with a Windows utility such as Notepad to view it until the file has been closed. Resolution: To get around this, you can code the "sharing with all other" phrase in the select statement: select logfile assign to "logfile.txt" organization is line sequential sharing with all other. Old KB# 4047#ServerExpress#AcuCobol#RMCOBOL#netexpress#COBOL
Problem: This program demonstrates the use of the Net Express library routine PC_PRINTER_INFO to get the current configuration information for a specified open printer. It will return a native device context handle, and other information that can be used to enhance the printing of a document by calling native WINAPI graphics functions directly. Resolution: INTRODUCTION ========== This program demonstrates the use of the Net Express library routine PC_PRINTER_INFO to get the current configuration information for a specified open printer. It will return a native device context handle, and other information that can be used to enhance the printing of a document by calling native WINAPI graphics functions directly. SOURCE FILES: ========= Program Files Description ------------------- ----------------------------------------------------------- PRNTINFO.CBL
Problem: If you receive the following error when trying to run an executable on a machine running Application Server for Net Express 4.0: Dynamically Bound RTS Runtime DLL 'CBLRTSS', version 4.0, entry point CBL_CTF_TRACER_GET not recorded in registry, not found or incompatible with requirements of dynamically bound COBOL program. Dynamic binding of RTS requires: Any Runtime DLL, at least Version 4.0 Resolution: One likely cause of this error is the version of Application Server you are running. This Knowledge Base article was raised from an Incident where the Websync WrapPack all07n40.exe had been applied to Net Express 4.0 on the development machine. The executable was rebuilt on that machine and ported to the machine running Application Server for Net Express. However, the equivalent Application Server Service Pack, aps09a40.exe, had not been applied to the Application Server environment. Also, we noted during testing that in one instanc
Problem: Trying to anim Pro*COBOL programs results in a blank screen. Animating pure COBOL program works fine. CTF and truss traces show a 115 error in dispatch.gnt and then the process appears to hang. Resolution: The problem can be resolved by applying an IBM patch to AIX for APAR IY80008. Apparently the issue shows up when the bos.rte.libpthread package is version 5.3.0.30. If you use 5.3.0.0 debugging works correctly. The issue does not show up on our AIX 5.1 or AIX 5.2 machines, which use an older still version of libpthread. You can find a little more information on the problem via this link: http://www-1.ibm.com/support/docview.wss?uid=isg1IY80008 There's another link at the top of this page to go to a download page to get the fix. Old KB# 4116
Problem: You may find that even though you didn't set the configuration option LOG=ON in your extfh.cfg (or the file specified in your EXTFH environment variable, see knoledge base article 22486) Resolution: The file handler configuration option LOG specifies whether any unusual file-related situations, such as corrupted files, or automatic file recovery, are noted in a log file for later examination. The configuration option LOGFILE specifies the name for the log file, by default the name is XFHLOG. In the latest versions of the product LOG=ON by default. But the documentation hadn't been updated accordingly (Server Express 4.0 rpi 1058489) but this should be fixed in Server Express 5.0. To display the file contents, you should use the cobfhprint tool which should create a file called XFHLOG.TXT containing information from the XFHLOG file. cobfhprint XFHLOGfilename Currently there are two defects associated wit
Problem: The following error message is returned when compiling: /opt/lib/cobol/bin/rts64_t: /sbin/loader: Fatal Error: Cannot map library libcobrts64_t.so.2 Resolution: Make sure the environment variable LD_LIBRARY_PATH (or LIBPATH on AIX & SHLIB_PATH on HP-UX) is set correctly by pointing to the correct product and location. It should be set to the $COBDIR/lib directory. To check what the environment variables are set to, run the 'env' command or the 'mfsupport' command, which will generate a 'mfpoll' file in the same directory you run the command. Old KB# 4086
Problem: The example project MSMQLE works fine in NET Express but transfering it to a Visual Studio project it does not compile. Are there any instructions for doing this or is there a .NET example of using MSMQ available? Resolution: The MSMQOLE demo will not compile in Visual Studio as it consists of calls to unmanaged code -- the win32 APIs and the MSMQ objects, for instance. In .NET, you would add a reference to the managed System.Messaging .NET object. Please see the attached demo, which simply sends a message to a Private queue called 'MSMQTest'. If you change the 'QueuePathName' in the MSMQTEST.CBL source file in the MSMQOLE demo to have this 'MSMQTest' private queue receiving the messages, you can run the demo as a receiver and the message from the .NET sample will be displayed in the output window of the MSMQOLE demo. Otherwise it will be there in the Queue messages for the 'MSMQTest' pr
Problem: It is sometimes desirable to have a program run at the privilege level of a user other than that of the user who starts the program. A classic example is an operator who is responsible for running backups. The operator should not be allowed root privileges, but the backup program itself must have global read access in order to do its job. There is a combination of flags for the chmod command which will cause an executable file to run as another user (see "man chmod"). However, doing this to a Cobol program causes a failure to load runtime system components (.so files) and the program terminates very shortly after the startup attempt. Resolution: Due to security concerns and operating system limitations, this is not recommended and is unsupported for Cobol programs. Old KB# 4110
Problem: A customer was required to change a single line in over 1000 programs to add text to the end of the PROGRAM-ID statement. The format of the PROGRAM-ID is : PROGRAM-ID. MYPROGNAME. The change required the format: PROGRAM-ID PROGRAMNAME IS INITIAL. They did not wish to edit each file individually. Resolution: sed is made for this sort of job. The answer is simple and very fast. #! /bin/sh for FILE in *.cbl do echo $FILE sed '/PROGRAM-ID/s/[.]$/ IS INITIAL./' $FILE > ./tmp/tmp.$FILE diff $FILE ./tmp/tmp.$FILE >>./tmp/diff.txt done The script is placed in the directory containing the .cbl files. I also create a tmp directory in the same directory. When run, the script performs a loop reading every .cbl file. It prints the filename to the screen. Edits the line containing PROGRAM-ID to remove the trailing period from the prog
Problem: Is there an equivalent feature to the Animate | DateWarp feature in the Net Express IDE, to be used outside of the IDE for runtime? Resolution: Yes, there is. The runtime tunables datewarp_dynamic and timewarp_dynamic. REF: Go to the Net Express help menu and in the 'Index' tab, enter the keyword 'datewarp_dynamic' or 'timewarp_dynamic' Or go to the 'Contents' tab and located under the Reference | runtime system | runtime tunables for the datewarp_dynamic topic datewarp_dynamic Specifies whether the day, month, and year values specified by the current_day, current_month, and current_year tunables return static or "rolling" values. Syntax: >>-----set datewarp_dynamic=---.-TRUE-.------------->< &
Problem: The following information explains how to set a breakpoint in Animator on a specific count. Lets say you want to execute a rountne n number of times. The following explains how to set the breakpoint. Resolution: In Animator position the cursor on the line that you want to count. Enter "B"reak, then enter "O"n-count. Enter the number of times you want to execute that line of code before you want to break (stop) the process from executing. (The value must be greater between 2 and 255) Hit the enter key. Control is returned to the Break-point menu where you may select: On count works with :- Ordinary breakpoints : Stops every n'th time Breakpoint If conditions : Stops every n'th time condition is true &
Problem: Getting a 9/037 error using CBL_READ_DIR and CBL_GET_CURRENT_DIRECTORY Resolution: As the error code suggests, this is a permissions problem. The directory in question can be found using a system trace utility such as truss. In the truss trace on AIX will be something like: statx("./../../../../", 0x2FF216D8, 76, 0) Err#13 EACCES Err#13 EACCES means that search permission is denied for one component of the path prefix. The path prefix in this example is "./../../../../", i.e. 4 levels up from the directory where the program is running. Full information on statx can be found at the IBM site (http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.doc/libs/basetrf2/statx.htm). truss is available on AIX, SCO UnixWare and Solaris. On HP systems there's tusc and Tru64 uses trace, neither of which are included in the main distribu
Problem: Error message: Dependent module libcobrts64_t.2.so could not be loaded. Could not load module libcobrts64_t.2.so. System error: No such file or directory cob64: error(s) in compilation: sample1.cob A recently released AIX update appears to cause the symptom. To diagnose, cd to a directory in which you have write permission cp $COBDIR/demo/debug/pi.cbl pi.cbl cob pi.cbl cobrun pi If this fails with a similar message, check the LIBPATH setting. If it works, try the Oracle demo, sample1 or any other compilation run from the "make" command. If that fails with the error message above, the problem is diagnosed. Resolution: The problem is caused by make being changed to a setgid program. setuid and setgid programs ignore the value of LIBPATH. This is for security reasons. As a result, Cobol executables, such as rts64, cannot
Problem: How to set a Conditional Breakpoint in Animator. Resolution: You can set a Conditional Breakpoint in Animator. This is not the same as a hard breakpoint. A hard breakpoint occurs when Animator executes a specific statement. A Conditional Breakpoint is a test of a data-item. When that test becomes true, execution stops. Below are some valid examples of breakpoints that may be used by animating our demonstration program pi.cbl. PI > 3.14 N < 25 STRING = "entrypoint" loop-counter > <value> When the breakpoint is set, the COBOL line will be highlighted. Remember, you do not specify the word "if" when setting the breakpoint. Old KB# 4070
Problem: To setup the Java environment with Micro Focus COBOL run the command . $COBDIR/bin/cobsje -v -J <Java_Home> If running on HP/UX 11.11 the cobsje script will abend with the error: ksh: COBCPY: parameter not set Resolution: This is a problem with HP/UX 11.11. The workaround is to set the environment variable COBCPY to anything prior to running the cobsje script: export COBCPY=A . $COBDIR/bin/cobsje -v -J <Java_Home> This is not a problem running on HP/UX 11.00. Old KB# 4073
Problem: A customer's application deletes a record from an index file via COBOL. The record is ".. Not Found" when reading the file. When dumped using 'od' the record data can be seen to still exist in the file. So how can one delete a record physically from an index file using a COBOL program? Resolution: When you delete a record the file handler marks in the data file and index that the record is deleted - it doesn't physically write over the record. You would have to rewrite the key with spaces in the record area and then delete it to remove the data but of course the key is still there. So the only permanent way of doing this is to run rebuild which will remove all the deleted and free space records. The reason we don't permanently delete the record is entirely for performance. Old KB# 4074#ServerExpress#RMCOBOL#COBOL#netexpress#AcuCobol
Problem: This question came from a customer who had Server Express and Application Server for 32 bit and 64 bit. But when he does a cob -V cob -V version @(#)cob.c 1.281 PRN=RXCAI/AAI:9g.K4.22.02 PTI=SP1 PTI=Fixpack22.02_13 I see no work It doesn't tell you if the product is on 32-bit or 64 bit. Even the PRN of Server Expres and Application Server for Server Express doesn't show you this difference even though they they could be a different bit. PRN=RXCAK/AAL:9i.T4.40.02 (Development) PRN=R1CAK/AAC:9i.T4.40.02 (Application Server) Resolution: It is actually quite simple to find this out: type in cob -v or cobmode Old KB# 4109
Problem: Customer downloaded a Fixpack, to find that it was in the format <name>.tar.encr. What does he do with such a file? Resolution: .encr files are encrypted, so that they can only be unpacked on a machine with a valid Micro Focus UNIX product. The approach is therefore to make sure that COBDIR and so on are set, and then to run the .encr file as an executable. It will magically transform itself into a normal .tar file, which can then be extracted in the usual way. Old KB# 4077
Problem: Cob command - quotes and spaces Resolution: cob is a command run under Unix, just as grep and sed are. Unix command lines are processed by the shell. The shell expands all wildcards, environment variables, and does all word and field splitting before cob sees the command line. In addition, cob tries to follow general Unix convention on command lines where possible. Before proceeding further, we will define a cob flag such as -C and -N as an option flag, and the string that follows an option flag as an option parameter. As noted in the Server Express documentation an option parameter must either be a string containing no spaces, or an arbitrary string enclosed in quotes. Unless environment variable expansion is required, single quotes are preferred. These quotes are removed by the shell but the option parameter is passed to cob as a unit, so cob knows the entire string consists of checker/ncg options. Some examples may help. &nb
Problem: This illustrates how to use the Win32 Api ResetDC to adjust the page size for the printer Resolution: INTRODUCTION ========== This example demonstrates the use of the Win32 SDK function call ResetDC to modify the settings of a printer between print jobs. This program uses the Net Express call-by-name routines PC_PRINTER_OPEN and PC_PRINTER_INFO to select a printer and obtain the printers Device Context Handle. This handle is then used to end the page started by PC_PRINTER_OPEN and in the call to ResetDC in order to change the printers page size to an envelope with landscape orientation. An envelope will then be printed. SOURCE FILES: ========= Program Files Description ------------------- ----------------------------------------------------------- RESETDC .CBL Program that calls the WINAPI functions to reset the device context
Problem: Memory management is enabled by default since WrapPack all05n40.exe and might highlight memory problems in existing applications causing them to fail with the new run-time error 252. Resolution: memory_strategy Sets a memory management strategy. Syntax: >>-----set memory_strategy=---strategy-specification------>< Parameters: strategy-specification A numeric value representing one or more of the following flags (see Comments for information about valid combinations): Value Meaning 0x00000001 Check bytes strategy: prepend and append check bytes to each memory allocation 0x00000002 Check freed memory strategy: monitor for subsequent corruption the last n memory blocks freed, where n is the current value set using the memory_free_check_size run-time tunable 0x00000004 Reuse strategy: allow freed memory being monitored for corruption to be used to satisfy allocation requests 0x40000000 Compatibility strategy: maintain
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.