I want to extract only specific fields based on some criteria from VB file to another VB file.
You need to supply more information. What is the criteria exactly? What fields do you want to extract?
Show an example of the records in your input file (relevant fields only) and the records you expect for output. Give the starting position, length and format of each relevant field. Use the example to explain what you want to do. Remember that VB records have an RDW in positions 1-4, so the first data byte starts in position 5.
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
Field name Length Type Starting Positions
Empno 7 Numeric 1
Ename 20 Character 10
Salary 7 Float(9(5)v99) 32
Designation 20 Character 41
BUT IT IS WRITING ALL RECORDS TO OUTPUT FILE.
Please tell me what is the wrong in it.
Is SALARY packed decimal or float or zoned decimal? Your sort card has packed decimal, but you layout is unclear. If it is float then the 9(5)v99 is meaningless, if it is 7 bytes long and the 9(5)v99 is correct then it is not packed or float. Is 15000 suppose to represent 150.00 or 15000.00? If you are looking for a salary greater than 15000.00 then you need to use 1500000.