View previous topic :: View next topic
|
Author |
Message |
ankit.jain
New User
Joined: 02 Jul 2009 Posts: 18 Location: Mumbai
|
|
|
|
Hi,
I have a variable A PIC 9(03) which can have values from 001 to 100. I want to move this field to B defined as PIC X(03). The moved value in field B should be displayed left aligned like from "1 " to "100".
For example if A = 001, B should have value '1<space><space>'.
Please suggest.
Ankit |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Reference modification works well:
Code: |
IF A < 10
MOVE A (3 : 1) TO B
ELSE
IF A < 100
MOVE A (2 : 2) TO B
ELSE
MOVE A TO B
END-IF
END-IF. |
|
|
Back to top |
|
|
|