View previous topic :: View next topic |
Author |
Message |
mf_user Intermediate
![](images/avatars/gallery/babypics/maidsd.gif)
Joined: 01 Jun 2003 Posts: 372 Topics: 105
|
Posted: Sun Jun 01, 2003 1:42 am Post subject: Is it possible to use a report file as input file in cobol?? |
|
|
Hi,
My program generates following output file in the form of report. There is a requirement that I should use this file as input and using the value 123456-00-0, read another file and extract records from that file to an output file.
********************************* Top of Data **********************************
BDXX240--XX COUNTY OF PANAMA
REPORT JOT140 PERSONS ON JOT / CASES PURGED FROM MDE
CASE NUMBER PN PERSON LAST PERSO
NAME N
123456-00-0 01 REMOJA MLASA
*** END OF REPORT JOT240 **
******************************** Bottom of Data ********************************
My doubts:
1. Is it possible to use such report files as input files?
2. If I have to read this file, how the contents should be read because it does not have any copybook structure?
3. If I have to pass the key value to other file to fetch data, is it possible?
4. Is it possible to read this file sequentially as any other flat file?
5. If at all above things are possible, can we use VSAM file as second file for next read?
Please suggest.
Note: If you have any sample programs please send it to mf_user@yahoo.com. I will be very thankful to you.
Thanks,
MF _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
== |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
Glenn Beginner
Joined: 23 Mar 2003 Posts: 56 Topics: 3
|
Posted: Sun Jun 01, 2003 3:01 am Post subject: |
|
|
This is done through your JCL. You can define a report to be sent to file just as easily as it is sent to printer. Most reports are usually something like RECFM=FBA,LRECL=133 - if you define it like that it should write it to disk with all of the printer formatting characters intact. Then you read it as a 133 byte record file and process it from there. If it's a SYSOUT you can define it to RECFM=FB,LRECL=80 as a file.
You should be able to handle the record extraction part. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
mf_user Intermediate
![](images/avatars/gallery/babypics/maidsd.gif)
Joined: 01 Jun 2003 Posts: 372 Topics: 105
|
Posted: Sun Jun 01, 2003 8:03 am Post subject: |
|
|
Hi Glenn,
Can you send one sample? It would be a great help because i need to write a program.
Thanks,
MF. ![Very Happy](images/smiles/icon_biggrin.gif) _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
== |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
slade Intermediate
Joined: 07 Feb 2003 Posts: 266 Topics: 1 Location: Edison, NJ USA
|
Posted: Mon Jun 02, 2003 2:45 pm Post subject: |
|
|
Hi MFU,
Think of the report file as you would any other sequential file. The only difference is that the report file has a 1 byte print control character at the beginning of each record. The report file contains differing types of records dictated by the requirements of the report.
The record that you want contains 123456-00-0 at a certain position in the record. Just create a record definition that contains a field that defines it and keep reading reords, checking that field until you find 123456-00-0. Then proceed as you need to.
Take a cut at develpoing the pgm as best you can, then when you get stymied, show us what you've done annd ask for help.
Regards, Jack. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
|
|