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 help in understanding the Move verb.

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

New User


Joined: 05 May 2011
Posts: 1
Location: India

PostPosted: Fri Mar 30, 2012 2:47 pm    Post subject: Need help in understanding the Move verb.
Reply with quote

Could you please explain how the movement in cobol occurs?
Suppose I have an alphanumeric literal defined as x(1) and an numeric lietral defined as 9(1). How does the movement ocurs? Suppose the alphanumeric literal has the value 'A' and the numeric literal has the value 0 . I moved alphanumeric literal to the numeric literal, the numeric literal displays the value as '1' when displayed. How this happens? I know that 'A' has the equivalent value 'F1'(first four bits as F and last four bits as 1) when viewed in the hexadecimal mode, but is it the the case whenever a non numeric value is moved into a numeric field then the equivalent numeric value in the hexadecimal form for the non numeric field is moved into the numeirc field. ALso since all characters in cobol are in EBCDIC format(in which one byte is divided into two 4 bits zone, where the first four bits consitute the zone and the last four bits constitute the digits), does the movement of only first four bits occurs?

I already know that we should avoid doing so, but just need a clarification.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7306

PostPosted: Fri Mar 30, 2012 3:35 pm    Post subject: Reply to: Need help in understanding the Move verb.
Reply with quote

You have to get your terms straight.

PIC 9 VALUE 1, is not a numeric literal. A numeric literal is, for instance, 1. The part after the word VALUE is a literal, but the data-item you are defining is not a literal. Similarly with the alpha-numeric. "THIS" is a literal. PIC X(4) VALUE "THIS" is a data-item with an initial value established by writing the literal "THIS".

You whole post in in similar half-grasped terms. It would take too long to go through everything. Take your own post. Assume that you know nothing about the subject. Look up everything in manuals. See what you still don't understand and post again.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Fri Mar 30, 2012 4:55 pm    Post subject:
Reply with quote

The lack of understanding you display in a single post is awe-inspiring. Your questions cannot be answered in a forum like this, as someone needs to sit you down and spend WEEKS teaching you the fundamentals of COBOL -- not a role for a forum like this.

Your best way to derive an answer is going to be to find the COBOL Language Reference and Programming Guide manuals (hint: there's a link to them at the top of this page), and start reading. You need to read AT LEAST sections 1.39 on Literals, 5.1.6 on Data relationships, and 5.3 on Data division - data description entry to even begin to understand the answer to your question. Don't worry -- if you print them out, that's only 93 pages you need to read. But reading both manuals, cover to cover, would do you a WORLD of good.

And, by the way, the letter A in EBCDIC is x'C1', not x'F1' -- which is a number 1. You also need to spend some time learning the EBCDIC collating sequence, too.
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
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm


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