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
 

 

Need to know the MOVE VERB function ...........

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

New User


Joined: 11 Jan 2008
Posts: 66
Location: India

PostPosted: Fri Mar 27, 2009 1:45 am    Post subject: Need to know the MOVE VERB function ...........
Reply with quote

Hi,
Code:
WORKING-STORAGE SECTION.                   
01 VAR1  PIC X(10) VALUE 'CTS'.             
01 VAR2  PIC X(10) VALUE 'TCS'.             
01 VAR3  PIC X(4) VALUE 'INFY'.             
01 VAR4  PIC X(10) VALUE 'INFOSYS'.         
01 VAR5  PIC X(10) VALUE 'KEANE'.           
01 VAR6  PIC X(10) VALUE SPACES.           
01 VAR7  PIC X(10) VALUE SPACES.           
01 VAR8  PIC A(10) VALUE 'RAJULAN'.         
01 VAR9  PIC A(10) VALUE SPACES.           
01 VAR10 PIC 9(4) VALUE 1234.               
01 VAR11 PIC 9(4) VALUE 0.                 
01 VAR12 PIC 9(4) VALUE ZERO.     
PROCEDURE DIVISION.               
PARA-BEGIN.                       
    MOVE VAR4 TO VAR1.           
    DISPLAY VAR1.                 
    MOVE VAR8 TO VAR7.           
    DISPLAY VAR7.                 
    MOVE VAR10 TO VAR6.           
    DISPLAY VAR6.                 
    MOVE VAR3 TO VAR12.           
    DISPLAY VAR12.               



output:

INFOSYS
RAJULAN
1234
INF8

I think last output supposed to be INFY..but why is it displaying as inf8?

Thanks,
Rajulan R.C
Back to top
View user's profile Send private message

rajulan

New User


Joined: 11 Jan 2008
Posts: 66
Location: India

PostPosted: Fri Mar 27, 2009 1:58 am    Post subject: Reply to: Need to know the MOVE VERB function ...........
Reply with quote

I tried all the possiblities alphanumeric to numeric , alphabetic; numeric, alphabetic to alphanumeric and so on..only thing we can not do is alphabetic to numeric and numeric to alphabetic ...then we do we get soc4 and soc7?
big confustion i have ...
i have tested the possibilities...so i do not think i no need to look for the previous posts...kindly suggest me...

Thanks,
rajulan r.c
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri Mar 27, 2009 2:06 am    Post subject:
Reply with quote

Since you specified VAR12 as unsigned, COBOL insured that the high haqlf of the last digit was a hex 'F'......
Make it S9(4) and see what happens then.....
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Mar 27, 2009 2:06 am    Post subject:
Reply with quote

what is the hex value for 'Y'.

also, why are you doing MOVEs instead of NUMVAL,
which is the function to be used to 'move' alpha to numerics?
Back to top
View user's profile Send private message
rajulan

New User


Joined: 11 Jan 2008
Posts: 66
Location: India

PostPosted: Fri Mar 27, 2009 2:14 am    Post subject:
Reply with quote

To dick,

000001 Y
E4444444444444444444444444444
80000000000000000000000000000
To CiCs guy,

INFOSYS
RAJULAN
1234
INFH

thanks,
Rajulan R.C
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7990
Location: Bellevue, IA

PostPosted: Fri Mar 27, 2009 3:06 am    Post subject:
Reply with quote

Quote:

I tried all the possiblities alphanumeric to numeric , alphabetic; numeric, alphabetic to alphanumeric and so on..only thing we can not do is alphabetic to numeric and numeric to alphabetic ...then we do we get soc4 and soc7?
big confustion i have ...
i have tested the possibilities...so i do not think i no need to look for the previous posts...kindly suggest me...
Actually, not even close ... where's your COMP, COMP-1, COMP-2, COMP-3 variables? A numeric DISPLAY variable does not behave the same as a numeric COMP variable nor like a COMP-3 variable. Have you read the COBOL manuals (link at the top of the page) on moves? If not, you really need to start by reading the manuals (both Language Reference and Programming Guide), which will clear up most of your confusion. The LR, for example, in its discussion of elementary moves (just elementary items) defines 10 different types of sending fields and 9 types of receiving fields and discusses which of the 90 possible moves are allowed, with footnotes.
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 DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 8 Wed Jan 25, 2017 8:24 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:23 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:21 pm
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm


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