Your subroutine within the DICT is clobbering the contents of the TCL LIST. Using any type of SELECT, GET.LIST, etc within a subroutine should ALWAYS be done using the non-default select list to avoid this. Line 20 of your subroutine is the problem. It is stepping on the LIST.
John Israel Senior Programmer/Analyst Dayton Superior Corporation 1125 Byers Road Miamisburg, OHÂ 45342 -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of jonathanm Sent: Wednesday, June 22, 2011 11:23 AM To: [email protected] Subject: [U2] Very Strange: Only first DICT entry using SUBR is LISTed Hi, all. I'm on UniData 6.0 on hpux. I have a couple of DICT entries, expect_total_qty and receipt_total_qty on a file called core_cart_head. They are listed below. When I use them in a LIST command like "LIST core_cart_head expect_total_qty receipt_total_qty" only the first field has an values, regardless of the order. For example, with the above LIST command I get: LIST core_cart_head expect_total_qty receipt_total_qty core_cart_head Expect Total Qty Receipt Total Qty 67094_436_1 4 67094_436_2 7 67094_436_3 7 67094_436_4 1 67094_436_5 3 5 records listed But if I reverse the order of fields and use "LIST core_cart_head receipt_total_qty expect_total_qty" I get: LIST core_cart_head receipt_total_qty expect_total_qty core_cart_head Receipt Total Qty Expect Total Qty 67094_436_1 2 67094_436_2 5 67094_436_3 6 67094_436_4 3 67094_436_5 8 5 records listed All of the data listed is correct; the only problem is only the first DICT word listed shows any values. Any ideas why this is happening and how I can get both DICT words to show values? Now here's the trick: Both DICT words use the SUBR function. They call a subroutine that EXECUTEs a different LIST command and parses the output, returning certain key information from the output. Here are the DICT entries: expect_total_qty 001: V The total number of cores expected in this cart. 002: SUBR("GET.LIST.TOTAL",'LIST core_cart_detail WITH cust_shipto_cart "':@ID:'" TOTAL expect_qty',"conversion=MR0") 003: MR0 004: Expect Total Qty 005: 10L 006: S receipt_total_qty 001: V The total number of cores received in this cart. 002: SUBR("GET.LIST.TOTAL",'LIST core_cart_detail WITH cust_shipto_cart "':@ID:'" TOTAL receipt_qty',"conversion=MR0") 003: MR0 004: Receipt Total Qty 005: 10L 006: S And here is the subroutine they're calling: GET.LIST.TOTAL 001: $BASICTYPE "P" 002: SUBROUTINE GET.LIST.TOTAL(RESULT,COMMAND,OPTIONS) 003: * 004: CONVERSION_CODE='' 005: * process options 006: OPT.CNT=DCOUNT(OPTIONS,@AM) 007: FOR OPT.PTR=1 TO OPT.CNT 008: OPTION=OPTIONS<OPT.PTR> 009: OPT.NAME=FIELD(OPTION,'=',1) 010: VALUE.START=COL2()+1 011: OPT.NAME=OCONV(TRIM(OPT.NAME),'MCU') 012: OPT.VALUE=OPTION[VALUE.START,LEN(OPTION)-VALUE.START+1] 013: BEGIN CASE 014: CASE OPT.NAME='CONVERSION' 015: CONVERSION_CODE=OPT.VALUE 016: END CASE 017: NEXT OPT.PTR 018: * 019: RESULT='' 020: PERFORM COMMAND CAPTURING SCREEN.OUTPUT 021: TOTAL.POS=INDEX(SCREEN.OUTPUT,@AM:'TOTAL ',1) 022: IF TOTAL.POS THEN 023: REMAINING.STR=SCREEN.OUTPUT[TOTAL.POS+8,LEN(SCREEN.OUTPUT)-TOTAL.POS-7] 024: RESULT=TRIM(REMAINING.STR<1>) 025: IF CONVERSION_CODE <> '' THEN 026: RESULT=ICONV(RESULT,CONVERSION_CODE) 027: END 028: END 029: RETURN Thanks for any help! Jonathan -- View this message in context: http://old.nabble.com/Very-Strange%3A-Only-first-DICT-entry-using-SUBR-is-LISTed-tp31904158p31904158.html Sent from the U2 - Users mailing list archive at Nabble.com. _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users
