cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CPS keep clause

former_member1244799
Participant
0 Kudos

Hi All,


Could you please clarify the below question.


1. We are planning to keep old jobs of a job definition along with OUTPUT files for 45 days. We want to keep job history(like start and end times) without output files for 2 years.Please advise how can we acheive this?


2. If I specify 45 days in the keep clause of each and every job definition. Is it going to delete only the old jobs along with job output files  or is it going to delete complete job history greater than 45 days?.

3. Is it ok to specify the keep clause on a job chain instead on the child jobs or do I need to specify keep clause for child jobs too?


4. Instead of specifying 45 days in the keep clause of each and every job definition, how can I do this system wide?. Please advise.

Thank you in advance.

Regards,
Ramana

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi All,

Is there anyone here who knows how to set Keep Amount via script.

I'm trying to modify keep clause of thousand jobs but no idea on how to get keep amount value and set it to jobs.

Advance thanks!

regards, Alyssa

gmblom
Active Contributor
0 Kudos

Hi Alyssa,

Dont change all your definitions. Just introduce a global keep clause.

1) Create a Job Definition called System_Defaults_System: save and close

2) Open it again, set the required Keep Clause

Done, the System_ProcessKeepClauses maintenance job will take this setting in consideration.

Regards Gerben

Former Member
0 Kudos

Hi Blom,

will this job definition deletes the jobs older than the specified number of days in keep clause?

If not, could you share what could be done to delete the old jobs system wide immediately.

Many thanks in advance.

gmblom
Active Contributor
0 Kudos

No it is not this job that does this. The System_Defaults_System is only used for configuration, as mentioned above, the System_ProcessKeepClauses job will do the actual work. But as that is running every 15 minutes by default (look at job filter All Maintenance Jobs), there is nothing more you have to do.

Note that only jobs in an END (Completed, Killed, Unknown, Canceled, Error) state are removed. All other jobs (Waiting, Held, Console etc) will have to be set to an endstate first before they can be removed by the system.

Regards Gerben

Former Member
0 Kudos

Thanks a ton Blom.

Former Member
0 Kudos

Hi Blom,

So does that mean if we edit any job definition, the keep clause will be changed to the value we defined in that system job? or it will be as is?

Many thanks in advance.

Former Member
0 Kudos

Hi Blom,

So does that mean if we edit any job definition, the keep clause will be changed to the value we defined in that system job? or it will be as is?

Many thanks in advance.

gmblom
Active Contributor
0 Kudos

Hi Vishnu,

The system default will work for all definitions that have NO keep clause. If you want a different keep clause for a definition, you can set that on the definition to overwrite the default.

Regards Gerben

Former Member
0 Kudos

Hi Blom,

Right now if I open a job and see its definition, its keep clause is now 'All Jobs'. Once I define 'System_Defaults_System' and set its keep clause, and check keep clause of any job definition, will I be able to see the changed value? or it will be still 'All Jobs' ?

gmblom
Active Contributor
0 Kudos

Yes it will still say 'All jobs'

Regards Gerben

Former Member
0 Kudos

Thanks ....

nanda_kumar21
Active Contributor
0 Kudos
  1. I don't recall any default way to have keep clauses based on file output. So i dont think it is possible.
  2. It will delete both the job history and the output file after 45 days.
  3. The job chain keep clause has priority over job definition. If job chain has keep clause set to 10 days and job definition set to 20 days, both parent and child job are deleted after 10 days. You can override this by checking "Keepforce" option in job definition. Its up to you to decide how you want to manage it.
  4. Create a system_Defaults_system job chain and set the keep clause and save the job chain. You dont have to add any steps or jobs to it. It will set the keep clause globally.
  5. You can refer System-Wide keep clause in admin guide.

thanks

Nanda

former_member1244799
Participant
0 Kudos

Hi Nanda,

Thank you so much for clearing my questions.

In my previous project, Our redwood team used to keep old jobs of a job definition along with OUTPUT files for 30 days and the job history(like start and end times) without output files for 1 years. I am not sure how they did it. I thought there should be some kind of mechanism to do it. To let you know we are using M33.92 version of CPS.

Regards,

Ram

Former Member
0 Kudos

Hi Ramana,

How did you do this one?. We are also in the same situation where we have to keep old jobs of a job definition along with OUTPUT files for 2 months and the job history(like start and end times) without output files for 2 years.

We are using M33.90 version.


Experts, can you please advise on this.

Regards,

Chandu

gmblom
Active Contributor
0 Kudos

Hello Chandu

There are several solutions available. You can implement the Archiver Module which will also provide you with an archive of the output files as well.

Another option would be to sign up with Redwood Intelligence which provides you with a full datawarehouse and dashboard of all your job history including trend analysis.

Regards Gerben

Former Member
0 Kudos

Thank you Gerben. Our client is not willing to go for 'module.archiving' license and Redwood Intelligence as it requires extra cost. I thought we can do it with no extra cost.

Regards Chandu

.

h_carpenter
Active Contributor
0 Kudos

Hi Chandu,

Since it is not possible to apply different keep clauses on jobs and output files out of the box, there is always gonna be extra cost. Your time, for example, also costs your company money.

If you do not want to go with the archiving or Redwood Intelligence solutions, you could create a job definition that you schedule daily at off-peak times that deletes the output files of jobs older than x days.

There are examples on scn of how to query the datamodel using executeObjectQuery for jobs with specific start times. If you then look into the API documentation at classes Job and JobFile, you should be all set. It does require some basic Java programming skills.

Regards,

HP

Former Member
0 Kudos

Thank you HP and Gerben

Regards, Chandu.