View previous topic :: View next topic
|
Author |
Message |
itjagadesh
New User
Joined: 05 Dec 2006 Posts: 89 Location: chennai
|
|
|
|
Hi,
Could anyone please tell me how to remove high-values and leading zeros in the alpha numeric field?
Input layout:
---------------
01 Ws-Name Pic X(04).
INput Values
--------------
David
0John
"FFFF
FFFF" -> High values in Hex decimal format
Output layout:
----------------
01 ws-name-output Pic X(04)
Values
-------
David
John - (Leading zeros in the input were removed)
SPACES - (Spaces were moved when high values in the input) |
|
Back to top |
|
|
bhairon singh rathore
New User
Joined: 19 Jun 2008 Posts: 91 Location: banglore
|
|
|
|
hi,
Why don't you INSPECT leading zeroes and X'00' and replace it with spaces. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
Back to top |
|
|
itjagadesh
New User
Joined: 05 Dec 2006 Posts: 89 Location: chennai
|
|
|
|
Yes you are correct. The Inspect statement will replace zeros and H'00' with spaces. but the requirement is something like
Input - Output
0TATA -> TATA (Zero was removed and moved a step forward)
00NAN -> NAN (Zeros were removed and moved 2 steps forward)
"FFFF
FFFF" -> SPACES (High values will be spaces) |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Reference modification -- the COBOL Language Reference manual will give you the details. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
This sounds like another student exercise. Especially since the data conflicts with the problem statement:
Quote: |
01 Ws-Name Pic X(04). |
versus
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Quote: |
This sounds like another student exercise. |
And we get more and more of these.
In addition to the student forum, www.ibmmainframeforum.com
maybe we need a "Homework Questions" section similar to the "Interview Questions" section. That way we could at least gather the student/beginner questions in one place.
fwiw,
d |
|
Back to top |
|
|
|