I can't for the life of me figure this one out...
I am trying to do a %CHECKR for the last blank on a %TRIM'd field, but it returns the position of the end of the field. Whereas a %LEN on the same field %TRIM()'d returns the expected result, so it can't be the field..? Running V7.1 of the O/S.
Here are the values from debug;
Here are some code snippets;
I can work around this but I would've expected it to work... Unless I've misunderstood something?
I am trying to do a %CHECKR for the last blank on a %TRIM'd field, but it returns the position of the end of the field. Whereas a %LEN on the same field %TRIM()'d returns the expected result, so it can't be the field..? Running V7.1 of the O/S.
Here are the values from debug;
Code:
EVAL #errormsg #ERRORMSG = ....5...10...15...20...25...30...35...40...45...50...55...60 1 'Record 91 in use by job 363082/XRDK/QPADEV002R. ' 61 ' ' EVAL #NumStart #NUMSTART = 48. EVAL #msglength #MSGLENGTH = 46.
Code:
D PSDS SDS D PROG 1 10 D ERRORMSG 91 170 D JOBNAM 244 253 D USER 254 263 D #ErrorMsg S 80a D #NumStart S 2p 0 // Set start positions #ErrorMsg = ERRORMSG; #NumStart = %CheckR(' ':%TRIM(#ErrorMsg)) + 1; // Get length of message minus full stop #MsgLength = %LEN(%TRIM(#ErrorMsg)) - 1 ;
I can work around this but I would've expected it to work... Unless I've misunderstood something?
Comment