i am running a program 'A' for 5 times and it is creating output for 5 times. And in each and every run it writes a trailer record which contains a total amount calculated and a sign bite(to identify whether amount is positive/negetive)....After all the 5 outputs i need to add all the amounts...
ex-:
Code:
1 st o/p--- -1000
2 st o/p--- +1000
3 st o/p--- +1000
4 st o/p--- +1000
5 st o/p--- +1000
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
It's not clear what you're trying to do. Do you have 5 output files, each with a value in it? What is the starting position, length and format of the value you want to add up? What is the RECFM and LRECL of the 5 output files?
As an example of how to get the total with DFSORT, if your five output files have records that look like your example, e.g.
Code:
1 st o/p--- -1000
2 st o/p--- +1000
3 st o/p--- +1000
4 st o/p--- +1000
5 st o/p--- +1000
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
rkurapati,
It's difficult to help you when you keep moving from question to question and don't answer my questions.
Code:
34,6,FS,EDIT=(SIIIIT),SIGNS=(+,-)))
34 is the starting position of the numeric field.
6 is the length of the numeric field.
FS is the format. Since you showed your input fields as -1000 and +1000, I used DFSORT's FS format which can handle values like that.
If your actual numeric field is in a different format or at a different starting position, you need to say exactly what it looks like and what positions it's in.
EDIT=(SIIIIT),SIGNS=(+,-) converts the 34,6,FS numeric value to the form siiiit where s is the sign (+ for positive or - for negative), i is a digit (1-9 or blank for a leading zero) and t is a digit (0-9).
If you want the total count to look a certain way, you need to say exactly what you want it to look like.
Quote:
actual problem is sigh byte is storing in different field....
You need to explain this. Where is the sign and what does it look like? Where are the digits and what is their format and length?
Quote:
can some one help me out to get some detail explanation for the below
...
Where did you copy these statements from?
You can find complete information on DFSORT's control statements in Chapter 3 of "z/OS DFSORT Application Programming Guide" which you can access online along with all of the other DFSORT books from:
Since you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online from the link above.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Do you have any numbers in position 2-7, or just non-numbers? Show an example of the input records so we can get the whole picture.
What do you want in the output record? Just the total? In what positions? In what form? Or do you want something else? Be specific.
Show an example of the output record so we can get the whole picture.
here first six bytes to show that it is trailer record
next seven bytes shows the count of all the detail records and stored in this trailer record..
next byte +/- shouws the sign field....
next 15 bytes are for amount totals for all detail records...
...these 5 records we are giving as input to sort
and we need the output as single record as shown below
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
If my each record is 15 bytes long and
i am storing the sign byte in first position and the amount i am storing from 08th byte to 15th byte.....
Actually, the sign is in position 14 and the digits follow it. So rather than the complicated situation you describe, you have the very simple situation of a 16-byte FS field in positions 14-29 which you can handle quite easily with this variation of the DFSORT job I gave you in my first post:
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
I don't understand why you ask for help and then ignore what I say and go off in your own direction. I showed you how to use 14,16,FS to handle your data as it appears in your input records. Instead of using the job I gave you, you turn around and try to SUM with 15,15,ZD and OUTREC with 14,16,ZD and then come back here asking why it doesn't work. I used FS to fit your data. ZD does NOT fit your data. FS can handle the leading + or - sign. ZD can't. ZD expects the sign to be in the last nibble so it ignores the leading sign. FS works. ZD doesn't. That's why I used FS in my job.
Why do you need the INCLUDE when all of your input records have 999999? Why do you want to use SUM and OUTREC instead of TOT? TOT supports FS. SUM doesn't. Did you even try the job I gave you?
I see you're also summing on the second field. You didn't show that in your output example, so I didn't do it, but if you need a total for the second field, you can do that with TOT too.
I've got to say that this is the most annoying interaction I've ever had on this board.