:::::::::::::: PREFIX=NOSTRINGRANGE (PLI for AIX 3.1 platform default and recommended by IBM for production use) :::::::::::::: # pli -g ./yt184913.pli "./yt184913.pli", line 12.2: IBM1041I I Comment spans 4 lines. "./yt184913.pli", line 60.2: IBM1058I I Conversion from FIXED BIN(31) to CHARACTER will be done by library call. "./yt184913.pli", line 60.2: IBM1058I I Conversion from FIXED BIN(15) to CHARACTER will be done by library call. # ./yt184913 INITFILL test A at 0x20000730: '0000000000000000'X X at 0x20000738: '0000000000000000'X Y at 0x20000740: '0000000000000000'X Z at 0x20000748: '0000000000000000'X SETUP test #1 X at 0x20000738: '2020202020202020'X Y at 0x20000740: '3132333435363738'X TEST_1 CAP at 0x2FF22728 is '20000740'X CAL at 0x20000728 is '0008'X X=SUBSTR(D,I,CAL); /* D=BASED(CAP) I=1 CAL=8 */ X at 0x20000738 is '3132333435363738'X Y at 0x20000740 is '3132333435363738'X TEST_2 NV at 0x2FF22790 is '20202020202020202020202020202020'X X at 0x20000738 is '2020202020202020'X TEST_2 NV at 0x2FF22790 is '31323334353637382020202020202020'X X at 0x20000738 is '3132333435363738'X TEST_2 NV at 0x2FF22790 is '31323334353637383930202020202020'X X at 0x20000738 is '3132333435363738'X TEST_3 V at 0x10003DD0 is '00000000000831323334353637380000000A'X X at 0x20000738 is '0000000831323334'X X has failed TEST_3 V at 0x10003DD4 is '000831323334353637380000000A31323334'X X at 0x20000738 is '3132333435363738'X TEST_3 V at 0x10003DE0 is '000A31323334353637383930204341502061'X X at 0x20000738 is '3132333435363738'X :::::::::::::: PREFIX=STRINGRANGE (during development - prints message but modifies program data...) :::::::::::::: # pli -g ./yt184913.pli -qPREFIX=STRINGRANGE "./yt184913.pli", line 12.2: IBM1041I I Comment spans 4 lines. "./yt184913.pli", line 60.2: IBM1058I I Conversion from FIXED BIN(31) to CHARACTER will be done by library call. "./yt184913.pli", line 60.2: IBM1058I I Conversion from FIXED BIN(15) to CHARACTER will be done by library call. young@paxtxt01:/data0/pfw/rfe/rfe_184913# ./yt184913 INITFILL test A at 0x20000738: '0000000000000000'X X at 0x20000740: '0000000000000000'X Y at 0x20000748: '0000000000000000'X Z at 0x20000750: '0000000000000000'X SETUP test #1 X at 0x20000740: '2020202020202020'X Y at 0x20000748: '3132333435363738'X TEST_1 CAP at 0x2FF22728 is '20000748'X CAL at 0x20000730 is '0008'X X=SUBSTR(D,I,CAL); /* D=BASED(CAP) I=1 CAL=8 */ IBM0361I ONCODE=0350 The STRINGRANGE condition was raised. At offset +00000710 in procedure with entry TEST_1 X at 0x20000740 is '3120202020202020'X Y at 0x20000748 is '3132333435363738'X X has failed TEST_2 NV at 0x2FF22790 is '20202020202020202020202020202020'X X at 0x20000740 is '2020202020202020'X TEST_2 NV at 0x2FF22790 is '31323334353637382020202020202020'X X at 0x20000740 is '3132333435363738'X TEST_2 NV at 0x2FF22790 is '31323334353637383930202020202020'X X at 0x20000740 is '3132333435363738'X TEST_3 V at 0x10003E80 is '00000000000831323334353637380000000A'X IBM0361I ONCODE=0350 The STRINGRANGE condition was raised. At offset +00000338 in procedure with entry TEST_3 X at 0x20000740 is '2020202020202020'X TEST_3 V at 0x10003E84 is '000831323334353637380000000A31323334'X X at 0x20000740 is '3132333435363738'X TEST_3 V at 0x10003E90 is '000A31323334353637383930204341502061'X X at 0x20000740 is '3132333435363738'X :::::::::::::: yt184913.pli :::::::::::::: %PROCESS LINECOUNT(32767) CODEPAGE(858) NOWRITABLE; %PROCESS SOURCE STMT NEST OPTIONS(ALL) LIST MDECK PROCESS(KEEP); %PROCESS STORAGE XREF(FULL) ATTRIBUTES(FULL) AGGREGATE(HEXADEC); %PROCESS FLAG(I) MSGSUMMARY(XREF); %PROCESS CMPAT(V2) DEFAULT(DESCRIPTOR DESCLOCATOR); %PROCESS DEFAULT(INITFILL); %PROCESS TEST GONUMBER DECIMAL(VALIDATE); YT184913: PROC() OPTIONS(MAIN NOEXECOPS); ON FINISH; ON ERROR SNAP; /* ON STRINGRANGE SNAP BEGIN; ON STRINGRANGE SYSTEM; DCL AIX_ABORT ENTRY() EXT("abort"); CALL AIX_ABORT(); END; */ DCL A CHAR(8) STATIC; DCL X CHAR(8) STATIC; DCL Y CHAR(8) STATIC; DCL Z CHAR(8) STATIC; DCL P POINTER STATIC; DCL LEN FIXED BIN(15) STATIC; /*456789o123456789o123456789o123456789o123456789o123456789o123456789o*/ DISPLAY('INITFILL test'); DISPLAY(' A at 0x'||HEX(ADDR( A ))||': '''||HEX((A))||'''X '); DISPLAY(' X at 0x'||HEX(ADDR( X ))||': '''||HEX((X))||'''X '); DISPLAY(' Y at 0x'||HEX(ADDR( Y ))||': '''||HEX((Y))||'''X '); DISPLAY(' Z at 0x'||HEX(ADDR( Z ))||': '''||HEX((Z))||'''X '); A=''; Z=''; DISPLAY('SETUP test #1'); X=''; Y='12345678'; DISPLAY(' X at 0x'||HEX(ADDR( X ))||': '''||HEX((X))||'''X '); DISPLAY(' Y at 0x'||HEX(ADDR( Y ))||': '''||HEX((Y))||'''X '); P=ADDR(Y); LEN=SIZE(Y); CALL TEST_1(P,LEN); CALL TEST_2(''); CALL TEST_2('12345678'); CALL TEST_2('1234567890'); CALL TEST_3(''); CALL TEST_3('12345678'); CALL TEST_3('1234567890'); TEST_1: PROC(CAP,CAL); DCL CAP POINTER INONLY BYVALUE NONASSIGNABLE; DCL CAL FIXED BIN(15) INONLY BYADDR NONASSIGNABLE; DCL D CHAR(1) BASED(CAP); DCL I FIXED BIN(31) INIT(1); DISPLAY('TEST_1'); DISPLAY(' CAP at 0x'||HEX(ADDR( CAP ))||' is '''||HEX((CAP))||'''X '); DISPLAY(' CAL at 0x'||HEX(ADDR( CAL ))||' is '''||HEX((CAL))||'''X '); DISPLAY(' X=SUBSTR(D,I,CAL); /* D=BASED(CAP) I='||TRIM(I) ||' CAL='||TRIM(CAL)||' */'); X=SUBSTR(D,I,CAL); DISPLAY(' X at 0x'||HEX(ADDR( X ))||' is '''||HEX((X))||'''X '); DISPLAY(' Y at 0x'||HEX(ADDR( Y ))||' is '''||HEX((Y))||'''X '); IF ^(A='') THEN DISPLAY('A has failed'); IF ^(Z='') THEN DISPLAY('Z has failed'); IF ^(X='12345678') THEN DISPLAY('X has failed'); IF ^(Y='12345678') THEN DISPLAY('Y has failed'); DISPLAY (' '); END TEST_1; TEST_2: PROC(NV); DCL NV CHAR(16) NONVARYING BYADDR INONLY NONASSIGNABLE; X=COPY('D5'x,MAXLENGTH(X)); Y=COPY('D5'x,MAXLENGTH(Y)); DISPLAY('TEST_2'); DISPLAY(' NV at 0x'||HEX(ADDR( NV ))||' is '''||HEX((NV))||'''X '); X=SUBSTR(NV,1,MAXLENGTH(X)); DISPLAY(' X at 0x'||HEX(ADDR( X ))||' is '''||HEX((X))||'''X '); IF ^(X='12345678') & ^(X=' ') THEN DISPLAY('X has failed'); IF ^(Y=COPY('D5'x,MAXLENGTH(Y))) THEN DISPLAY('Y has failed'); DISPLAY (' '); END TEST_2; TEST_3: PROC(V); DCL V CHAR(16) VARYING BYADDR INONLY NONASSIGNABLE; X=COPY('D5'x,MAXLENGTH(X)); Y=COPY('D5'x,MAXLENGTH(Y)); DISPLAY('TEST_3'); DISPLAY(' V at 0x'||HEX(ADDR( V ))||' is '''||HEX((V))||'''X '); SUBSTR(X,1,MAXLENGTH(X))=SUBSTR(V,1,MAXLENGTH(X)); DISPLAY(' X at 0x'||HEX(ADDR( X ))||' is '''||HEX((X))||'''X '); IF ^(X='12345678') & ^(X=' ') THEN DISPLAY('X has failed'); IF ^(Y=COPY('D5'x,MAXLENGTH(Y))) THEN DISPLAY('Y has failed'); DISPLAY (' '); END TEST_3; END YT184913;