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

Fix s322 Timeout Abend in JCL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Mayos

New User


Joined: 11 Apr 2005
Posts: 16

PostPosted: Tue Apr 12, 2005 4:40 pm
Reply with quote

Hello,

Any suggestions on how to fix an s322 Abend Code in JCL?

Thanks.
Back to top
View user's profile Send private message
David P

Active User


Joined: 11 Apr 2005
Posts: 106
Location: Cincinnati Ohio

PostPosted: Tue Apr 12, 2005 5:06 pm
Reply with quote

Hi,
Please check the time parameter coded in your Job or step level.

Reason for S322:
The CPU time limit specified in the JCL has been exceeded.
The default CPU time limit set by the system has been exceeded.

Common Scenarios
Long-running programs: Programs that process a large amount of data or have inefficient code.
Infinite loops: Logic errors in the program that cause it to run indefinitely.

How to Resolve S322 Abend

Increase CPU Time Limit:
If the job genuinely requires more CPU time, increase the time limit on the JOB or EXEC statement.
Example:

Code:
//JOBNAME  JOB (ACCOUNTING_INFO),'JOB DESCRIPTION',
//         TIME=10,CLASS=A,MSGCLASS=X
//STEP1    EXEC PGM=YOURPROGRAM,REGION=0M,TIME=(,20)


Optimize Program Performance:
Review and optimize the code to reduce CPU usage.
Look for inefficiencies or infinite loops that might be causing excessive CPU consumption.

Check for Infinite Loops:
Ensure the program logic does not have infinite loops or conditions that prevent it from completing in a reasonable time.

Use System Override:
If system policies allow, you can request a temporary override for the CPU time limit from your system administrator.

regards,
David.
Back to top
View user's profile Send private message
aishwarya_singh

New User


Joined: 06 Apr 2005
Posts: 21

PostPosted: Tue Apr 12, 2005 5:13 pm
Reply with quote

This Abend occurs whenever there is Time spent in running the job is out of the CPU Time whichin which actually the job should have run.
Back to top
View user's profile Send private message
Mayos

New User


Joined: 11 Apr 2005
Posts: 16

PostPosted: Tue Apr 12, 2005 5:14 pm
Reply with quote

Does this mean that I have to increase my time parameter?

Thanks again.
Back to top
View user's profile Send private message
radhakrishnan82

Active User


Joined: 31 Mar 2005
Posts: 435
Location: chennai, India

PostPosted: Tue Apr 12, 2005 5:48 pm
Reply with quote

If the time parameter provided in the job or in step is correct then the reason can be due to improper compilation.
Find out in which program the job gave s322 error.
Try to recompile the program and make the job run.
Back to top
View user's profile Send private message
learnmf

Active User


Joined: 14 Mar 2005
Posts: 123

PostPosted: Tue Apr 12, 2005 10:27 pm
Reply with quote

S322
The system took a longer time to run a job, job step, or procedure than the time specified in one of the following:
- The TIME parameter of the EXEC or JOB statement
- The standard time limit specified in the job entry subsystem

/references/a29.html
Back to top
View user's profile Send private message
somasundaran_k

Active User


Joined: 03 Jun 2003
Posts: 134

PostPosted: Tue Apr 12, 2005 11:31 pm
Reply with quote

Mayos
If it's not the problem with the TIME parameter check whether your program is running in an infinite loop, for example a PERFORM UNTIL condition.


Regds
-Som
Back to top
View user's profile Send private message
andycool

New User


Joined: 12 Apr 2005
Posts: 63

PostPosted: Wed Apr 13, 2005 1:28 pm
Reply with quote

Hi,
Jus to ad to the info...Is the TIME parameter mandatory...wht does it signify exactly
Back to top
View user's profile Send private message
uma

New User


Joined: 18 Mar 2005
Posts: 8

PostPosted: Wed Apr 13, 2005 1:50 pm
Reply with quote

hi...

I guesst time parameter is not mandatory.But sometimes when the job runs for a longer period then this problem occurs.This can be corrected by coding TIME=1440 in the job card area.


cheers,
Uma
Back to top
View user's profile Send private message
learnmf

Active User


Joined: 14 Mar 2005
Posts: 123

PostPosted: Wed Apr 13, 2005 4:59 pm
Reply with quote

[quoteHi,
Jus to ad to the info...Is the TIME parameter mandatory...wht does it signify exactly[/quote]

Hi Friend The time parameter is not mandatory.If you can't give it takes the default.
thanks
Chandra
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Fri Nov 18, 2005 2:53 pm
Reply with quote

hi frnd,
S322 error is caused when CPU time assigned to the job, job step or procedure has been exceeded..

so to fix the error u can just go for some looping or u can go for some mismatching time parameter.. to solve go in reverse order.
Back to top
View user's profile Send private message
Kavitha Palani

New User


Joined: 16 Nov 2005
Posts: 8

PostPosted: Tue Nov 22, 2005 4:05 pm
Reply with quote

Indicates a time out abend. Your program has taken more CPU time than the default limit for the job class. Could indicate an infinite loop.
Back to top
View user's profile Send private message
kanak

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Tue Nov 22, 2005 5:51 pm
Reply with quote

As per my manual:
One of the following occurred:
1. The system took a longer time to run a job, job step, or procedure than the time specified in one of the following:
- The TIME parameter of the EXEC or JOB statement
- The standard time limit specified in the job entry subsystem
2. For a started task under the master subsystem, the TIME parameter was not specified on the PROC statement of the catalogued procedure, and the PPT entry did not indicate a system task.

System Action: The system abnormally ends the job, job step, or procedure.

Programmer Response: If the TIME parameter was not specified on the PROC statement of the catalogued procedure, add the TIME parameter or add a PPT entry for the PGM parameter. Otherwise, check for program errors. If none exist, specify a longer time in the TIME parameter. Then run the job again.
Back to top
View user's profile Send private message
Phantom

New User


Joined: 04 Sep 2005
Posts: 25

PostPosted: Tue Nov 22, 2005 6:52 pm
Reply with quote

Pals,

I am consolidating everyone's note here.

1. S322 - Time out Abend - program exceeds the CPU time limit provided to your job. This could be due to various reasons.
Code:

a.  Infinite loop in the program
b.  Reads database / tape which consume more cpu time.
c.  Processing huge input files


2. To avoid S322 you can do the following.
Code:

a.  Increase the TIME parameter.  In some shops, TIME parameter is strictly not allowed.

b.  If you can't provide TIME parameter, then find out the CLASS which has more CPU time.  Normally, in any shop, there will be different initiators (nothing but Job CLASS) and each initiator has a purpose.
    1.  Certain initiators have large CPU time (for long running jobs)
    2.  Some initiators have less CPU time (for short jobs)
    3.  Some intiators are dedicated for transfers like (FTP, NDM ....)
    4.  Some initiators are dedicated for DB2 / IMS sub-systems...

So, talk to your System programmers and find out the job CLASS which has highest CPU time limit and use that to run your job.  It will never end in S322 (provided your program does n't have an infinite loop).


Hope this helps,

Thanks,
Phantom
Back to top
View user's profile Send private message
Balasubramanian

New User


Joined: 23 Apr 2005
Posts: 13
Location: Bangalore

PostPosted: Mon Nov 28, 2005 3:21 pm
Reply with quote

Hi,

Try to change CLASS parameter at JOB card, that might help some time.

Regards,
Balasubramanian S
Back to top
View user's profile Send private message
mandyamj

New User


Joined: 22 Nov 2005
Posts: 7

PostPosted: Wed Nov 30, 2005 7:17 pm
Reply with quote

Reason: Caused when CPU time assigned to the job, job step or procedure has been exceeded

JOB OR STEP TIME EXCEEDED THE SPECIFIED LIMIT PROGRAM IS IN A LOOP INSUFFICIENT TIME PARAMETER ON JOB OR EXEC CARD

1.check this job is depend on any previous job if so check that job
2.program may be running in infinite loop
3.give the maxium time limit
Back to top
View user's profile Send private message
tspr52

New User


Joined: 12 Sep 2006
Posts: 31
Location: Madrid, Spain

PostPosted: Thu Mar 29, 2007 5:14 pm
Reply with quote

Code:
//UMDO0031 JOB (ACCOUNT),UMDO003, ** REPORT       
//             CLASS=B,REGION=0M,NOTIFY=UMDO003,   
//             MSGCLASS=W,TIME=1440   


Like this
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Thu Mar 29, 2007 5:27 pm
Reply with quote

I think the point which many people are trying to make here is - What is happening in the program, rather than let's give it infinite resource.

The OP has not bothered to respond to much in this thread.

In my view, giving him/her the code to use infinite resource is a gross error of judgement until the OP has confirmed that the program is working as expected.

I have experienced one user who submitted a looping program on Friday afternoon, who on return to work the next Tuesday found his job was still running and had produced zero results.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Thu Mar 29, 2007 10:30 pm
Reply with quote

Hello,

Even if it might be gotten away with, 1440 should NOT used.

NO 'application code' should ever specify 1440. Fortunately, many data centers automatically flush application jobs with 1440 in the jcl.
Back to top
View user's profile Send private message
tspr52

New User


Joined: 12 Sep 2006
Posts: 31
Location: Madrid, Spain

PostPosted: Fri Mar 30, 2007 12:30 pm
Reply with quote

You are right.

This example is just to be used only if you are sure your program is running ok, and only is "exhausted"

For example, if you are running ISRSUPC with a lot of parameters.

My excuses,

Jose Luis
Back to top
View user's profile Send private message
pavanbolla

New User


Joined: 25 Mar 2007
Posts: 7
Location: Canada

PostPosted: Fri Mar 30, 2007 12:57 pm
Reply with quote

Hi,

Check whether the COBOL program is in infinite loop, if it is not increase the TIME parameter.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Fri Mar 30, 2007 9:51 pm
Reply with quote

Hello,

To repeat - SUPERC or your own program or a sort or anything else that is a submitted batch job should not specify 1440.

It does not matter if the job is "running OK". 1440 is a bad option.

If there is a business requirement to use a very large amount of cpu cycles, most sites have some number of initiators/classes that are defined with sufficient time.

If this is a test, needing 1440 is just sloppy or lazy or both. There are ways to cut down the size of the "compare" or other test. Unfortunately, for some, they require a little bit of work and/or planning.
Back to top
View user's profile Send private message
shagnwrx

New User


Joined: 07 Jul 2006
Posts: 17
Location: Birmingham, AL

PostPosted: Fri Mar 30, 2007 11:43 pm
Reply with quote

I'd first check to see how many cpu seconds you are consuming. As the others have said either infinite loop, or you have this job in the wrong jobclass (Sys Progs set CPU time limits per class).

Chances are, there is a list around your shop that shows the time limits for each class.

For right now, do not run unlimited timed initiators, as you've not determined if you have a hard loop yet. Maybe go to a class that is another 30 seconds to a minute longer than the class you are running in now.
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 183
Location: hyderabad

PostPosted: Fri Mar 30, 2007 11:58 pm
Reply with quote

A small note on S322 error:

If the problem is repeating after the increase of the TIME parm,please check the EXCEPTION count,If the count is not increasing ,it means that job is in loop.Try to fix the loop problem,then your problem is solved.
We generally check the Exception count for longer running jobs during the production support to make sure that cycle won't run much time which in turn helps to keep the onlines up at the given time.

Thank you
Krishy.
Back to top
View user's profile Send private message
S0C7

New User


Joined: 19 May 2006
Posts: 26

PostPosted: Wed Sep 19, 2007 12:11 am
Reply with quote

All,

Just curious on why we are specifying 1440. There is an option call NOLIMIT. Is 1440 same as NOLIMIT..?
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 -> JCL & VSAM Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts ABEND 0717 during starting IMS IMS DB/DC 0
No new posts Help on IMS -API URL migrating from P... IMS DB/DC 1
No new posts Call an hlasm from REXX in batch and ... CLIST & REXX 4
No new posts can an ISPF appl save user changes in... TSO/ISPF 14
No new posts What is the most complex abend you've... Mainframe Interview Questions 8
Search our Forums:

Back to Top