View previous topic :: View next topic
|
Author |
Message |
samayamsasi Warnings : 1 New User
Joined: 22 May 2005 Posts: 7 Location: Bangalore
|
|
|
|
Guys,
now i am facing the below problem
i had two variables(X,Y)
when i moving X to Y . the variable:y contain the Trailing spaces, i don't want that
if x contain 2 then y should contain 2(with out sapces,After moving the X to Y)
if x contain 22 then y should contain the 22 (with out spaces,After moving the X to Y)
Regards,
Sasi |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
For an urgent question you don't give much detail....
What language?
What is the data description of the two fields?
If you don't want trailing spaces, what do you want? Trailing question marks???? |
|
Back to top |
|
|
samayamsasi Warnings : 1 New User
Joined: 22 May 2005 Posts: 7 Location: Bangalore
|
|
|
|
william,
a)this is cobol program
b) 05 X PIC X(10)
05 Y PIC X(10)
c) my requirement is Y should contain the value with outspaces |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Since they are the same size, everything and anything in X will be moved to Y.
If X contains any spaces, then Y will recieve those spaces.
Your "requirement" doesn't make much sense, could you expand on it? |
|
Back to top |
|
|
samayamsasi Warnings : 1 New User
Joined: 22 May 2005 Posts: 7 Location: Bangalore
|
|
|
|
they r the same size,
if x contain the value 2 with remaining spaces , when i moved( x to y)
i want the values of Y is 2 only i no need spaces
same as above if i x contain 22 with remaining spaces, when i moved (X to y) in this case also y shoudget 22 with out spaces
.............
..............
Thanks
Sasi |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Are you trying to move for instance the "22" of the "22bbbbbbbb" in X to the first two positions in Y without overlaying the other 8 positions in Y?
Something line move X(1:2) to Y(1:2)? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Your output field is x(10) - so 10 bytes must be accounted for. If you do not want spaces in the trailing positions what do you want? There is no dynamic "squeeze" function that changes the picture/length of your output field to the length of the data before the trailing space(s). |
|
Back to top |
|
|
|