Changing dfcn to get COBOL compile listing

PassPort ver 10.x Unix dfcn script for compiling COBOL programs.
Line numbers were added with Unix nl command to help locate code changes. The
line numbers are not accurate.

Change works for Asset Suite ver 6.

References:
http://supportline.microfocus.com/documentation/books/sx2011sp1/cycobc.htm

http://supportline.microfocus.com/documentation/books/sx2011sp1/cyadir.htm
-C DATAMAP is documented here

1 #!/bin/ksh
2 #########################################################################
3 # dfcn - Duty Free COBOL compile script #
4 # SQL precompile, CICS translate and compile COBOL programs #
5 # (C) The Indus Group 1993/94 #
6 #====================== Maintenance History ===========================#
7 # Date Who Description #
8 # ======== === ================================================== #
9 # xx/xx/93 ja Initial code. #

First and last Indus log entries.

131 # 03/01/05 VS LOG#00028485 Input filename can be extended clearcase #
132 # filenames #
133 #########################################################################

1471 $TOOLS_DIR/mtou ./$UpC.cob
1472 echo " ***END OF PROGRAM***" >> ./$UpC.cob
1473 # compile as debuggable executable
1474
1475 #Begin COBOL listing change
1476 # $COB -t ${EXOPT}g ./$UpC.cob 1> $tmp/${LOGNAME}.clst$$ 2> $tmp/${LOGNAME}.cerr$$
1477 $COB -Pt -C DATAMAP -C LIST -C XREF ${EXOPT}g ./$UpC.cob 1> $tmp/${LOGNAME}.clst$$ 2> $tmp/${LOGNAME}.cerr$$
1478 #End COBOL listing change

1479
1480 nRetCode=$?
1481 if [ $nRetCode = 0 -a -s $tmp/${LOGNAME}.cerr$$ ]; then
1482 nRetCode=4
1483 fi

1534 if [ "$opsys" = "$WinNT" ]; then
1535 cp $UpC.gdy $UpC.gdy.debug
1536 else
1537 cp $UpC.idy $UpC.idy.debug
1538
1539 #Begin COBOL listing change
1540 cp $UpC.lst $UpC.lst.debug
1541 #end COBOL listing change

1542
1543 fi
1544 fi

1590 if [ -f $UpC.idy ]; then
1591 chmod 777 $UpC.idy 2> /dev/null
1592
1593 #Begin COBOL listing change
1594 chmod 777 $UpC.lst 2> /dev/null
1595 #end COBOL listing change

1596
1597 fi
1598 if [ -f $UpC.gdy ]; then
1599 chmod 777 $UpC.gdy 2> /dev/null
1600 fi

1664 if [ "$opsys" = "$WinNT" ]; then
1665 mv -f $EXEC_DIR/dbin/$UpC.gdy $EXEC_DIR/dbin/$UpC.gdy.bk$$ 2>>/dev/null
1666 else
1667 mv -f $EXEC_DIR/dbin/$UpC.idy $EXEC_DIR/dbin/$UpC.idy.bk$$ 2>>/dev/null
1668
1669 #Begin COBOL listing change
1670 mv -f $EXEC_DIR/dbin/$UpC.lst $EXEC_DIR/dbin/$UpC.lst.bk$$ 2>>/dev/null
1671 #end COBOL listing change

1672
1673 fi

1674 mv -f $EXEC_DIR/bin/$UpC.a $EXEC_DIR/bin/$UpC.a.bk$$ 2>>/dev/null

1750 execute_cmd "cp $UpC.idy.debug $EXEC_DIR/dbin/$UpC.idy" #EF
1751 if [ $? -ne 0 ]; then
1752 echo "**** Error: unable to move idy file!" | tee -a $EF
1753 let ALL_FILES_MOVED=FALSE
1754 fi
1755
1756 #Begin COBOL listing change
1757 execute_cmd "cp $UpC.lst.debug $EXEC_DIR/dbin/$UpC.lst" #EF
1758 if [ $? -ne 0 ]; then
1759 echo "**** Error: unable to move lst file!" | tee -a $EF
1760 let ALL_FILES_MOVED=FALSE
1761 fi
1762 #end COBOL listing change

1763
1764 fi
1765 else
1766 rm -f $EXEC_DIR/dbin/$UpC.*.bk* 2>>/dev/null

1769 rm -f $EXEC_DIR/dbin/$UpC.sl 2>>/dev/null
1770 rm -f $EXEC_DIR/dbin/$UpC.idy 2>>/dev/null
1771
1772 #Begin COBOL listing change
1773 rm -f $EXEC_DIR/dbin/$UpC.lst 2>>/dev/null
1774 #end COBOL listing change

1775
1776 rm -f $EXEC_DIR/dbin/$UpC.gdy 2>>/dev/null
1777 rm -f $EXEC_DIR/dbin/$UpC.cob 2>>/dev/null
1778 rm -f $EXEC_DIR/dbin/$UpC.gnt 2>>/dev/null
1779 fi

1842 if [ "$REMOTECOPY" = "Y" -a -n "${REMOTEHOST:=""}" ]; then
1843 echo "**** Copying executables to remote host $REMOTEHOST ..."
1844 rcp $UpC.cob $REMOTEHOST:$EXEC_DIR/int
1845 rcp $UpC.idy.debug $REMOTEHOST:$EXEC_DIR/int/$UpC.idy
1846
1847 #Begin COBOL listing change
1848 rcp $UpC.lst.debug $REMOTEHOST:$EXEC_DIR/int/$UpC.lst
1849 #end COBOL listing change

1850
1851 rcp $UpC.int.debug $REMOTEHOST:$EXEC_DIR/int/$UpC.int

Reply