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
 

 

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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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