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 simple DECIMAL to CHAR

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

New User


Joined: 31 Aug 2005
Posts: 23

PostPosted: Tue Jan 30, 2007 4:24 pm    Post subject: Move simple DECIMAL to CHAR
Reply with quote

this is what i want,,,

ws-b-caliper is 0.030
to be
zz-b-caliper 030 (only decimals in char attribute)

BELOW coding is not working...

MOVE WS-B-CALIPER TO ZZ-B-CALIPER
MOVE ZZ-B-CALIPER TO XX-B-CALIPER

01 WS-B-CALIPER PIC 9V999 COMP.
01 ZZ-B-CALIPER PIC 9V999.
01 XX-B-CALIPER PIC X(4).

"ZZ-B-CALIPER (NUMERIC NON-INTEGER)" AND "XX-B-CALIPER (ALPHANUMERIC)" DID NOT FOLLOW COMPATIBILITY RULES. THE STATEMENT WAS DISCARDED.

Any idea?

Thanks in advance,
Jordi
Back to top
View user's profile Send private message

prav_06
Warnings : 1

Active User


Joined: 13 Dec 2005
Posts: 154
Location: The Netherlands

PostPosted: Tue Jan 30, 2007 4:34 pm    Post subject:
Reply with quote

Very simple U cannot move a assumed decimal variable to alphanumeric variable, but if ya try to move a numeric varible with no assumed decimal point it would work icon_biggrin.gif

Cheer's,

Thamilzan.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Tue Jan 30, 2007 4:37 pm    Post subject:
Reply with quote

Code:
01  filler.
   05 WS-B-CALIPER PIC 9V999 COMP.
   05 ZZ-B-CALIPER PIC 9V999.
   05 XX-B-CALIPER redefines zz-b-caliper PIC X(4).


MOVE WS-B-CALIPER TO ZZ-B-CALIPER
now XX-B-CALIPER is "0030"
Back to top
View user's profile Send private message
mshashio

New User


Joined: 24 Apr 2006
Posts: 4

PostPosted: Tue Jan 30, 2007 5:17 pm    Post subject: Re: Move simple DECIMAL to CHAR
Reply with quote

Define 01 ZZ-B-CALIPER PIC 9V999 as
01 ZZ-B-CALIPER PIC 9.999
then it will work
Back to top
View user's profile Send private message
jruiza

New User


Joined: 31 Aug 2005
Posts: 23

PostPosted: Tue Jan 30, 2007 10:19 pm    Post subject: Re: Move simple DECIMAL to CHAR
Reply with quote

IT'S WORKING NOW


T H A N K S
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Wed Jan 31, 2007 7:23 am    Post subject:
Reply with quote

The simplest solution:

Code:
 MOVE WS-B-CALIPER TO ZZ-B-CALIPER
MOVE ZZ-B-CALIPER(2:) TO XX-B-CALIPER

If you want a leading space code XX-B-CALIPER with VALUE SPACE then

MOVE ZZ-B-CALIPER(2:) TO XX-B-CALIPER(2:)

If you want a leading zero code XX-B-CALIPER with VALUE ZERO and MOVE accordingly.
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 Select numeric portion from CHAR data... balaji81_k DB2 6 Sat Aug 19, 2017 1:51 am
No new posts Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm
No new posts Joinkeys with decimal scdinesh DFSORT/ICETOOL 3 Fri Feb 10, 2017 4:46 am
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm

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