Hello All,
I have an input file of fixed length 300 characters, my activity is focused on two fields Order number and status code.
Code:
Order number status code
(Position 25, length 7 characters) (Position 102, length 3 characters)
Order1 020
Order1 025
Order2 020
Order3 025
Order4 020
Order4 025
If there are two records with same order number then I want to remove the record having status code “025”.So the output file should look like the below
Code:
Order number status code
(Position 25, length 7 characters) (Position 102, length 3 characters)
Order1 020
Order2 020
Order3 025
Order4 020
Note the input file is pre-sorted on order number and status code.
I tried few Sort options, but it was removing the first record which is associated with status code “020”.Any help is appreciated.
Yes your correct there can be only maximum two records with same order number, one with status code 020 and other with status code 025,of which the record with status code 025 needs to be removed.
Sorry i was testing with the presorted file,that's the reason it was deleting the record with status code 020.
I tried using sorted file and gives desired result.