Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with String manipulation

Status
Not open for further replies.

priyanthan

Programmer
Jul 27, 2008
70
CA
i need report on XML tag from a database table.

following is a sample of data,

<Key Type="[TMK1]mfk0" Crypt="301096BD60A1092D"/>
<Key Type="Pvk" Crypt="F65F86C54E91BA37" Chk="2AE35863" />
<Key Type="Pvk" Crypt="4B812E342284C3D0"/>
<Key Type="[TMK1]mfk0" Crypt="DCB77140D560CD4ADCB77140D560CD4A" Chk="023E7B7E" />

Basically i need the length of the Crypt.

working with CR8.5 and DB2.
any help is much appreciated.

Thanks
 
Not sure whether you are looking for a number (length of that part of the string) or that part of the string itself. If the latter, try:

extractstring({table.field},'Crypt="','"')

-LB
 

Try this to make sure it's returning only the Crypt value:

whileprintingrecords;
stringvar x := mid({dbfield},instr({dbfield},"Crypt") + 7,100);
numbervar z := instr(x,"""") - 1;

left(x,z)

If everything checks out, then just wrap it with len:

len(left(x,z))



 
len(extractstring({table.field},'Crypt="','"'))

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top