Page 1 of 1

Update -Varchar

PostPosted: Wed Feb 26, 2014 1:30 am
by itamar rocha
Hello,
I have a question, when I have the example below:

10 XXXX-DES-DESTINATARIO.
15 XXXX-DES-DESTINATARIO-LEN PIC S9(4) USAGE COMP.
15 XX-DES-DESTINATARIO-TEXT PIC X(1000).

My question is when I have a varchar field, and I want to update the table.
When I have a varchar field I have to set the pic s9(4) with a value?
Because I executed a aplicattion here and the return is -311, 311 means THE INDICATED LENGTH OF A HOST VARIABLE IS NEGATIVE.

Thanks.

Re: Update -Varchar

PostPosted: Wed Feb 26, 2014 7:58 pm
by dick scherrer
Hello,

XXXX-DES-DESTINATARIO-LEN
What value is in this field when the -311 is issued?

Should this be a signed field? How can there be a negative length?

Re: Update -Varchar

PostPosted: Thu Feb 27, 2014 8:43 pm
by itamar rocha
Hello,
I solved the problem, I used a command "SELECT STRIP" before the update and it worked.
Thanks for the help

Re: Update -Varchar

PostPosted: Thu Feb 27, 2014 8:55 pm
by dick scherrer
Good to hear it is working - thank you for letting us know :)

d