Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
arulraj-ponnusamy

New User

Joined: 09 Jan 2007
Posts: 2
Location: Chennai

 Posted: Wed Jan 10, 2007 6:37 pm    Post subject: to get the numeric value in alphanumeric pic a pic x(10) value '255 555' b pic x(3) note size of and b is different now i want to get only the 1st value in a. i done it by using unstring e.g. unstring b delimited by space into a,c is there any other methods

William Thompson

Global Moderator

Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

Posted: Wed Jan 10, 2007 7:29 pm    Post subject: Re: to get the numeric value in alphanumeric pic

 arulraj-ponnusamy wrote: a pic x(10) value '255 555' b pic x(3) note size of and b is different now i want to get only the 1st value in a. i done it by using unstring e.g. unstring b delimited by space into a,c is there any other methods
I'm not clear as to what you are trying to do?? Move the first three bytes of a to b? O move b into the first three bytes of a? Where is c?
arulraj-ponnusamy

New User

Joined: 09 Jan 2007
Posts: 2
Location: Chennai

 Posted: Thu Jan 11, 2007 7:19 pm    Post subject: to get the numeric value in alphanumeric pic a pic x(10) value '255 555 ' a1 pic x(3) a2 pic x(3) b pic 9(3) c pic 9(3) note that the size of and b is different now i want to get only the 1st three numeric positions to b. i done it by using unstring e.g. unstring b delimited by space into a1,a2 then i move a1 to b move a2 to c if the size of a1= size of b then it works if b pic 9(4) then it shows spaces how to solve it? is there any other methods
kgumraj

Active User

Joined: 01 May 2006
Posts: 151

Posted: Thu Jan 11, 2007 7:20 pm    Post subject: Re: to get the numeric value in alphanumeric pic

Hi,

 Quote: a pic x(10) value '255 555' b pic x(3) note size of and b is different now i want to get only the 1st value in a. i done it by using unstring e.g. unstring b delimited by space into a,c is there any other methods

I assume your question to be like this,
Moving first bit of A to B..
correct me if I am wrong

For this you can use Partical Move
 Quote: MOVE A(1:1) TO B

Note that B contains "<first byte is A><Blank><Blank>"

Correct me is it other way round
William Thompson

Global Moderator

Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

Posted: Thu Jan 11, 2007 7:37 pm    Post subject: Re: to get the numeric value in alphanumeric pic

 arulraj-ponnusamy wrote: a pic x(10) value '255 555 ' a1 pic x(3) a2 pic x(3) b pic 9(3) c pic 9(3) note that the size of and b is different now i want to get only the 1st three numeric positions to b. i done it by using unstring e.g. unstring b delimited by space into a1,a2 then i move a1 to b move a2 to c if the size of a1= size of b then it works if b pic 9(4) then it shows spaces how to solve it? is there any other methods
move zero to b
move a(1:3) to b(length of b - length of a + 1:length of b)
should work....
mmwife

Super Moderator

Joined: 30 May 2003
Posts: 1592

 Posted: Fri Jan 12, 2007 6:02 am    Post subject: What's wrong w/"MOVE A TO B"? Or can A contain "12 1234" at another time?
dick scherrer

Site Director

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

 Posted: Fri Jan 12, 2007 7:36 am    Post subject: Hello, Methinks there is not a clear definition of what is desired. Why would we unstring b into a1 and a2? Is that a typo or am i just not getting it. . . . I don't believe i've seen a pic 9(3) or pic 9(4) display as spaces. Where do the spaces come in? Field a is pic x(10) but the value(s) in it come up short. Please repost and show examples of different possible input values and what you want the result to be when "the code" works properly. If it could occur in the input data, the '12 1234' example would be good to include.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Sort numeric fields with trailing spaces sancraig16 SYNCSORT 7 Tue Apr 03, 2018 1:21 am Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm Can a alphanumeric data be moved to a... nico_neoz COBOL Programming 10 Mon Oct 30, 2017 8:28 am File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us