View previous topic :: View next topic
|
Author |
Message |
gneelu
New User
Joined: 26 May 2006 Posts: 18
|
|
|
|
I am facing problem while rewriting a variable length record file.
It has been successfully rewriting the file, but when I open the file in View or Browse mode it is giving I/O reading error.
Regards
Neelu |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi,
How are you re-writing, what's the DCB of output file. Please share your JCL with us. |
|
Back to top |
|
|
gneelu
New User
Joined: 26 May 2006 Posts: 18
|
|
|
|
Hi Anuj,
THis is my JCL
In cobol program first i am writing header, detail records and trailer into the file. and after that i am rewriting the header record
//PSTEP010.OUTFILE DD DSN=ATG.WORK.OUTFILE,
// DISP=(NEW,CATLG,DELETE),UNIT=(SYSDA,5),
// SPACE=(CYL,(1,1),RLSE),
// DCB=(RECFM=VB,LRECL=504,DSORG=PS) |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
Quote: |
It has been successfully rewriting the file |
How you are checking that rewrite was successful? |
|
Back to top |
|
|
gneelu
New User
Joined: 26 May 2006 Posts: 18
|
|
|
|
Hi,
The job is getting executed successfully, and if i open the file in browse mode then i am able to see the header record which i have rewrited, and the remaining records are getting displayed
H!948!00000015!05122007!
**************** * * * I/O error detected, I/O terminated * * * ****************
**************** * * * I/O error detected, I/O terminated * * * ****************
**************** * * * I/O error detected, I/O terminated * * * ****************
**************** * * * I/O error detected, I/O terminated * * * ****************
**************** * * * I/O error detected, I/O terminated * * * ****************
**************** * * * I/O error detected, I/O terminated * * * ****************
**************** * * * I/O error detected, I/O terminated * * * ****************
**************** * * * I/O error detected, I/O terminated * * * ****************
**************** * * * I/O error detected, I/O terminated * * * ****************
**************** * * * I/O error detected, I/O terminated * * * ****************
**************** * * * I/O error detected, I/O terminated * * * ****************
**************** * * * I/O error detected, I/O terminated * * * ****************
**************** * * * I/O error detected, I/O terminated * * * ****************
**************** * * * I/O error detected, I/O terminated * * * ****************
**************** * * * I/O error detected, I/O terminated * * * ****************
**************** * * * I/O error detected, I/O terminated * * * ****************
**************** * * * I/O error detected, I/O terminated * * * ****************
Regards
G Neelaveni |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
you might try adding a block size equals 0 parm in your dcb.
do you have a blocksize phrase in your cobol program? if so, insure that it is also 0. |
|
Back to top |
|
|
gneelu
New User
Joined: 26 May 2006 Posts: 18
|
|
|
|
Hi Dick,
I have tried by adding a block size equals 0 parm in dcb then also i am getting same problem
Regards
G Neelaveni |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi,
By the way you didn't answer the Abhijit's question, that might help us to know, what your COBOL program is doing with the o/p file? |
|
Back to top |
|
|
gneelu
New User
Joined: 26 May 2006 Posts: 18
|
|
|
|
Hi,
I am writing the records into the file, which contains header,detail records and trailer record. and after that i need to display the count fo the records in the header for that reason i am rewriting the header.
Regards
G Neelaveni |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
how are you positioning your record pointer in your cobol program to re-write the header?
Select, FD, cobol code for 'all' the I/O for this file, please. |
|
Back to top |
|
|
wicked1925
New User
Joined: 12 Mar 2007 Posts: 15 Location: Philippines
|
|
|
|
i think there is something wrong on how you are writing the record. you can post your cobol code here for further investigation.
-wicked |
|
Back to top |
|
|
gneelu
New User
Joined: 26 May 2006 Posts: 18
|
|
|
|
Hi,
please find the code
SELECT OGFPFEED ASSIGN TO OGFPFEED
FILE STATUS IS WS-OGFPFEED-STATUS.
FD OGFPFEED
LABEL RECORDS ARE OMITTED
RECORD IS VARYING IN SIZE
FROM 1 TO 660 CHARACTERS
DEPENDING ON WS-CSV-REC-LENGTH
RECORDING MODE IS V
DATA RECORD IS OGFPFEED-REC.
01 OGFPFEED-REC PIC X(660).
FOR REWRITING
READ OGFPFEED INTO WS-OGFPFEED-HDR
IF WS-OGFPFEED-HDR-REC-TYPE = 'H'
MOVE WS-LINE-NUM TO WS-OGFPFEED-HDR-TOT-REC-CNT
STRING WS-OGFPFEED-HDR-REC-TYPE DELIMITED BY SIZE
WS-SYMBOL DELIMITED BY SIZE
WS-OGFPFEED-HDR-PROCESS DELIMITED BY SIZE
WS-SYMBOL DELIMITED BY SIZE
WS-OGFPFEED-HDR-TOT-REC-CNT DELIMITED BY ' '
WS-SYMBOL DELIMITED BY SIZE
WS-OGFPFEED-HDR-FILE-CRE-DT DELIMITED BY SIZE
WS-SYMBOL DELIMITED BY SIZE
INTO WS-RECORD-SEARCH-REC
PERFORM UNTIL WS-CSV-SUB < 1
OR WS-FOUND-SPACE-FLAG = 'Y'
IF WS-RECORD-SEARCH-CHAR (WS-CSV-SUB) NOT = SPACES
MOVE 'Y' TO WS-FOUND-SPACE-FLAG
MOVE WS-CSV-SUB TO WS-CSV-REC-LENGTH
END-IF
SUBTRACT 1 FROM WS-CSV-SUB
END-PERFORM
MOVE WS-RECORD-SEARCH-REC TO WS-OGFPFEED-HDR
REWRITE OGFPFEED-REC FROM WS-OGFPFEED-HDR
Thanks & Regards
G Neelaveni |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
Code: |
//PSTEP010.OUTFILE DD DSN=ATG.WORK.OUTFILE,
// DISP=(NEW,CATLG,DELETE),UNIT=(SYSDA,5),
// SPACE=(CYL,(1,1),RLSE),
// DCB=(RECFM=VB,LRECL=504,DSORG=PS) |
In JCL- record length 504, in program 660, are you sure that you posted correct code/jcl? |
|
Back to top |
|
|
|