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
 
Moving Comp-3 to a Comp variable.

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

New User


Joined: 23 Oct 2003
Posts: 6

PostPosted: Thu Dec 04, 2003 6:20 pm    Post subject: Moving Comp-3 to a Comp variable.
Reply with quote

Hi,
1. it possible to move a comp-3 field to a comp field or display field and vice versa..

2. it possible to redefine a field with comp-3 status to a comp status.

Thanks & regards,
Arun
Back to top
View user's profile Send private message

mdtendulkar

Active User


Joined: 29 Jul 2003
Posts: 238
Location: USA

PostPosted: Thu Dec 04, 2003 8:27 pm    Post subject:
Reply with quote

Hello,

1)
For PACKED-DECIMAL there are 2 digits for each character position, except for the trailing character position, which is occupied by the low-order digit and the sign. Such an item can contain any of the digits 0 through 9, plus a sign, representing a value not exceeding 18 decimal digits.


COMP-3 to NUMERIC NO....as since it contains sign fields, it can give S0C7
NUMERIC to COMP-3 YES

COMP-3 to COMP NO....Higher range to Lower range data movement is not possible
COMP to COMP-3 YES


2)
I am not too sure about this thing.
Will get back to you.

Hope this helps.

Regards

Mayuresh Tendulkar
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Fri Dec 12, 2003 12:00 am    Post subject:
Reply with quote

Hi Mayuresh,

I'm not aware of any restrictions on moves from one numeric data type to another, provided that the field lengths are adequate to accommodate conversion of the digits (e.g.. 123C to F1F2C3). Unless I'm misreading what you wrote.

Arun,

You can do the kind of redefine you mentioned, but you have to be very careful when you use the field (I wouldn't reccommend it). You must be aware of the kind of data that is in the field at the time you use it. For example, if you moved packed data in at some point but then forget and attempt to move it out using the COMP field name, the data conversion will be wrong causing an 0C7 when the receiving field is used in an arithmetic expression.

Another caution when doing that kind of redefines: you must define both fields so that they are the same length (NOT the same number of 9s).

Regards, Jack.
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 Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts CONDITIONAL USING COMP-2 WITH PROBLEMS. JOSUEGENTIL COBOL Programming 7 Wed Nov 08, 2017 11:13 pm
No new posts how can i move s9(9) to s9(9) usage comp HARENDRA CHOUDHARY COBOL Programming 3 Mon Nov 06, 2017 12:10 am
No new posts Move from Comp3 variable to Edited Va... Revathy.nair0485 COBOL Programming 7 Fri Nov 03, 2017 3:30 pm

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