Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to read the file for multiple times

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
changeurlife2003
Currently Banned

New User


Joined: 22 May 2006
Posts: 15

PostPosted: Mon Oct 09, 2006 4:09 pm    Post subject: How to read the file for multiple times
Reply with quote

H,

I have one variable file.

First i have to read the file until end of the file.
Move few fields from each record in to the working storage record fields.
then i have to write it in to the out put file.

Second time i have to read the file from starting it self again
i have to do the same process.

i have coded like this

PERFORM 2000-Frist-READ-PARA THRU 2000-EXIT
UNTIL WS-EOF-FILE = 'Y'.
PERFORM 2010-first-Write-Para THRU 2010-EXIT.
MOVE 'N' TO WS-EOF-FILE.
PERFORM 3000-Second-READ-para THRU 3000-EXIT
UNTIL WS-EOF-FILE = 'Y'.
PERFORM 3010-second-Write-Para THRU 3010-EXIT.
PERFORM 5000-CLOSE-file-PARA THRU 5000-EXIT.

Once i have run this program job is executing but this is abended with
S322(Time Abend)

...............WHY?
Back to top
View user's profile Send private message

Hemant B.

New User


Joined: 05 Oct 2006
Posts: 8

PostPosted: Mon Oct 09, 2006 4:35 pm    Post subject:
Reply with quote

i think in the reading para u not moving 'y' to WS-EOF-FILE.
so it is going into continue loop....

if u wann read a file multiple times........
then.

PERFORM 2000-Frist-READ-PARA THRU 2000-EXIT
UNTIL WS-EOF-FILE = 'Y'.

and in that read para do
PERFORM 2010-first-Write-Para THRU 2010-EXIT

again same for another

MOVE 'N' TO WS-EOF-FILE.
PERFORM 3000-Second-READ-para THRU 3000-EXIT
UNTIL WS-EOF-FILE = 'Y'.
and in that read para do
PERFORM 3010-second-Write-Para THRU 3010-EXIT

if i am wrong let me know it.
Back to top
View user's profile Send private message
surya_pathaus

Active User


Joined: 28 Aug 2006
Posts: 110

PostPosted: Mon Oct 09, 2006 5:26 pm    Post subject: Re: How to read the file for multiple times
Reply with quote

Hi,

File may contain large number of records. To process this twice, will take long time. This may brings the problem.

Why dont you try with time parameter in JCL.
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Mon Oct 09, 2006 8:36 pm    Post subject: Re: How to read the file for multiple times
Reply with quote

changeurlife2003,

After you read your file the first time to EOF you must close and re-open the file to set the current record pointer back to the first record.

The reason you are getting a time abend is that you re-set the WS_EOF_FILE to 'N' without resetting the Current_record_pointer. Every time you try to read the file again you are getting an error code, not EOF.

Try Closing/re_Opening the file. I think this should help the problem.

Dave
Back to top
View user's profile Send private message
mkodees

New User


Joined: 12 Oct 2006
Posts: 1

PostPosted: Thu Oct 12, 2006 7:38 pm    Post subject: Re: How to read the file for multiple times
Reply with quote

Hi,

Instead of closing & opening the files once again. Store the needed values in a working storage in the first read itself. Code separate paragraphs for the processing of the working storage variables.


Thanks
Kodees
Back to top
View user's profile Send private message
bonniem

New User


Joined: 09 Aug 2005
Posts: 67

PostPosted: Mon Oct 16, 2006 9:45 am    Post subject:
Reply with quote

If you are doing the simliar processing then why read the file twice? Read the file, move the fields to working storage, then call separate paragraphs to do both the process
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 Compare yesterday's date to the one o... migusd SYNCSORT 7 Fri Sep 22, 2017 11:35 pm
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us