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

Need help in understanding the Move verb.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Mar 30, 2012 3:35 pm
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: 8697
Location: Dubuque, Iowa, USA

PostPosted: Fri Mar 30, 2012 4:55 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
No new posts How to move DB2 Installation HLQ DB2 4
No new posts How to move values from single dimens... COBOL Programming 1
This topic is locked: you cannot edit posts or make replies. regarding COBOL WRITE verb (VB File H... COBOL Programming 9
Search our Forums:

Back to Top