MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Moving Data from Numeric to Alphanumeric

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
venkata
Beginner


Joined: 31 Dec 2002
Posts: 16
Topics: 8
Location: India

PostPosted: Thu Jun 10, 2004 11:55 am    Post subject: Moving Data from Numeric to Alphanumeric Reply with quote

Dear all,

Can anybody tell how to move numeric data to alphanumeric variable?
say Numeric varible is S9(9)v99 comp-3 and alphanumeric variable is X(10).

I hope, I will get quick answer.


Thanks in advance,
Venkata
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Jun 10, 2004 12:40 pm    Post subject: Reply with quote

Venkata,

It will take just 2 seconds to do a test or refer the manual about rules of moving . You will get a IGYPA3005-S error when you try to move a comp-3 variable to Alpha numeric variable.

Check this link for rules of moving

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/igy3lr10/6.2.24.1?SHELF=&DT=20020920180651&CASE=

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
venkata
Beginner


Joined: 31 Dec 2002
Posts: 16
Topics: 8
Location: India

PostPosted: Thu Jun 10, 2004 12:44 pm    Post subject: Reply with quote

Hi Kolusu,

Thanks for your prompt reply.

Is there any solution for this?


Thanks,
Venkata
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Jun 10, 2004 2:09 pm    Post subject: Reply with quote

Venkata,

The solution depends on how you want to see the output.

Code:

01 WS-PACK               PIC S9(9)V99 COMP-3.
01 WS-NUM                PIC +9(9).99.       
01 WS-CHAR               PIC X(13).           
                                             
PROCEDURE DIVISION.                           
                                             
     MOVE -55.67   TO WS-PACK                 
     MOVE WS-PACK  TO WS-NUM                 
     MOVE WS-NUM   TO WS-CHAR                 
                                             
     DISPLAY 'WS-PACK   : ' WS-PACK           
     DISPLAY 'WS-CHAR   : ' WS-CHAR           
     DISPLAY 'WS-NUM    : ' WS-NUM           
     GOBACK.                                 


Will produce

Code:

WS-PACK   : 0000000556P   
WS-CHAR   : -000000055.67
WS-NUM    : -000000055.67


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
venkata
Beginner


Joined: 31 Dec 2002
Posts: 16
Topics: 8
Location: India

PostPosted: Thu Jun 10, 2004 6:18 pm    Post subject: Reply with quote

Thanks Kolusu. It helped me a lot.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group