Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

rewriting a variable length record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: rewriting a variable length record
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

Senior Member


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

PostPosted: Tue Dec 04, 2007 7:10 pm    Post subject:
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    Post subject: Reply to: rewriting a variable length record
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: 685
Location: Earth

PostPosted: Wed Dec 05, 2007 11:03 am    Post subject:
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    Post subject: Reply to: rewriting a variable length record
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    Post subject:
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    Post subject: Reply to: rewriting a variable length record
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

Senior Member


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

PostPosted: Wed Dec 05, 2007 1:11 pm    Post subject:
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    Post subject: Reply to: rewriting a variable length record
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    Post subject:
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    Post subject:
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    Post subject: Reply to: rewriting a variable length record
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: 685
Location: Earth

PostPosted: Thu Dec 06, 2007 2:01 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
No new posts Joinkeys operation when key1 and key2... Susanta DFSORT/ICETOOL 5 Wed Nov 02, 2016 5:35 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us