senthamizh
New User
Joined: 27 Apr 2009 Posts: 23 Location: mumbai
|
|
|
|
Hi All,
I have to validate the input file(Variable block) and write the invalid(non numeric) records to output file1 and valid records to output file2. Here in the invalid records file i have to say why the records are invalid.
For example input file has 5 fields say
Employee num,salary,date of joining,date of leaving,Branch
Code: |
Employee Num - PIC X(5)
Salary - numeric-PIC 9(12)V9999
Date of joining -PIC X(10)
date of leaving - PIC X(10)
Branch - X(5) |
Code: |
12345 300000 2015-01-01 2016-01-05 abcde
23456 40000000 2013-01-01 2014-02-02 xyzab
34567 40.0000 2013-01-01 2013-04-01 txdce |
Now i want to validate each and every field in put file,for example say the salary field is having invalid record(40.00000-its non numeric,i will put the check for salary filed as nonnumeric) then i have to write the records into output file(all the five fileds should be written in the output file),so as per our example the output filed should contain 34567 40.0000 2013-01-01 2013-04-01 txdce and at the end of record it should say salary filed is invalid.If 2 fields are invalid says salary and date then at the end of file it should say salay and date of joining are invalid.
so in the output it should write as
Code: |
34567 40.0000 2013-01-01 2013-04-01 txdce salary invalid |
if more than 2 fields are invalid then it should be
Code: |
34567 40.0000 2013-01-01 2013-04-01 txdce salary invalid,date invalid |
Is it possible in SORT.
Thanks,
Chez
Code'd |
|