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

SMF type define as "floating", how COBOL to handle


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

New User


Joined: 08 Mar 2009
Posts: 15
Location: Taipei, Taiwan

PostPosted: Sun Apr 12, 2009 4:35 am
Reply with quote

SMF type 71, the SMF71ASI is the Number of page-ins from auxiliary storage for shared page group, it is defined as length 8, and format is “floating”. How to define this filed with COBOL pic, is X or 9, and the length. How to use MOVE to get this number to print?
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: Sun Apr 12, 2009 4:44 am
Reply with quote

Have you looked at the manual?
COMPUTATIONAL-1
or COMP-1 (floating-point) Specified for internal floating-point items (single precision). COMP-1 items are 4 bytes long.
COMPUTATIONAL-2
or COMP-2 (long floating-point) Specified for internal floating-point items (double precision). COMP-2 items are 8 bytes long.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Sun Apr 12, 2009 4:53 am
Reply with quote

Gary,

As much as this may seen strange, an eight byte floating item/field in COBOL is defined as COMP-2 with no picture clause and (FWIW) a four byte floating point item/field is defined as COMP-1, with no picture clause.

Code:

03  WS-FLOAT-LONG COMP-2.
03  WS-FLOAT-SHORT COMP-1.


COBOL will convert this to a displayable value successfully, nearly all of the time (hence, the caveat).

Please review the appropriate COBOL Programming Guide for notes regarding conversion results and possible loss of significance.

Regards,
Back to top
View user's profile Send private message
Gary Lin
Warnings : 1

New User


Joined: 08 Mar 2009
Posts: 15
Location: Taipei, Taiwan

PostPosted: Sun Apr 12, 2009 4:56 am
Reply with quote

I do read the manual, please draw up the satement, for cobol defines as PIC x(??) or pic 9(??) , indicate the ?? length number in working storage , and how to use MOVE to get this number in procedure?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Sun Apr 12, 2009 5:11 am
Reply with quote

Quote:
and how to use MOVE to get this number in procedure?
Heck, a MOVE is a move, just move the dang thing from what it is to what you want it to be....
Back to top
View user's profile Send private message
Gary Lin
Warnings : 1

New User


Joined: 08 Mar 2009
Posts: 15
Location: Taipei, Taiwan

PostPosted: Sun Apr 12, 2009 6:23 am
Reply with quote

highly appreciate your help, it works as expectations.
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: Sun Apr 12, 2009 7:45 am
Reply with quote

Good to hear it is working - thanks for letting us know icon_smile.gif

d
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts DTL - how to define key with stacked ... TSO/ISPF 3
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top