vijayavamsi_b
New User
Joined: 05 Mar 2005 Posts: 1
|
|
|
|
I need help to read a varible record length file.
This is my problem:
I had a variable length PS file and data is as follows:
Code: |
.?.0S922ERQR...............................?S922ERQP............................
.?...?S922ERQR....................[TAAC6201T95P1992252T00OBUILD/MOCK UP
.?...jS922ERQP....................h15532249 SPRING-INTER S/1992167 V NIERHAUS
.?....S922ERQL.....................01TRUCK & BUS GROUP .
.?....S922ERQL....................?02BLDG 34 DOCK 214 .
.?....S922ERQL....................?03660 S. BOULEVARD EAST .
.?....S922ERQL....................?04PONTIAC, MI .
.?....S922ERQL....................?0548341-3128 .
.?....S922ERQN.....................005NIF PROBLEMS, PLEASE CALL LYNN HAAS
.?....S922ERQN....................-010NON 8-396-3870. THANK YOU.
.?....S922ERQN....................?015N
.?....S922ERQN.....................020NPER REQUEST OF AL LAMB, INCREASING
.?....S922ERQN....................?025NQUANTITY TO 240 PCS (P.O. ETCRK)
.?....S922ERQN....................?030NLSH 090892
.?...?S922ERQR.....................6AADDG00618A1990233600O4EZ57
.?...jS922ERQP....................?03523624 COVER UNIT-WHEE1990263 LDSANFORD
.?....S922ERPN....................?005Y15" WIRE WHEEL COVER UNIT PACKAGES
.?....S922ERQL....................?01CADILLAC MOTOR CAR DIVISION .
.?....S922ERQL....................802MERRITT WAREHOUSE .
.?....S922ERQL.....................032555 CLARK STREET .
.?....S922ERQL....................?04DETROIT, MICHIGAN 48210 .
.?....S922ERQN....................b005NREWRITTEN FROM APPROVED S.R.#6201
.?....S922ERQN....................Q010NSUGGESTED SOURCE: NORRIS TRIM
.?...?S922ERQR.....................6AAJJ901608P1992182600OKSP
.?...jS922ERQP....................?16606209 ACT ASM - REAR 1992106 C BONGIORNO
.?....S922ERQL....................q01CADILLAC MOTOR CAR DIVISION .
.?....S922ERQL....................F02MERRITT WAREHOUSE .
.?....S922ERQL....................4032555 CLARK STREET .
.?....S922ERQL.....................04DETROIT, MICHIGAN 48210 . |
We need to separate the data into two files on following condition:
1. If the string 'S922ERQR' identified at location at location 7-14 and date
at location 48-54 is <1995001 then we need to write this record and successive records in one file called match till next match 'S922ERQR' found at location 7-14.
2. If the string 'S922ERQR' identified at location at location 7-14 and date
at location 48-54 is >= 1995001 then we need to write in one file called unmatch.
Problem:
I have written a COBOL program and tried to accomplish this and I faced following problems:
i. When I read a variable record into file record(it is also varible length) it is merged with the next record after end of the first record. So program logic is working fine but out record is merged with next record.
ii. Other way I tried is I copied all the records in to fixed block file. This time NULL values of the first file replaced with Spaces.
Is it possible to do this without writing Program??
How to keep the nulls instead of spaces while reading variable record file.
Please let me know.
Regards,
Vijay |
|