View previous topic :: View next topic
|
Author |
Message |
anilsanda
New User
Joined: 07 Jun 2007 Posts: 15 Location: chennai
|
|
|
|
Hi,
If the number of source variables are greater than the number of destination variables declared and "ON OVERFLOW" or "NOT ON OVERFLOW " is not specified .then whether the prgram gets abended or it will populate the last destination variable with the entire left out part of the string .
ex:
UNSTRING FullName DELIMITED BY ALL SPACES
INTO FirstName, SecondName, Surname
END-UNSTRING.
Full name = "John Joseph Ryan chennai"
first name = john
second name = joseph
surname= ryan
wht abt "chennai"??? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
do You have access to a compiler to test or You are just studying the manual? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
I suggest you run a simple test and see.
IIRC, when the last receiving field is processed, the unstring stops. There is no error raised. The remaining data is not processed (as i said iirc). |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
anil,
Quote: |
Full name = "John Joseph Ryan chennai"
first name = john
second name = joseph
surname= ryan
wht abt "chennai"??? |
You will lose "chennai" when that unstring is done. it would not populate "Ryan Chennai" in the surname field.
what actually is u r requirement? If you want chennai to be populated in surname then you will have to do the following.
Code: |
Perform UNTIL a flag
replace the first "space" with "\"
unstring the data into 2 parts delimited by "\"
check the fucnctionality and set the flag when the 2 part is spaces
|
By this youi can check dynamically incresing the performance and not losing the data. |
|
Back to top |
|
|
|