View previous topic :: View next topic
|
Author |
Message |
mfhelp Warnings : 1 New User
Joined: 29 Jun 2006 Posts: 33
|
|
|
|
i dont have the source code but this is the observation.....
X is an alphanumeric field containing 15 characters: 1234567<space>8<space><space><space><space><space><space>
this is moved to a field Y which report says contains <space><space><space>123456
what cud be the PIC clause of Y? |
|
Back to top |
|
|
sridevi2005
New User
Joined: 15 Sep 2005 Posts: 42
|
|
|
|
I think PIC 9(6). |
|
Back to top |
|
|
mfhelp Warnings : 1 New User
Joined: 29 Jun 2006 Posts: 33
|
|
|
|
i dont think so coz if destination field had been numeric, filling wud have started from right side.......meaning rightmost of source to rightmost of destination.......now right side contains 6 spaces so Y wud have displayed all spaces.......
correct me if i m wrong. |
|
Back to top |
|
|
ihatesugar Warnings : 1 New User
Joined: 22 Oct 2006 Posts: 43
|
|
|
|
It has to be PIC(09) and if the movement must be right justified!!! |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Without the source code it is impossible to say exactly what happens.
Here are some possible solutions:
Code: |
01 FIELD-X.
03 FIELD-X1 PIC X(6).
03 FIELD-X2 PIC X(9).
01 FIELD-Y PIC X(9) JUSTIFIED RIGHT.
01 FIELD-Z PIC Z(9).
MOVE FIELD-X(1:6) TO FIELD-Y
MOVE FIELD-X(1:6) TO FIELD-Z
MOVE FIELD-X1 TO FIELD-Y
MOVE FIELD-X1 TO FIELD-Z |
All these MOVEs lead to the same result. |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
What Marso shown would produce "$$$123456" to the output variable, where $= Spaces.
Coming to the original question:-
Quote: |
what cud be the PIC clause of Y? |
As you said value for this field is "$$$123456"
It is containing spaces- It cant be a numeric field.
It is having numbers- It cant be a alphabetic field.
It is having spaces & numbers- It MUST be an alphanumeric field.
So answer is X(9). |
|
Back to top |
|
|
|