Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to remove High-values in the Alphamumeric field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
itjagadesh

New User


Joined: 05 Dec 2006
Posts: 89
Location: chennai

PostPosted: Mon Jul 06, 2009 12:10 pm    Post subject: How to remove High-values in the Alphamumeric field
Reply with quote

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
View user's profile Send private message

bhairon singh rathore

New User


Joined: 19 Jun 2008
Posts: 91
Location: banglore

PostPosted: Mon Jul 06, 2009 12:18 pm    Post subject: Reply to: How to remove High-values in the Alphamumeric fiel
Reply with quote

hi,

Why don't you INSPECT leading zeroes and X'00' and replace it with spaces.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1243
Location: Israel

PostPosted: Mon Jul 06, 2009 12:20 pm    Post subject: Reply to: How to remove High-values in the Alphamumeric fiel
Reply with quote

The INSPECT REPLACING statement should do the job.
Back to top
View user's profile Send private message
itjagadesh

New User


Joined: 05 Dec 2006
Posts: 89
Location: chennai

PostPosted: Mon Jul 06, 2009 12:42 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Mon Jul 06, 2009 2:52 pm    Post subject:
Reply with quote

Reference modification -- the COBOL Language Reference manual will give you the details.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Mon Jul 06, 2009 5:24 pm    Post subject: Reply to: How to remove High-values in the Alphamumeric fiel
Reply with quote

Click on this link -

http://ibmmainframes.com/viewtopic.php?p=143786&highlight=#143786

Although the result of the above link is a left-justified value, adapting the logic to right-justification should not be too much of a chore.

Regards,
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Mon Jul 06, 2009 5:27 pm    Post subject:
Reply with quote

This sounds like another student exercise. Especially since the data conflicts with the problem statement:
Quote:
01 Ws-Name Pic X(04).
versus
Quote:
David
0John
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Jul 06, 2009 8:22 pm    Post subject: Reply to: How to remove High-values in the Alphamumeric fiel
Reply with quote

Quote:
This sounds like another student exercise.
And we get more and more of these.

In addition to the student forum, http://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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm
No new posts Working with hex values in Filemanage... Emile Straker IBM Tools 0 Tue Sep 12, 2017 1:42 am
No new posts DB2 NULL Values display V S Amarendra Reddy DB2 3 Thu Sep 07, 2017 6:59 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us