How to count the number of letters in a register



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

How to count the number of letters in a register

Postby andersoncarboni » Fri Feb 21, 2014 8:48 pm

Hy,

i need to insert a field in a DB2 VARCHAR field, but is necessary know the size of field before insert the data.

My input file has the following data:
[img]
sort.JPG
[/img]


I need count the number of caracters of the string that begins in position 41 without the spaces, in this case the answer will be 18.

thank for the help
You do not have the required permissions to view the files attached to this post.
andersoncarboni
 
Posts: 3
Joined: Fri Feb 21, 2014 8:33 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to count the number of letters in a register

Postby dick scherrer » Fri Feb 21, 2014 10:07 pm

Hello and welcome to the forum,

Please do NOT post images - they are more difficult to work with and waste considerable forum space. To get the desired result, use copy/paste and the Code tag.

How did you arrive at 18? Did you mean 31 rather than 41? What is the max length?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: How to count the number of letters in a register

Postby NicC » Fri Feb 21, 2014 10:48 pm

Actually, I make it 8 - 'anderson'
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: How to count the number of letters in a register

Postby BillyBoyo » Fri Feb 21, 2014 11:04 pm

Fixed-length or variable-length records? The techniques are different, so need to know.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: How to count the number of letters in a register

Postby andersoncarboni » Mon Feb 24, 2014 3:58 pm

Sorry for post images, it's my first time here...
In really the character begin in position 31 and not in the 41. The Max Length is 300
Billy Boo it's fixed-length.

Thank for all
andersoncarboni
 
Posts: 3
Joined: Fri Feb 21, 2014 8:33 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to count the number of letters in a register

Postby BillyBoyo » Mon Feb 24, 2014 5:09 pm

Have a look at this one, it should have enough in it: dfsort-icetool-icegener/topic8981.html#p43880
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: How to count the number of letters in a register

Postby andersoncarboni » Tue Feb 25, 2014 4:29 pm

BillyBoyo wrote:Have a look at this one, it should have enough in it: dfsort-icetool-icegener/topic8981.html#p43880


thanks for the example, I've done here and it worked correctly
andersoncarboni
 
Posts: 3
Joined: Fri Feb 21, 2014 8:33 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to count the number of letters in a register

Postby BillyBoyo » Tue Feb 25, 2014 5:34 pm

Good work. Thanks for letting us know. Can you post the code you used, as it may help others in the future.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post