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

summing on cobol comp-2 fields


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
red_roses

New User


Joined: 31 Oct 2005
Posts: 27

PostPosted: Wed Jun 21, 2006 2:48 pm
Reply with quote

I need to sum up fields that are defined as comp-2 in cobol.

so my sort cardl ooks like

sort fields=(1,7,ch,a)
sum fields=(27,8),format=??

what should the format be as in this case..?? in teh copybook the sum field is defined as Comp-2
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 183
Location: hyderabad

PostPosted: Wed Jun 21, 2006 5:38 pm
Reply with quote

Hi,
Try with format 'FL' .

Thank you
Krishy
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Jun 21, 2006 8:18 pm
Reply with quote

red,

Krishy is right. See the table of COBOL data types vs DFSORT formats at:

www.ibm.com/servers/storage/support/software/sort/mvs/professor_sort/srtmacfm.html

Note that comp-2 is an 8-byte FL (floating point) value, so you can use these DFSORT control statements:

Code:

  SORT FIELDS=(1,7,CH,A)
  SUM FIELDS=(27,8),FORMAT=FL
Back to top
View user's profile Send private message
red_roses

New User


Joined: 31 Oct 2005
Posts: 27

PostPosted: Wed Jun 21, 2006 9:00 pm
Reply with quote

thnx
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 2
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 Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top