I try to learn COBOL a little bit more deeply with VISUAL COBOL, But I feel hard to understand someone's code like this:
******************************************************
identification division.
program-id. gip2trbl.
environment division.
configuration section.
data division.
working-storage section.
01 TRBLINP-TYPE PIC X(01).
01 TRBLINP-SEARCH-DATA PIC X(40).
LINKAGE SECTION.
01 TRBLINP.
05 TRBLINP-IO-LEN PIC S9(04) COMP-5.
05 TRBLINP-IO-TEXT PIC X(41).
01 OUTDATA PIC X(41).
PROCEDURE DIVISION USING TRBLINP, OUTDATA .
UNSTRING TRBLINP-IO-TEXT (1:TRBLINP-IO-LEN)
DELIMITED BY '><'
INTO TRBLINP-TYPE ,
TRBLINP-SEARCH-DATA .
move TRBLINP-IO-TEXT to OUTDATA.
goback.
end program gip2trbl.
**************************************************************
Then I created DB2 stored procedure on DB2 V10.5
I passed "1><611016007800011" into stored procedure.
I expected TRBLINP-IO-LEN having the real length of the string which I passed and TRBLINP-IO-TEXT has original string value.
I use out parameter to verify TRBLINP-IO-TEXT. but I only get "<611016007800011", not "1><611016007800011"
Could someone explain to me how to make it working correctly ?
Really appreciated.