View previous topic :: View next topic
|
Author |
Message |
briansheehan
New User
Joined: 02 Jun 2007 Posts: 5 Location: ireland
|
|
|
|
I have two variables, both PIC X (120).
For illustration sake Variable A is ' abcdef......'
I want to move Variable A into Variable B, but have the leading spaces removed, so it reads 'abcdef.......'.
thanks |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Variable number of leading spaces?
Pad with spaces in the rear? |
|
Back to top |
|
|
briansheehan
New User
Joined: 02 Jun 2007 Posts: 5 Location: ireland
|
|
|
|
yes, a variable number of leading spaces. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Inplace:
Code: |
perform varying I from 1 by 1 until E(1:1) not = space
if E(I:1) = space
continue
else
move E(I:) to E(1:)
end-if
end-perform |
To a different dataarea:
Code: |
perform varying I from 1 by 1 until E(1:1) not = space
if E(I:1) = space
continue
else
move E(I:) to F
end-if
end-perform |
|
|
Back to top |
|
|
|