I have a file which has decimal values in the format S9(15)v9(2) at position 1. I have to check if this value is lesser than (-20000). If it is lesser then write it to another file. Please find below sample code
There are no decimal places in SORT, you have to code for them. If you have an integer value, you will have to include 00 at the right of the number, yes.
The hex display you should is showing 10 bytes, the first nine of which look like packed-decimal values which, whatever you may think, is the length of your field,
1,17,PD is 35 digits. 1,9,PD is 17 digits. You may believe this or not, it is certainly your choice, but only a length of nine stands a chance of working, unless your field happens to be preceded by a bunch of binary zeros, which it can't be if it starts at position one, but can be if you happen to have got the 84 wrong in a co-incidental way.
Edit: Fixed error induced whilst typing with my back to the screen.