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

rewriting a variable length record


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
gneelu

New User


Joined: 26 May 2006
Posts: 18

PostPosted: Tue Dec 04, 2007 6:23 pm
Reply with quote

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

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Dec 04, 2007 7:10 pm
Reply with quote

Hi,

How are you re-writing, what's the DCB of output file. Please share your JCL with us.
Back to top
View user's profile Send private message
gneelu

New User


Joined: 26 May 2006
Posts: 18

PostPosted: Wed Dec 05, 2007 10:07 am
Reply with quote

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

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Wed Dec 05, 2007 11:03 am
Reply with quote

Quote:
It has been successfully rewriting the file

How you are checking that rewrite was successful?
Back to top
View user's profile Send private message
gneelu

New User


Joined: 26 May 2006
Posts: 18

PostPosted: Wed Dec 05, 2007 11:24 am
Reply with quote

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

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Dec 05, 2007 12:25 pm
Reply with quote

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

New User


Joined: 26 May 2006
Posts: 18

PostPosted: Wed Dec 05, 2007 12:34 pm
Reply with quote

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

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Dec 05, 2007 1:11 pm
Reply with quote

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

New User


Joined: 26 May 2006
Posts: 18

PostPosted: Wed Dec 05, 2007 1:21 pm
Reply with quote

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

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Dec 05, 2007 1:24 pm
Reply with quote

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

New User


Joined: 12 Mar 2007
Posts: 15
Location: Philippines

PostPosted: Wed Dec 05, 2007 1:26 pm
Reply with quote

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

New User


Joined: 26 May 2006
Posts: 18

PostPosted: Wed Dec 05, 2007 1:31 pm
Reply with quote

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

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Thu Dec 06, 2007 2:01 pm
Reply with quote

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
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top