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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Question related to Data dictionary f... rexx77 SYNCSORT 3 Thu Aug 31, 2017 7:23 am

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