xml parsing - In XML PARSE using COBOL the FUNCTION LENGTH (XML-TEXT) calculating 1 for XML-TEXT = blanks -


i trying parse xml document in cobol using xml parse, 1 segment @ time. in content-characters check doing compute ws-xml-len = function length (xml-text).

there start of element not want process, them going content-characters check , calculating length of (xml-text) = 1 though xml-text blank.

could let me know reason , should modify in program.

function length (xyz) gives length of field, not "length" of data. cobol has no "string delimiter" (except special use literal).

if xyz pic x(30) return 30 "every time", irrespective of content of field.

you haven't mentioned compiler or operating system using, if using ibm cobol, should produce "list" output (the generated pseudo-assembler code). see code generated function length ( ) mvc "literal pool" pointing @ constant value same length of field, , (likely) there because using function length.

the length of "special register" similar, if have it.

if want know if field blank:

if equal spaces 

if need know length of field given know specific "trailing" or "leading" value (spaces, zero, low-values, whatever) have write code it.

for counting data , ignoring trailing spaces, common way use function reverse , inspect ... tallying ... leading space. there other ways.

you'll need length of field (to calculate length of data) the length of field invariant calculate (function length or plain length of) once.

there subtle difference between function length , length of, won't affect task.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -