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
 

 

data movement from comp-3 to comp-4

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

New User


Joined: 06 Nov 2008
Posts: 2
Location: mumbai

PostPosted: Thu Nov 06, 2008 12:51 pm    Post subject: data movement from comp-3 to comp-4
Reply with quote

Hi,

Please let me know how the data movement from comp-3 to comp-4 takes place. I have the following variables from which the data is to be moved-
VarA PIC S9(3)V999 COMP-3.
VarB PIC S9(6)V99 COMP-4.

I am moving value of VarA to VarB
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Nov 06, 2008 1:11 pm    Post subject:
Reply with quote

top of the page are buttons for manuals. look for a cobol application programmers guide.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Thu Nov 06, 2008 1:33 pm    Post subject:
Reply with quote

Code:
VarB PIC S9(6)V99 COMP-4.

Are you sure if such a declaration is possible? I mean use of V in a COMP-4 item.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2238
Location: @my desk

PostPosted: Thu Nov 06, 2008 1:58 pm    Post subject:
Reply with quote

Enterprise COBOL Programming Guide wrote:
BINARY, COMP, and COMP-4 are synonyms.

If that's the case, what's wrong in having a "V"? It'll be just like moving a COMP-3 item to a COMP item. I can't see anything other than the 3rd decimal place getting truncated and some leading zeroes.
Back to top
View user's profile Send private message
jayateerth

New User


Joined: 06 Nov 2008
Posts: 2
Location: mumbai

PostPosted: Thu Nov 06, 2008 2:27 pm    Post subject: Reply to: data movement from comp-3 to comp-4
Reply with quote

Yes. I have seen it in use in few programs
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Thu Nov 06, 2008 2:43 pm    Post subject:
Reply with quote

I always thought only COMP-5 among the binary items can have scaling factor, obviously I misinterpreted the manual.
Thanks arun.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Thu Nov 06, 2008 6:22 pm    Post subject:
Reply with quote

Quote:
I always thought only COMP-5 among the binary items can have scaling factor, obviously I misinterpreted the manual.
You're misinterpreting in more than one way -- P is the scaling factor, V is assumed decimal place. The presence of a P in the PICTURE implies a V, but a V can be present without a P (and frequently is). Furthermore, from the Language Reference:
Quote:
The PICTURE of a computational item can contain only:

9
One or more numeric character positions
S
One operational sign
V
One implied decimal point
P
One or more decimal scaling positions

COMPUTATIONAL-1 and COMPUTATIONAL-2 items (internal floating-point) cannot have PICTURE strings.
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 Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm
No new posts JCL to get submitted once dataset has... vinu78 JCL & VSAM 17 Thu Feb 16, 2017 7:32 am


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