Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Not able to export the VSAM cluster sandeep kumar302 JCL & VSAM 5 Fri May 04, 2018 12:42 pm
No new posts IDCAMS RENAMING VSAM FILE ALONG WITH ... upendrasri JCL & VSAM 11 Tue Apr 17, 2018 10:42 pm
No new posts VSAM file NOT Found error while proce... SumaReva CICS 5 Wed Apr 11, 2018 9:54 pm
No new posts VSAM - Accessing beyond record size Benchwarmer JCL & VSAM 6 Wed Apr 11, 2018 9:20 pm
No new posts How to include a particular field val... sakrat DFSORT/ICETOOL 8 Fri Apr 06, 2018 8:27 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us