I'm trying to separate out records in a file into two data sets based on the values in a PIC S9(9)V99 COMP-3 field starting in position 107. In the first data set, I want records with values in the field that are greater than or equal to 250. In the second data set, I want records with values in the field that are less than 250. However it seems that everything in my input file goes into the first file (OUT1) without being sorted and second file remains empty.
I've referred to
Is there anything wrong with my JCL coding? Any solution?
Here's my input file layout beginning from position 107-112
PIC S9(9)V99 COMP-3 represents a 6-byte PD value with an implied decimal point before the last two digits. So, for example, your input value of X'00010500057C' is actually 000000104.25. Your constant of +250 is actually interpreted as +2.50. You should be using a constant of +25000 which will be interpreted as +250.00. So your OUTFIL statements should be:
Thanks for your prompt reply. Your first recommendation worked perfectly.
You also recommended that I can replace the second OUTFIL statement as
However I received the msg below when trying:
1 - CONTROL STATEMENTS FOR 5740-SM1, DFSORT REL 14.0
0 RECORD TYPE IS F - DATA STARTS IN POSITION 1
0 NO LENGTH OPERAND
0 SORTIN NOT DEFINED
3 END OF DFSORT
SAVE is just a way to say give me the records for this OUTFIL that were not included by any other OUTFIL. The messages you show have nothing to do with SAVE. They indicate that you didn't have a //SORTIN DD statement for that run. Take a look at your JCL to confirm.