MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

find summation for a particular field in a file using sort

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
computer
Beginner


Joined: 12 Jun 2007
Posts: 64
Topics: 17
Location: Hyderabad

PostPosted: Tue Jun 26, 2007 1:42 am    Post subject: find summation for a particular field in a file using sort Reply with quote

Hi everybody,
My requirement is that I have the file given below:
input:
Code:

1-10          11-15
xxxxxxxx  15
yyyyyyyy  16
aaaaaaaa  17
.
..
sum          xxxx

output:
Code:

xxxxxxxx  15
yyyyyyyy  16
aaaaaaaa  17
.
..
sum          summation
summation=(15+16+17....)

Any help is highly appreciated
Back to top
View user's profile Send private message
krisprems
Beginner


Joined: 13 Dec 2006
Posts: 101
Topics: 4
Location: india

PostPosted: Tue Jun 26, 2007 3:32 am    Post subject: Reply with quote

Hi computer
nice that i am speaking to a computer Razz

Do you want the summation of the second filed as a trailer record?
_________________
cHEERs
krisprems
Back to top
View user's profile Send private message
computer
Beginner


Joined: 12 Jun 2007
Posts: 64
Topics: 17
Location: Hyderabad

PostPosted: Tue Jun 26, 2007 3:47 am    Post subject: Reply with quote

I dont need any header or trailer
My reqiurement is only to sum the field and display in the sum 's field which is to be present in outtput as present in input
Back to top
View user's profile Send private message
krisprems
Beginner


Joined: 13 Dec 2006
Posts: 101
Topics: 4
Location: india

PostPosted: Tue Jun 26, 2007 4:37 am    Post subject: Reply with quote

computer

For the i/p that you have shown, this should work fine.
Code:
//*******************************************************               
//STEP1    EXEC PGM=ICEMAN                                             
//SYSOUT   DD SYSOUT=*                                                 
//SYSPRINT DD SYSOUT=*                                                 
//SORTIN   DD *                                                         
XXXXXXXX  15                                                           
YYYYYYYY  16                                                           
AAAAAAAA  17                                                           
SUM XXXX                                                               
/*                                                                     
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
           OPTION COPY                                                 
           OMIT COND=(1,3,CH,EQ,C'SUM')                                 
           OUTFIL REMOVECC,                                             
           TRAILER1=('SUM=',TOT=(11,2,ZD,M11,LENGTH=8))                 
/*                                                                     


SORTOUT conatins
Code:
XXXXXXXX  15
YYYYYYYY  16
AAAAAAAA  17
SUM=00000048

_________________
cHEERs
krisprems
Back to top
View user's profile Send private message
computer
Beginner


Joined: 12 Jun 2007
Posts: 64
Topics: 17
Location: Hyderabad

PostPosted: Tue Jun 26, 2007 10:27 am    Post subject: Reply with quote

thanks krisprems,
its working fine
Back to top
View user's profile Send private message
computer
Beginner


Joined: 12 Jun 2007
Posts: 64
Topics: 17
Location: Hyderabad

PostPosted: Tue Jun 26, 2007 10:41 am    Post subject: Reply with quote

Can anybody tell me 'M11' in the above sort card.
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Tue Jun 26, 2007 10:51 am    Post subject: Reply with quote

Frank answered that type of question here:

http://www.mvsforums.com/helpboards/viewtopic.php?p=41384&highlight=#41384
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
krisprems
Beginner


Joined: 13 Dec 2006
Posts: 101
Topics: 4
Location: india

PostPosted: Tue Jun 26, 2007 12:35 pm    Post subject: Reply with quote

Quote:
Can anybody tell me 'M11' in the above sort card.


computer
You are welcome.
This link to "z/OS DFSORT: Getting Started" will answer ur question
_________________
cHEERs
krisprems
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group