From LinkedIn "HP3000 - Bill & Dave's Excellent Machine" 2011-05-28 Dave Darnell: COBOL source trace at execution. Need to produce a line-by-line SOURCE code trace of a COBOL program in batch. System Debugger does not seem to do that. Can anyone help? This is for use by another group converting COBOL app to WinTel. 2011-05-29 Rich Trapp Found an example: http://www.3000newswire.com/subscribers/InsideCobol-0008.html hope that works. It's been fun waking up these dormant brain cells. 2011-05-30 Keven Miller I'm not a "trained" Cobol programmer, but have needed to learn some with migration work. I really like the link to Shawns work that Rich provided. I was however thinking along the lines of debuggers. What follows is from using the XDB symbolic debugger. (Which can be used for Cobol, Fortran, Pascal, and C) The basic idea was to see if a debugger could break on every line and display its location/or line. I still suspect its possible in System Debug with enough time and macros to figure it out. It does require a compile of your program with symdebug xdb enabled. For batch, I think a playback file could be set up to issue the few commands I do in interactive mode. Refer to the Symbolic Debugger Manual. :cob85xl cob2.cob,cob2o.cob;xdb=lcob2.cob ... 00014 INFO=$CONTROL SYMDEBUG=XDB 00015 $CONTROL SYMDEBUG=XDB 00016 IDENTIFICATION DIVISION. 00017 PROGRAM-ID. OVERFLOW-TEST. 00018 DATA DIVISION. 00019 WORKING-STORAGE SECTION. 00020 01 MYTEST PIC S9(14)V9(4) COMP-3 VALUE 0. 00021 01 DISP-TOTAL PIC ---------9.9999. 00022 PROCEDURE DIVISION. 00023 BEGIN. 00024 MOVE 12340000000000.0000 TO MYTEST 00025 * 00026 * Following will experience left truncation 00027 * and display an incorrect answer. 00028 * 00029 MOVE MYTEST TO DISP-TOTAL 00030 DISPLAY "DISP-TOTAL = " DISP-TOTAL 00031 * 00032 * Following will flag the problem. 00033 * 00034 COMPUTE DISP-TOTAL = MYTEST 00035 SIZE ERROR 00036 MOVE ALL "*" TO DISP-TOTAL (1:) 00037 END-COMPUTE 00038 DISPLAY "DISP-TOTAL = " DISP-TOTAL 00039 * 00040 STOP RUN. 00042 END PROGRAM OVERFLOW-TEST. PAGE 0002/COBTEXT OVERFLOW-TEST COBOL ERRORS and WARNINGS COBOL ERRORS: LINE # SEQ # COL ERROR SEV TEXT OF MESSAGE ------ ------ --- ----- --- --------------- 00029 80 055 W LEFT TRUNCATION MAY OCCUR. 0 ERROR(s), 0 QUESTIONABLE, 1 WARNING(s) DATA AREA IS 54 BYTES. CPU TIME = 0:00:00. WALL TIME = 0:00:01. End Run END OF COMPILE :L @cob2@.cob MON, MAY 30, 2011, 8:43 AM ACCOUNT= KEVENM GROUP= COB FILENAME CODE ------------LOGICAL RECORD----------- ----SPACE---- SIZE TYP EOF LIMIT R/B SECTORS #X MX COB2 80B FA 27 27 3 16 1 1 COB2O NMOBJ 128W FB 13 4000 1 16 1 8 LCOB2 EDTCT 72B FA 27 27 3 16 1 1 :Link from=cob2o.cob,xdbend.lib.sys;to=cob2p.cob HP Link Editor/iX (HP30315A.06.17) Copyright Hewlett-Packard Co 1986 LinkEd> link from=cob2o.cob,xdbend.lib.sys;to=cob2p.cob :xdb "-L cob2p.cob" XDB -L cob2p.cob Copyright Hewlett-Packard Co. 1985,1987-1996. All Rights Reserved. <<<< XDB Version A.05.06 MPE/iX >>>> Invoking pxdb.pub.sys on cob2p.cob: . Procedures: 3 Files: 2 Copying cob2p.cob ... Done. LCOB2.COB.KEVENM: OVERFLOW-TEST: 9: BEGIN. xdb> a {L} Overall assertions state: ACTIVE 1: Active {L} xdb> r Starting process 84: "cob2p.cob" LCOB2.COB.KEVENM: OVERFLOW-TEST: 9: BEGIN. LCOB2.COB.KEVENM: OVERFLOW-TEST: 15: MOVE MYTEST TO DISP-TOTAL LCOB2.COB.KEVENM: OVERFLOW-TEST: 16: DISPLAY "DISP-TOTAL = " DISP-TOTAL DISP-TOTAL = 0.0000 LCOB2.COB.KEVENM: OVERFLOW-TEST: 20: COMPUTE DISP-TOTAL = MYTEST LCOB2.COB.KEVENM: OVERFLOW-TEST: 22: MOVE ALL "*" TO DISP-TOTAL (1:) LCOB2.COB.KEVENM: OVERFLOW-TEST: 24: DISPLAY "DISP-TOTAL = " DISP-TOTAL DISP-TOTAL = *************** LCOB2.COB.KEVENM: OVERFLOW-TEST: 26: STOP RUN. Child process terminated normally xdb> quit Really quit? y End Run : Keven Miller kevenm@3kranger.com