Requirement 1:
My requirement is to accumulate the amounts of various fields and display . The fields are declared as s9(9)v99. The requirement also states that of these fields I need to excluding one field from getting accumulated into the remaining fields and have to accumulate it seperatly and display.The input file has record lenght of 419 and these fields
start from cols pos 307 and ends at cols pos 372 excluding the record count in the below mentioned example.Each field has a lenght of 11 . I even have to display the record count. I need to use the DFSORT or SYNCSORT here.Please find the example below.
Record count = 8
Gross amounts (field1+field2+field4+field5+field6) = 1180.00
Gross amount in field3=600.00
field3 starts at cols pos 329 and ends at 339.
Requirement2:
I need to sort the above Input file so that all the least amounts should appear at end of the file.We never know which field has the least amount.
Please provide me the sysin cards for the above ..2 requirement.
Record count = 8
Gross amounts (field1+field2+field4+field5+field6) = 1180.00
Gross amount in field3 = 600.00
I don't understand your requirement 2. Different records have different least amounts for the different fields, so what does it mean when you say "the least amounts should appear at end of the file". Do you want one output record with the minimum amount for each field or what?
Show an example of input records with minimums other than 0.00 and the expected output, and explain the rules for getting from input to output.
Frank I want to sort the inputfile in descending order so that all negative amount should come at the end of the file. Please find the example below
Input data
Frank Thankq for the Sysin card I tried to use this sysin card .When I checking for any syntax errors in the JCL I am getting an error which is below:
8 DSS10065E PARAMETER 'TO' IS UNIDENTIFIED.
8 DSS10065E PARAMETER 'LENGTH' IS UNIDENTIFIED.
I am Suspecting this might be a verison problem.
I even tried with the below sysin card :
INREC OVERLAY=(420:307,11,SFF,ZD,11,ADD,318,11,SFF,ZD,11,ADD,
340,11,SFF,ZD,11,ADD,351,11,SFF,ZD,11,ADD,362,11,SFF,ZD,11)
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
Hello,
Did you submit the job or did you only try to run it thru some jcl checker?
If you did not submit the job, do so now and post back if there are any problems. Most JCL checkers do not know all of the valid syntax for the sort and so throw "errors" that are not necessarily errors.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
I want to sort the inputfile in descending order so that all negative amount should come at the end of the file
Assuming there is only one non-zero number per record as shown in your example, which is the only way it would make sense, you can use a DFSORT job like the following to do what you asked for:
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
there many fileds, so the TOT's length maybe over 11, is there any way to code it more flexible?
EDIT can handle up to 31 digits. From your latest input example, it appears that your totals might be negative, so you'll probably want a sign too. If you want the totals to have a sign and 15 digits, you could use this:
The sysin you supplied is failing . I am not getting the desired output.
Please find the requirement
I have to accumulate the amounts of all the records excluding one field which I have mentioned at Cols pos 329.
Please find the input which i have used
Code:
---1----+----2----+----3----+----4----+----5----+----6----+----7---
***************************** Top of Data *************************
0000000000{0000000000{0000099990{0000000000{0000000000{0000000000{
0000000000{0000450000{0000000000{0000000000{0000000000{0000000000{
0000000000{0000000000{0000000000{0000070000{0000000000{0000000000{
0000000000{0000000000{0000000000{0000000000{0000010000}0000000000{
0000000000{0000000000{0000000000{0000000000{0000000000{0000020000}
0000000000{0000002000{0000000000{0000000000{0000000000{0000000000{
The output which I am getting is
Code:
RECORD COUNT = 6 ,
GROSS AMOUNTS (FIELD1+FIELD2+FIELD4+FIELD5+FIELD6) = 552.00 ,
GROSS AMOUNT IN FIELD3 = 9999.00 ,
The desired output is
Code:
RECORD COUNT = 6 ,
GROSS AMOUNTS (FIELD1+FIELD2+FIELD4+FIELD5+FIELD6) = 49200.00 ,
GROSS AMOUNT IN FIELD3 = 9999.00 ,
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Sigh.
Garbage in, garbage out!!
You showed your example input records as having values in the form sddddddddd.dd, so I used SFF format to handle them. But the latest example you show indicates that your input records really have plain ZD values, so you need to use ZD format to handle them. I can only go by what you tell me.
Given that you really have ZD values, the control statements should be as follows: