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
 

 

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 copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts NDM syntax checking without actually ... GAPX1 All Other Mainframe Topics 0 Wed Jun 07, 2017 2:36 am


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