MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Is it possible to use a report file as input file in cobol??

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Sun Jun 01, 2003 1:42 am    Post subject: Is it possible to use a report file as input file in cobol?? Reply with quote

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
View user's profile Send private message Send e-mail
Glenn
Beginner


Joined: 23 Mar 2003
Posts: 56
Topics: 3

PostPosted: Sun Jun 01, 2003 3:01 am    Post subject: Reply with quote

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
View user's profile Send private message
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Sun Jun 01, 2003 8:03 am    Post subject: Reply with quote

Hi Glenn,

Can you send one sample? It would be a great help because i need to write a program.

Thanks,
MF. Very Happy
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Mon Jun 02, 2003 2:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group