Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Want to move the value from S9(16)V99 comp-3 to x(50)

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

Active User


Joined: 01 Feb 2007
Posts: 113
Location: India

PostPosted: Thu Jul 26, 2007 4:37 pm    Post subject: Want to move the value from S9(16)V99 comp-3 to x(50)
Reply with quote

Hi,

i had a query regarding the movements of values.

When i am trying to move negative values or decimal values to an alphanumeric field i am getting some junk values.
Is this movement not possible?
The below are my actual movements i need
i want to move the value from S9(16)V99 comp-3 to x(50)
How can i do this.

Also can anyone please tell me where can i find all possible movements.
Back to top
View user's profile Send private message

William Thompson

Global Moderator


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

PostPosted: Thu Jul 26, 2007 4:47 pm    Post subject:
Reply with quote

What do you consider "junk values"? The last digit?
The move is possible, but without editing, the sign and decimal point will be a problem.
Back to top
View user's profile Send private message
shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Thu Jul 26, 2007 4:47 pm    Post subject: Re: Compatibility of movements
Reply with quote

hi bhasker,

You can;t view comp-3 value. You need to convert COmp-3 value to numeric (display format) before moving to X(50).

~Vamsi
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: Fri Jul 27, 2007 3:29 am    Post subject:
Reply with quote

Hello,

To move from comp-3 to pic x, you should move thru an intermediate zoned decimal field.

Quote:
Also can anyone please tell me where can i find all possible movements.

The link below shows valid and invalid elementary moves. That link is inside the COBOL Language Reference linked to via the "Manuals" link at the top of the web page.
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/igy3lr10/6.2.24.1?SHELF=&DT=20020920180651&CASE=
Back to top
View user's profile Send private message
bhaskar_kanteti

Active User


Joined: 01 Feb 2007
Posts: 113
Location: India

PostPosted: Fri Jul 27, 2007 8:57 am    Post subject: Re: Compatibility of movements
Reply with quote

Hi,

[/quote]To move from comp-3 to pic x, you should move thru an intermediate zoned decimal field.
Quote:


You mean to say S9(13)V9(2) COMP-3 to 9(13)V9(2) and then to x(20).
Is this correct.

Or is this movement correct. I will move S9(13)V(2) COMP-3 to the below group variable and then to x(20). Is this correct.
10 group-varibale.
15 var-1 pic 9(13).
15 var-2 pic x(1) value '.'.
15 var-3 pic 9(2).

I am trying all the ways. If any one has any idea tell me.
Back to top
View user's profile Send private message
Umamaheswari K

New User


Joined: 23 May 2007
Posts: 2
Location: chennai

PostPosted: Fri Jul 27, 2007 9:30 am    Post subject: Re: Compatibility of movements
Reply with quote

You could use edited picture clause. first move comp-3 variable value to the edited picture clause variable. Then you could move that edited variable to the alphanumeric variable.This would be easy .

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

Global Moderator


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

PostPosted: Fri Jul 27, 2007 1:46 pm    Post subject:
Reply with quote

Right justified?

01 from9 pic S9(16)V99 comp-3
01 tox pic x(50)
01 temp pic -z(15)9.99
move from9 to temp
move temp to tox
display tox

01 tox
05 temp pic -z(35)9.99
move from9 to temp
display tox

left justified?

01 filler
05 tox pic x(50) value spaces
05 temp redefines tox pic -z(15)9.99
move from9 to temp
display tox
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: Fri Jul 27, 2007 7:27 pm    Post subject:
Reply with quote

Hello,

Depending on how you need the output from the move, you could use various techniques.
Quote:
You mean to say S9(13)V9(2) COMP-3 to 9(13)V9(2) and then to x(20).
This move will get numbers you can see in the pic x field, but there will be no decimal point shown and no minus sign if the value was negative. If the value was negative you would get the letter J thru the letter R (-1 to -9) or one of these ({ } - i don't recall which is -zero).

If you want to see the "-" and the decimal point, you could use "01 temp pic -z(15)9.99 " as Bill suggests.
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
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
This topic is locked: you cannot edit posts or make replies. Alphanumeric to Numeric move on UNIX mistah kurtz COBOL Programming 16 Wed Jul 27, 2016 8:47 pm
No new posts Need information on COBOL MOVE CORRES... subratarec COBOL Programming 10 Tue Jun 28, 2016 10:38 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us