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
 
Doubt reg Ref. Modification

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

New User


Joined: 17 Feb 2004
Posts: 19
Location: pune

PostPosted: Wed Oct 26, 2005 10:09 am    Post subject: Doubt reg Ref. Modification
Reply with quote

Hi,
I have to fields with the following format
05 WS-IN-STRING PIC X(13)
05 PV-TOT-OOP-AMT PIC S9(11)V99

1. So here my doubt is if i say
MOVE WS-IN-STRING(2:11) TO PV-TOT-OOP-AMT(2:11)
What would be the Result?

2. In the same way if i say

MOVE PV-TOT-OOP-AMT(2:11) TO WS-IN-STRING(2:11)
What wud b the result?

3. Can i move WS-IN-STRING to PV-TOT-OOP-AMT ?
For this case the mannulas says that we r not supposed to move Alphanumeric values to Numeric Values....
Back to top
View user's profile Send private message

ikumar

New User


Joined: 02 Aug 2005
Posts: 81

PostPosted: Wed Oct 26, 2005 6:16 pm    Post subject: Re: Doubt reg Ref. Modification
Reply with quote

YOu cannot use reference modification on numeric data-items...i think, the answer for first two questions would be compilation errors.

3) You can move if you have digits/signs in your string.

Please let me know if i am wrong.

Cheers,
Kumar.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Fri Oct 28, 2005 4:08 am    Post subject:
Reply with quote

Hi Reddy,

You CAN use DISPLAY numeric fields w/refmod. Whatever the sending field contains is moved WITHOUT conversion to the receiving field. Of course the positions and lengths you choose are used.

The move is done according to the rules for a group move, i.e. NO conversion of data.
Back to top
View user's profile Send private message
rsshanmugam

New User


Joined: 08 Mar 2005
Posts: 54
Location: Chennai

PostPosted: Fri Oct 28, 2005 11:19 am    Post subject:
Reply with quote

the first two move is valid unless the alphanumeric value contains numeric value otherwise you get run time error.

regarding third move what mmwife said is correct.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Oct 29, 2005 4:34 am    Post subject:
Reply with quote

You will NOT get an error using refmod in the 1st 2 cases. They are treated as GROUP moves.

Try it . You'll see that I'm correct.

Re. the 3rd case, see "When the sending item is alphanumeric" below. This is from the Zos Cobol manual. The move will be successful (even w/alpha chars) but any arith functions will fail.

Quote:
The following rules outline the execution of valid elementary moves. When the receiving field is:

Numeric or Numeric-edited:

Except where zeros are replaced because of editing requirements, alignment by decimal point and any necessary zero filling take place, as described under "Alignment rules" in topic 5.1.6.6.

If the receiving item is signed, the sign of the sending item is placed in the receiving item, with any necessary sign conversion. If the sending item is unsigned, a positive operational sign is generated for the receiving item.

If the receiving item is unsigned, the absolute value of the sending item is moved, and no operational sign is generated for the receiving item.

When the sending item is alphanumeric, the data is moved as if the sending item were described as an unsigned integer.

When the sending item is floating-point, the data is first converted to either a binary or internal decimal representation and is then moved.

De-editing allows moving a numeric-edited data item into a numeric or numeric-edited receiver. The compiler accomplishes this by first establishing the unedited value of the numeric-edited item (this value can be signed), then moving the unedited numeric value to the receiving numeric or numeric-edited data item.
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 Doubt in MFS abdulrafi IMS DB/DC 2 Fri Oct 21, 2016 3:09 pm
No new posts Doubt on GETMAIN, FREEMAIN behaviour Arunkumar Chandrasekaran CICS 3 Sun Aug 30, 2015 9:22 pm
No new posts Doubt in using command code O Appu IMS DB/DC 4 Tue Jan 13, 2015 3:14 pm
No new posts Doubt in using command code D and N t... Appu IMS DB/DC 7 Mon Dec 29, 2014 5:52 pm
No new posts CICS configuration and modification g... Saikat Sengupta CICS 3 Fri Jul 18, 2014 3:04 pm

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