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
 
Can we move any data from Alphanumeric to Comp-3 variables?

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

Active User


Joined: 02 Jul 2005
Posts: 124
Location: Gurgaon

PostPosted: Mon Feb 19, 2007 10:24 am    Post subject: Can we move any data from Alphanumeric to Comp-3 variables?
Reply with quote

Hi all,
can we move any data from alphanumeric to comp-3 or comp variables?
or do we need to move initially from alphanumeric to numeric and then move to comp variables?

Thanks!
Rathna.
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Mon Feb 19, 2007 10:52 am    Post subject:
Reply with quote

Hi There,

Topic is already discussed

http://ibmmainframes.com/viewtopic.php?t=16807&highlight=alphanumeric+comp3
Back to top
View user's profile Send private message
crrindia

Active User


Joined: 02 Jul 2005
Posts: 124
Location: Gurgaon

PostPosted: Tue Feb 20, 2007 5:29 pm    Post subject:
Reply with quote

Hi Ekata, I have gone thru that link but i couldn't understand the solution from the link
if you have any idea please let me know.

Thanks!
Rathna.
Back to top
View user's profile Send private message
arindam111

New User


Joined: 29 Nov 2006
Posts: 27
Location: India

PostPosted: Tue Feb 20, 2007 5:39 pm    Post subject:
Reply with quote

I have just ran this code, it works. Its self explanetory.
Code:

IDENTIFICATION DIVISION.   
PROGRAM-ID. TEST4.         
ENVIRONMENT DIVISION.       
DATA DIVISION.             
WORKING-STORAGE SECTION.   
                           
77 A PIC X(4) VALUE '9999'.
77 B PIC 9(4) COMP-3.       
                           
PROCEDURE DIVISION.         
1000-MAIN-PARA.             
      MOVE A TO B.         
      DISPLAY "B= " B.     
1000-EXIT.                 
     STOP RUN.             
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: Tue Feb 20, 2007 9:56 pm    Post subject:
Reply with quote

Hello,

If you do this, you must first check the x field for a valid numeric value. If the value in the A field were changed to 'QQ2*' you will have problems.
Back to top
View user's profile Send private message
sachin_star3
Warnings : 1

New User


Joined: 30 Sep 2006
Posts: 78
Location: pune

PostPosted: Fri Feb 23, 2007 2:52 pm    Post subject:
Reply with quote

yes dick is rigth
if the alphanumeric contains the numeric value
then then it works
but if alphanumeris contains othere than numeric value then it not works
soc7 or maxcc
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 Data security erase on RAID device steve-myers All Other Mainframe Topics 0 Sat Jan 13, 2018 6:41 am
No new posts Append the milliseconds to the data s... girishb2 DFSORT/ICETOOL 1 Thu Dec 21, 2017 9:07 pm
No new posts COMP Variables Mismatch gayu7 COBOL Programming 5 Wed Dec 20, 2017 5:06 pm
No new posts Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm

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