I should get the below result in output file (total of all credit records and debit records in the input file)
this I can acquire by the below sortcards and splice
sort exec pgm=icetool
toolin dd dsn=&splicecardlib,disp=shr
sortin dd dsn=&input file,disp=shr
temp dd dsn=&&tmpfile,disp=(mod,pass),
sortout dd dsn=&outfile,
ctl1cntl dd dsn=&cardlib1,disp=shr
ctl2cntl dd dsn=&cardlib2,disp=shr
sort from(input) to (temp) using ctl1
sort from(input) to (temp) using ctl2
splice from(temp) -
to (output) -
But the same logic is not working if the input file has same set of records(either debit or credit) the output file is empty for the above condition.
the temp file is only has 1 record for one set of records (either credit or debit) It's not finding the other record to compare with the unique indicator in 100th position and write it to outfile as one record.
It's not clear what you're trying to do. Showing us what you did that didn't work without explaining what you're trying to do makes it difficult to help you.
Please start over and show examples of the input records and expected output for various cases (including the one that doesn't work with your job). Explain the "rules" for getting from input to output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of each relevant field.
i am having the input file with credit/debit indicator and amount.
LRECL is 80
file layout is given below
01 C/D indicator pic x(01)
01 Amount pic s9(3)v99
Now whatever i have explained above is working fine,if the input file is having both credit and debit records.
If the input file is having only credit or only debit records(one sided records),The amount is summing up for either credit or debit.But the other amount is getting displayed as spaces.
If input file contains
The output file is getting only
300 spaces(DB amount)
as per the above code but i should not get these spaces. instead of these spaces i should move 000 amount to the db amount if no debit records found in the input file viceversa for credit amount also.