This article discusses how to meet certain criteria for an animation to succeed. Problem: Even though Animator is started with the "anim" command, or COBSW=+A, or by another valid means, the code executes without animating, or shows "ERROR: File incompatibility". Why is this? Resolution: On a system experiencing animation problems, it is helpful to begin troubleshooting by performing a simple test in a temporary directory away from the main application. Consider this quick demonstration of animation with .int code: If any of the environment variables COBPATH, COBDATA, COBCPY, COBIDY, and DISPLAY are set, unset them. Then enter these commands: mkdir /tmp/cob_test cd $COBDIR/demo/debug cp pi.cbl /tmp/cob_test cd /tmp/cob_test cob pi.cbl As long as the COBPATH, COBDATA, COBCPY, and COBIDY environment variables are not set, these five commands will result in the following three files being created in /tmp/cob_test: pi.cbl pi.idy pi.int If these files are not created, problems with Server Express are more fundamental than just Animator. In that case refer to the following Knowledge Base article: 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 To animate, enter "anim pi". This shows successful animation of .int. Before Animator can be expected to work, it must have access to: The COBOL source code (so it can display it on the screen). Animator looks in the current directory to find the source. If you keep your source and/or its copy books in a location other than the current directory (from which you start Animator), specify this location using the COBCPY environment variable. The compiled code, in the form of .int or .gnt or .so or executable or shared library. Animator looks in the current directory to find the compiled code. If you keep the compiled code in a location other than the current directory, specify this location using the COBPATH environment variable. For all forms of compiled code except .int, the source must have been compiled with the "-g" flag (i.e. the "debug" flag) on the "cob" command, otherwise the code will not be able to be animated. The .idy file. Animator looks in the current directory to find the .idy file. If you keep .idy files somewhere other than the current directory, specify their location using the COBIDY environment variable. An output terminal. If the DISPLAY environment variable is set, Animator assumes that you are using an X terminal, and that DISPLAY points to your valid X server display. If DISPLAY is set but its value is not valid, the Animator screen will not appear. If you are not using an X terminal, unset DISPLAY. The .idy file must "correspond" to the compiled code. For example, if the compiled code is a .gnt module, the .idy must have been created at the same time and in conjunction with the .gnt. It can't be an .idy created on an occasion when the source was compiled only to .int. If a given directory has more than one form of compiled code, for example, if it has both a .gnt and an .int derived from the same COBOL source, the .gnt will be invoked in preference to the .int. Working in the directory /tmp/cob_test as before, when you enter: anim pi The .int code animates successfully. Animator, at the bottom-left, on its status line, shows "Animate-pi.int" to indicate that .int is being animated. Then try: cob -ug pi.cbl anim pi The .gnt code and a corresponding .idy are created. The .gnt is successfully animated. Animator, on its status line at the bottom-left, shows "Animate-pi.gnt/.o/.exe". To purposefully create trouble with animation and demonstrate a common problem: cob pi.cbl cob -u pi.cbl anim pi The first command above compiles the program to .int, and creates a new .idy corresponding to the .int. The next command compiles the program to .gnt via the "-u" flag. Since the "-g" flag is not specified with the "-u", a new .idy is not created and the .gnt is not animatable. We are left with an .idy corresponding to the .int and not the .gnt. When we enter "anim pi", the .gnt will be invoked by preference. Although we invoke this with "anim", the Animator will not appear. Instead the code will “zoom”, or run without animation, displaying the mathematical value of “pi”, because there is no .idy corresponding to the .gnt. The solution to such a circumstance is to either: Compile with cob -ug to create a new .idy that corresponds to the.gnt, than animate the .gnt, or Delete the .gnt so the only files left are the .int and its corresponding .idy, then animate the .int. If you have an .idy but have forgotten under what circumstances it was created, you can examine it using the command "cobfflst .idy file | more". For example: cobfflst pi.idy | more For an .idy corresponding to an .int, this would show (among other things): * Compiled to : Int code with xref information Were we to enter: cob -ug pi.cbl cobfflst pi.idy | more It would then show: * Compiled to : Gnt/object with xref information A production application may consist of many independent COBOL modules. At a given point in time, some modules may be animatable and some not. For example, some may meet all requirements: their source, compiled code, and .idy may all be available, while for others, the .idy may not be found in the current directory or on COBIDY, or their source may not be available, or they may not have been compiled with the "-g" option. When the flow of control enters a module that is not animatable, execution "zooms", or proceeds at full speed without animation, and when the flow of control again enters an animatable module, the Animator screen once again appears. "Zooming" indicates that a module for some reason is not animatable. Following is a way of confusing Animator even further and of demonstrating "ERROR: File incompatibility": echo '000001 display "hello world".' pi1.cbl cob pi1.cbl The first command creates a new one-line COBOL program named "pi1.cbl", and the second command compiles it, creating "pi1.idy" and "pi1.int". Now re-name pi1.idy to pi.idy: mv pi1.idy pi.idy At this point (if you have performed all preceding examples), an .idy exists named "pi", but it actually corresponds to an entirely different COBOL source module. Enter "anim pi": anim pi This produces "ERROR: File incompatibility". It means the .idy is so different than the compiled code that Animator cannot proceed. This may occur not only because of accidental re-naming (as above), but also when .idy files are left over from compilations performed years ago on different platforms, or under earlier versions of Micro Focus COBOL. The solution in such a circumstance is to re-compile, creating a fresh .idy that corresponds to the compiled code. Incident Number: 2259718 Old KB# 14407
↧