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
 

 

How to Sum a particular field in vsam

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
arun23kiran

New User


Joined: 01 Sep 2006
Posts: 3

PostPosted: Fri Sep 01, 2006 6:41 pm    Post subject: How to Sum a particular field in vsam
Reply with quote

Hi,

Can anyone of you let me know how i can find the sum of a particular field in a vsam file? If possible, can you give me that piece of code?
Back to top
View user's profile Send private message

prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Fri Sep 01, 2006 7:44 pm    Post subject:
Reply with quote

I think you can repro the VSAM file into a sequential data set and then sort it into snother by using SUM FIELDS option
Back to top
View user's profile Send private message
arun23kiran

New User


Joined: 01 Sep 2006
Posts: 3

PostPosted: Fri Sep 01, 2006 7:51 pm    Post subject:
Reply with quote

hi prasad,

I want to do it directly on the VSAM file instead of using a repro and then using sum fields option. Is there any way out?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Fri Sep 01, 2006 8:46 pm    Post subject:
Reply with quote

You can use DFSORT directly for VSAM files. If the VSAM records are all fixed length, you can use this:

Code:

   RECORD TYPE=F
   SORT FIELDS=(p,m,f,s)
   SUM FIELDS=(p,m,f)


If the VSAM records are variable length, you can use this:

Code:

   RECORD TYPE=V
   SORT FIELDS=(p+4,m,f,s)
   SUM FIELDS=(p+4,m,f)


Note that with TYPE=V you need to add 4 to the starting position to account for the 4-byte RDW that DFSORT prepends temporarily to each record.

For more information on using VSAM data sets with DFSORT, see:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/1.8.3.4?SHELF=&DT=20060615185603&CASE=
Back to top
View user's profile Send private message
arun23kiran

New User


Joined: 01 Sep 2006
Posts: 3

PostPosted: Sat Sep 02, 2006 12:14 am    Post subject:
Reply with quote

hi Frank,

Thanks very much.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
No new posts VSAM Space Allocation mrgnndhmk JCL & VSAM 7 Sat Apr 22, 2017 12:42 am
No new posts Updating a VSAM file with DISP=OLD sheersh JCL & VSAM 8 Tue Mar 14, 2017 6:14 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm


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