View previous topic :: View next topic
|
Author |
Message |
changeurlife2003 Currently Banned New User
Joined: 22 May 2006 Posts: 15
|
|
|
|
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 |
|
|
Hemant B.
New User
Joined: 05 Oct 2006 Posts: 8
|
|
|
|
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 |
|
|
surya_pathaus
Active User
Joined: 28 Aug 2006 Posts: 110
|
|
|
|
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 |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
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 |
|
|
mkodees
New User
Joined: 12 Oct 2006 Posts: 1
|
|
|
|
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 |
|
|
bonniem
New User
Joined: 09 Aug 2005 Posts: 67
|
|
|
|
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 |
|
|
|