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

Instead of COMP-3 to COMP-2 or COMP-1


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vicky10001
Warnings : 1

Active User


Joined: 13 Jul 2005
Posts: 136

PostPosted: Tue Apr 08, 2008 5:08 pm
Reply with quote

Declaration

A - S9(10)V9(7) comp-3.
F - S9(7)V9(10) COMP-3.
KA - S9(7)V9(10) COMP-3.

PWA - 99v99.

COMPUTE A = A +
(PWA - AH(PINDX1 PINDX2) * (F ** K))

here I calculating A value. This code is working fine but its consuming more CPU time so I want to change instead of comp-3 to comp2 or comp-1 (which place I can use comp-2 or comp-1 Please let me know)

Please let me know how can change comp-3 to comp-2 or comp-1. It will give improvement or not.

Comp-3 will occupy the 9 bytes but we are converting comp-3 to comp-2 it will occupy the 8 bytes so we need to change layout also other How?


Could you please advise on this?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Apr 08, 2008 5:12 pm
Reply with quote

make all your variables of the same type, suggest packed-decimal.

you have a mix of comp-3 and display.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Apr 08, 2008 7:11 pm
Reply with quote

vicky10001 wrote:
A - S9(10)V9(7) comp-3.
F - S9(7)V9(10) COMP-3.
KA - S9(7)V9(10) COMP-3.

PWA - 99v99.

COMPUTE A = A +
(PWA - AH(PINDX1 PINDX2) * (F ** K))
Is KA AH?
Or is A AH and KA K?
Are all fields variable for all calculations or are some fairly constant?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Apr 08, 2008 7:25 pm
Reply with quote

1. don't send me private messages.

2. you did not respond to either reply. what you have provided is garbage. you have variables in your compute that you have not declared.

read up on the compute statement in the programmer manual for your version of cobol.

if you think making them binary will help, you need to read.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Apr 08, 2008 9:04 pm
Reply with quote

Hello,

Quote:
but its consuming more CPU time
More cpu time compared to what?

How were cpu statistics for these few instructions gathered?

As was mentioned, when you're asked for info, you need to provide it. . .
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 Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
No new posts Interviewers are surprised with my an... Mainframe Interview Questions 6
No new posts Cobol COMP-2 fields getting scrambled... Java & MQSeries 6
No new posts convert alphanumeric PIC X(02) to hex... COBOL Programming 3
Search our Forums:

Back to Top