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 Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 0 Mon Jan 02, 2017 11:16 am
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am


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