View previous topic :: View next topic
|
Author |
Message |
Navdeep Aggarwal
New User
Joined: 27 Jun 2011 Posts: 8 Location: India
|
|
|
|
I am reading a report to get the required details and then making a new file of a relevant data from it. I am putting a condition as to if the input record(header) matches this criteria, then from there onwards my relevant data is there. but the problem is that, once i match the input record(header), there is a black line between the data and the header. So, i dont know how to get the record from the report.
Any Pointers....
Thanks |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
When I have to strip out data from a report, first of all I get rid of all the "rubbish" which is nothing to do with the data. Blank line, read next. "END OF PAGE", read next, etc.
Then, after that, logic for the data itself.
However, always better to have a data file. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Your description is not very clear, I read it 3 times but I don't understand it. From the attached document, this is what I see there:
Code: |
DATE TIME LOGONID JOBNAME CHANGER CHANGE CPU USING
11.196 07/15 18.11 T0353DT ACIN999Z MAINTLID CHANGE P36A
11.196 07/15 18.11 T0374WH ACIN999Z MAINTLID CHANGE P36A
11.196 07/15 18.11 T0381TG ACIN999Z MAINTLID CHANGE P36A |
So does this show input-structure or this is expected output? What exact problem do you have with "blank-line"? And what is "blank-line" in a file, assuming input is QSAM as you talk about report as input. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Looks like a dataset with printer control characters in position 1.
Maybe you have a problem with that. |
|
Back to top |
|
|
Navdeep Aggarwal
New User
Joined: 27 Jun 2011 Posts: 8 Location: India
|
|
|
|
Anuj- the layout which you have shown is the layout for my input-file (report). Because there is lot of irrelevant data in this report, I have put a condition as
IF INPUT- REC (X:Y) = CHANGER
THEN START PROCESSING.
Now you can see that after my condition got true, the next line is a "Blank Line", however i want to fetch the details like
11.196 07/15 18.11 T0353DT ACIN999Z MAINTLID CHANGE P36A
So my problem is as to how i should read it taking the in between blank line into consideration ??? |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
Perhaps you could add the condition
Code: |
if line not blank
then process |
? Just a wild thought. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
What is the DCB of your input file? |
|
Back to top |
|
|
Navdeep Aggarwal
New User
Joined: 27 Jun 2011 Posts: 8 Location: India
|
|
|
|
Robert - The input file is actually a report and the DCB parameter is
DCB=(MODEL,RECFM=VB,BLKSIZE=3665) |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
The input file is actually a report |
This is completely and totally irrelevant -- stop mentioning it because it does not matter.
If the report is a physical file, as opposed to merely a temporary data set pased to another step of the same job, do an ISPF 3.4 on it and find out the ACTUAL DCB instead of what you think the DCB is, then post that.
Also, depending upon the data, there may not be an actual blank line -- reports often have carriage control, in which case the first byte being a zero would be translated WHEN PRINTED into a blank line -- but you would not see that blank line in the actual file.
Also, using variable length records for the report file could mean the blank line consists of an actual line with anywhere from 1 blank to who knows how many blanks (the maximum would depend upon the LRECL).
Which of these cases applies? Who knows -- you're not providing ANYTHING helpful.
Is your problem:
- that you THINK there is a blank line after the header? If so, have you tried to actually read the data?
- that you read the blank line and your program quits?
- that you read the blank line and your program abends?
- that you read past the blank line but the data you're looking for is not found?
- that you are not matching the header as you expected?
- something else entirely that you have not yet explained? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Suggest you edit the "report file" and set HEX ON. Then copy/paste the first 5 records into a reply to the forum (use the Code tag). Use Preview to make sure your post appears like your screen display.
You seem to be unsure of just what you have and we have no idea. . . |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
1. Answer what Robert has asked for.
2. Follow what Dick has suggested.
3.
Navdeep Aggarwal wrote: |
the layout which you have shown is the layout for my input-file (report).
.
.
.
So my problem is as to how i should read it taking the in between blank line into consideration ??? |
Keeping in mind only data you show as your input to the COBOL program, it looks like in "data-part", after "report headings" first 6-bytes are date-in-julian-format. If yes, possibly define a layout for your input having first varible definition as PIC X(6) and the second variable will represent the rest of the report.
Code: |
01 REPORT-INPUT
05 NUM-CHECK-VAR PIC X(6).
05 REST-FO-THE-RPT PIC X(lrecl-6). |
READ input file into the above and check if the value in NUM-CHECK-VAR using NUMVAL, if it is numeric - write to output; if it's not READ.
Well, everything will change if your data changes - it's a suggestion about the data you show as input. |
|
Back to top |
|
|
|