IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Problem with Variable file reading


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vijayavamsi_b

New User


Joined: 05 Mar 2005
Posts: 1

PostPosted: Mon Feb 26, 2007 2:05 pm
Reply with quote

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
Back to top
View user's profile Send private message
devidas-patil

New User


Joined: 08 Jan 2007
Posts: 54
Location: pune

PostPosted: Mon Feb 26, 2007 5:43 pm
Reply with quote

Hi Vijaya
you said you are using the flat file go through the basic of flat file i think whenver you are wrting record in the flat file it will write on the first line only.
until you use the perform statement.
do one thing if you not using perform please try using the perform
let me know if understand and solved the problem.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top