IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

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


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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: 2146
Location: At my coffee table

PostPosted: Fri Mar 27, 2009 2:06 am
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
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Mar 27, 2009 3:06 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Calling an Open C library function in... CICS 1
No new posts DATE2 function SYNCSORT 15
No new posts Help on PL/I jsonPutValue function PL/I & Assembler 8
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts how to use Tso outtrap external function All Other Mainframe Topics 8
Search our Forums:

Back to Top