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
 
Move A/N to numeric shows some junk value in last byte

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
shanudarling
Warnings : 1

New User


Joined: 20 Dec 2006
Posts: 55
Location: noida

PostPosted: Wed Apr 18, 2007 11:30 am    Post subject: Move A/N to numeric shows some junk value in last byte
Reply with quote

I get a prob........

i have a map varible x(10)....... and a file variable 9(10).

when i receve a value from a map and populate file field values.... then it show some junk value in last byte

01 m-var1 pic x(10)...............(Map variable)

m-var1 = 123456 ...........(only 6 digit)

pgm...

01 ws-var1 pic 9(10) value zeores.

move m-var1i to ws-var1.

ws-var1= 123456 0 (it shows zero or junk value in last byte....WHY??)
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10327
Location: italy

PostPosted: Wed Apr 18, 2007 11:48 am    Post subject: Re: what is aexl...........
Reply with quote

THIS IS A DIFFERENT PROBLEM;

many of us watch are notified when a reply is posted, it is disturbing to receive emails related to a completely different subject

regards
Back to top
View user's profile Send private message
shanudarling
Warnings : 1

New User


Joined: 20 Dec 2006
Posts: 55
Location: noida

PostPosted: Wed Apr 18, 2007 12:35 pm    Post subject: move A/N to numeric.....
Reply with quote

get a prob........

i have a map varible x(10)....... and a file variable 9(10).

when i receve a value from a map and populate file field values.... then it show some junk value in last byte

01 m-var1 pic x(10)...............(Map variable)

m-var1 = 123456 ...........(only 6 digit)

pgm...

01 ws-var1 pic 9(10) value zeores.

move m-var1i to ws-var1.

ws-var1= 123456 0 (it shows zero or junk value in last byte....WHY??)
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Wed Apr 18, 2007 1:01 pm    Post subject:
Reply with quote

Aren't you getting any abend?
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Wed Apr 18, 2007 1:32 pm    Post subject:
Reply with quote

Quote:
Aren't you getting any abend?

Why and what abend should he get?

shanu(darling) icon_lol.gif (I cant believe people will take such usernames icon_lol.gif ),
Try running XPEDITOR or any debugging tool available at your site, see the contents of m-var1, it may contain junk already and it is getting carried to 9(10) variable.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Wed Apr 18, 2007 2:45 pm    Post subject:
Reply with quote

Abhijit,

Quote:
Why and what abend should he get?


Shanu is moving an alphanumeric variable (PIC X(10) with 6 digits followed by 4 spaces) to a numeric variable.

Quote:
01 m-var1 pic x(10)...............(Map variable)

m-var1 = 123456 ...........(only 6 digit)

pgm...

01 ws-var1 pic 9(10) value zeores.

move m-var1i to ws-var1.


Is this kind of move possible?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Wed Apr 18, 2007 3:14 pm    Post subject: Re: move A/N to numeric.....
Reply with quote

murmohk1 wrote:
Shanu is moving an alphanumeric variable (PIC X(10) with 6 digits followed by 4 spaces) to a numeric variable.
Is this kind of move possible?
Of course it is, he did it, didn't he?
shanudarling wrote:
when i receve a value from a map and populate file field values.... then it show some junk value in last byte
You need to either define the map as numeric or take care moving the characters to the numeric field.
One way would be to use the intrinsic function NUMVAL.
Back to top
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Wed Apr 18, 2007 3:21 pm    Post subject:
Reply with quote

Have you practically tried this and seeking advice or is it a hypothetical question?
We can not move alphanumeric data type to numeric without ISNUMERIC check. And going by your data it is left justifying which is not possible for numeric data as the default is right justification.

Please supply enough and authentic data while posting the query so that you can get a prompt solution

Why dont you provide the exact code you tried with.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Wed Apr 18, 2007 7:13 pm    Post subject:
Reply with quote

This keeps coming again and again.
Alphanumeric to numeric movement is perfectly legal in COBOL.
You will get compilation error when you try to move Alphabetic (not alphanumeric) data to numeric variable.
Quote:
We can not move alphanumeric data type to numeric without ISNUMERIC check

This NUMERIC CHECK is not mandatory. You can very well move data between variables without numeric check.

@OP
How you have generated symbolic map? using tool or you have assumed it as X(10)? What is physical map defn for that field?
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Wed Apr 18, 2007 7:17 pm    Post subject:
Reply with quote

Little correction,
Please read,
You will get compilation error when you try to move Alphabetic (not alphanumeric) variable to numeric variable.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Thu Apr 19, 2007 9:15 am    Post subject:
Reply with quote

Abhijit,

Quote:
Alphanumeric to numeric movement is perfectly legal in COBOL.


You mean to say moving 123456bbbb (b=spaces) to PIC9(10) is legal?

I have not tried this, but curuios to read your reply.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Thu Apr 19, 2007 5:59 pm    Post subject:
Reply with quote

Quote:
I have not tried this, but curuios to read your reply.

I think I have already answered this.
Why don't you give it a try instead and let me know. Curious to read YOUR reply. icon_smile.gif
Back to top
View user's profile Send private message
socker_dad

Active User


Joined: 05 Dec 2006
Posts: 147
Location: Columbia, MO

PostPosted: Thu Apr 19, 2007 9:32 pm    Post subject: Re: Move A/N to numeric shows some junk value in last byte
Reply with quote

Interesting results.

I coded the following:

01 WS-VARIABLE PIC 9(10) VALUE ZEROES.
01 MAP-VARIABLE PIC X(10) VALUE '123456'.

PROCEDURE DIVISION.

MOVE MAP-VARIABLE TO WS-VARIABLE.

DISPLAY '----+----+----'.
DISPLAY WS-VARIABLE.
GOBACK.

And received no compile errors or execution errors. My output is:

----+----+----
123456

Not at all what I expected. Even changing the WS-VARIABLE to a signed COMP-3 field didn't change the results. However, when it was defined as a plain COMP field, the compile was good but the program abended because of "illegal characters in a numeric field".

Curioser and curioser. icon_confused.gif
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Thu Apr 19, 2007 10:14 pm    Post subject:
Reply with quote

Quote:
Not at all what I expected

What did you expect?

I think murali doesn't need to give it a try then, but if he does he can learn more..icon_smile.gif
socker_dad,
You have tried this in batch cobol but OP is facing some problem in CICS.
However OP hasn't replied about about physical map information..Lets wait for that..
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 -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm
No new posts Select numeric portion from CHAR data... balaji81_k DB2 6 Sat Aug 19, 2017 1:51 am

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