Retrieving Job Info

pts.
Tags:
Application development
AS/400
CLP
IBM DB2
RPG
RPGLE
Web development
I have a CL submitted from the Job Scheduler. In this job I need to kill an active job before processing, then strat it up again when processing is complete. For the active job I know the User ID and the Job Name and this is it, in addition there will always be more than one job out there (1 active and multiple ended). How can I get hold of the active jobs job number without creating a spool file and then reading that in an RPG or the CL? Thanks!

Answer Wiki

Thanks. We'll let you know when a new response is added.

The List Job (QUSLJOB) API generates a list of all or some jobs on the system. The generated list replaces any existing list in the user space.

The QUSLJOB API produces a list similar to the list produced by the Work with User Job (WRKUSRJOB) command.

http://publib.boulder.ibm.com/iseries/v5r2/ic2928/index.htm?info/rzahgicmain.htm

here after, a sample in CLP. I have replaced each space with a underscore.

cut & paste to seu, then replace back underscore by space

this sample ends some job from one subsystem

PGM_PARM(&SBS_&LJOBTYPE_&ACTION_&DELAY)
/*_SOUS-SYSTEME_*/
_____________DCL________VAR(&SBS)_TYPE(*CHAR)_LEN(10)
/*_LISTE_DES_TYPE_DE_TRAVAUX_RECHERCHES_*/
_____________DCL________VAR(&LJOBTYPE)_TYPE(*CHAR)_LEN(122)
/*_ACTION_A_APPLIQUER_*/
_____________DCL________VAR(&ACTION)_TYPE(*CHAR)_LEN(7)
/*_DELAY_D’APPLICATION_*/
_____________DCL________VAR(&DELAY)_TYPE(*DEC)_LEN(4)

/*_TYPE_DU_TRAVAIL_EN_COURS_DE_TRAITEMENT_*/
_____________DCL________VAR(&JOBTYP)_TYPE(*CHAR)_LEN(2)
/*_LONGUEUR_DE_LA_LISTE_DES_TYPES_RECHERCHES_*/
_____________DCL________VAR(&LJOBTLEN)_TYPE(*DEC)_LEN(3_0)
/*_RESULTAT_DU_SCAN_*/
_____________DCL________VAR(&POS)_TYPE(*DEC)_LEN(3_0)
/*_NOM_DU_TRAVAIL_*/
_____________DCL________VAR(&JOBNAME)_TYPE(*CHAR)_LEN(10)
_____________DCL________VAR(&JOBUSER)_TYPE(*CHAR)_LEN(10)
_____________DCL________VAR(&JOBNUM)_TYPE(*CHAR)_LEN(6)
/*_DELAY_EN_TEXTE_*/
_____________DCL________VAR(&DELAYX)_TYPE(*CHAR)_LEN(4)

/*+————————————————————————+/*/
/*_USER_SPACE_NAME_FOR_APIS_*/
______________DCL________VAR(&USRSPC)_TYPE(*CHAR)_LEN(20)
/*_USER_SPACE_LIBRARY_NAME_FOR_COMMANDS_*/
_______________DCL________VAR(&LUSRSPC)_TYPE(*CHAR)_LEN(10)
/*_USER_SPACE_NAME_FOR_COMMANDS_*/
_______________DCL________VAR(&NUSRSPC)_TYPE(*CHAR)_LEN(10)
/*_NUMBER_OF_JOBS_FOR_LIST_JOB_AND_USER_SPACE_OFFSET_IN_BINARY_4_FORM_*/
_______________DCL________VAR(&BIN4)_TYPE(*CHAR)_LEN(4)
/*_NUMBER_OF_JOBS_FROM_LIST_JOB_*/
_______________DCL________VAR(&LOOP)_TYPE(*DEC)_LEN(8_0)
/*_USER_SPACE_OFFSET_IN_DECIMAL_8,0_FORM_*/
_______________DCL________VAR(&DEC8)_TYPE(*DEC)_LEN(8_0)
/*_LIST_JOB_ENTRY_LENGTH_IN_DECIMAL_8,0_FORM_*/
_______________DCL________VAR(&ELEN)_TYPE(*DEC)_LEN(8_0)
/*_LIST_JOB_ENTRY_LENGTH_IN_BINARY_4_FORM_*/
_______________DCL________VAR(&ELENB)_TYPE(*CHAR)_LEN(4)
/*_RETRIEVE_AREA_FOR_LIST_JOB_ENTRY_*/
_______________DCL________VAR(&JOBL0100)_TYPE(*CHAR)_LEN(56)
/*JOBL0100_FORMAT___________________________________________________________/*/
/*+————————————————————————+/*/
/*|___OFFSET__|____________|_______________________________________________|/*/
/*|_DEC_|_HEX_|_TYPE_______|_FIELD_________________________________________|/*/
/*|__0__|__0__|_CHAR(10)___|_JOB_NAME_USED_________________________________|/*/
/*|__10_|__A__|_CHAR(10)___|_USER_NAME_USED________________________________|/*/
/*|__20_|__14_|_CHAR(6)____|_JOB_NUMBER_USED_______________________________|/*/
/*|__26_|__1A_|_CHAR(16)___|_INTERNAL_JOB_IDENTIFIER_______________________|/*/
/*|__42_|__2A_|_CHAR(10)___|_STATUS________________________________________|/*/
/*|__52_|__34_|_CHAR(1)____|_JOB_TYPE______________________________________|/*/
/*|__53_|__35_|_CHAR(1)____|_JOB_SUBTYPE___________________________________|/*/
/*|__54_|__36_|_CHAR(2)____|_RESERVED______________________________________|/*/
/*+————————————————————————+/*/

_____________DCL________VAR(&INTJOBID)_TYPE(*CHAR)_LEN(16)
_____________DCL________VAR(&JOBI0200)_TYPE(*CHAR)_LEN(133)

/*JOBI0200_FORMAT___________________________________________________________/*/
/*+————————————————————————+/*/
/*|___OFFSET__|____________|_______________________________________________|/*/
/*|_DEC_|_HEX_|_TYPE_______|_FIELD_________________________________________|/*/
/*|__0__|__0__|_BINARY(4)__|_NUMBER_OF_BYTES_RETURNED______________________|/*/
/*|__4__|__4__|_BINARY(4)__|_NUMBER_OF_BYTES_AVAILABLE_____________________|/*/
/*|__8__|__8__|_CHAR(10)___|_JOB_NAME______________________________________|/*/
/*|__18_|__12_|_CHAR(10)___|_USER_NAME_____________________________________|/*/
/*|__28_|__1C_|_CHAR(6)____|_JOB_NUMBER____________________________________|/*/
/*|__34_|__22_|_CHAR(16)___|_INTERNAL_JOB_IDENTIFIER_______________________|/*/
/*|__50_|__32_|_CHAR(10)___|_JOB_STATUS____________________________________|/*/
/*|__60_|__3C_|_CHAR(1)____|_JOB_TYPE______________________________________|/*/
/*|__61_|__3D_|_CHAR(1)____|_JOB_SUBTYPE___________________________________|/*/
/*|__62_|__3E_|_CHAR(10)___|_SUBSYSTEM_DESCRIPTION_NAME____________________|/*/
/*|__72_|__48_|_BINARY(4)__|_RUN_PRIORITY__________________________________|/*/
/*|__76_|__4C_|_BINARY(4)__|_SYSTEM_POOL_IDENTIFIER________________________|/*/
/*|__80_|__50_|_BINARY(4)__|_PROCESSING_UNIT_USED__________________________|/*/
/*|__84_|__54_|_BINARY(4)__|_NUMBER_OF_AUXILIARY_I/O_REQUESTS______________|/*/
/*|__88_|__58_|_BINARY(4)__|_NUMBER_OF_INTERACTIVE_TRANSACTIONS____________|/*/
/*|__92_|__5C_|_BINARY(4)__|_RESPONSE_TIME_TOTAL___________________________|/*/
/*|__96_|__60_|_CHAR(1)____|_FUNCTION_TYPE_________________________________|/*/
/*|__97_|__61_|_CHAR(10)___|_FUNCTION_NAME_________________________________|/*/
/*|_107_|__6B_|_CHAR(4)____|_ACTIVE_JOB_STATUS_____________________________|/*/
/*|_111_|__6F_|_CHAR(1)____|_RESERVED______________________________________|/*/
/*|_112_|__70_|_BINARY(4)__|_NUMBER_OF_DATABASE_LOCK_WAITS_________________|/*/
/*|_116_|__74_|_BINARY(4)__|_NUMBER_OF_NONDATABASE_LOCK_WAITS______________|/*/
/*|_120_|__78_|_BINARY(4)__|_NUMBER_OF_INTERNAL_MACHINE_LOCK_WAITS_________|/*/
/*|_124_|__7C_|_CHAR(3)____|_TIME_SPENT_ON_DATABASE_LOCK_WAITS_____________|/*/
/*|_127_|__7F_|_CHAR(3)____|_TIME_SPENT_ON_NONDATABASE_LOCK_WAITS__________|/*/
/*|_130_|__82_|_CHAR(3)____|_TIME_SPENT_ON_INTERNAL_MACHINE_LOCK_WAITS_____|/*/
/*+————————————————————————+/*/
/*__________________________________________________________________________/*/
/*__________________________________________________________________________/*/

_____________DCL________VAR(&ERRCOD)_TYPE(*CHAR)_LEN(256)
_____________DCL________VAR(&CODRET)_TYPE(*CHAR)_LEN(7)
/*===========GESTION-DES-MESSAGES-D’ERREUR————————–*/
_____________DCL________VAR(&MSGID)_TYPE(*CHAR)_LEN(7)
_____________DCL________VAR(&MSGDTA)_TYPE(*CHAR)_LEN(512)
_____________DCL________VAR(&MSGF)_TYPE(*CHAR)_LEN(10)
_____________DCL________VAR(&MSGFLIB)_TYPE(*CHAR)_LEN(10)
_____________/*-RENVOI-DES-MESSAGES-VERS-L’APPELANT——————*/
_____________MONMSG_____MSGID(CPF0000)_EXEC(GOTO_CMDLBL(STDMONMSG))
_____________GOTO_______CMDLBL(DEBUTPGM)
STDMONMSG:
_____________/*———–CAPTURE-DU-MESSAGE———————-*/
_____________RCVMSG_____MSGTYPE(*LAST)_RMV(*NO)_MSGDTA(&MSGDTA)_+
__________________________MSGID(&MSGID)_MSGF(&MSGF)_+
__________________________SNDMSGFLIB(&MSGFLIB)
_____________/*———–PROMOTION-DU-MESSAGE——————–*/
_____________SNDPGMMSG__MSGID(&MSGID)_MSGF(&MSGFLIB/&MSGF)_+
__________________________MSGDTA(&MSGDTA)_MSGTYPE(*ESCAPE)
_____________RETURN
DEBUTPGM:
/*===========CORPS-DU-PROGRAMME————————————-*/

_____________CHGVAR_____VAR(&NUSRSPC)_VALUE(ENDSBSJOB)
_____________CHGVAR_____VAR(&LUSRSPC)_VALUE(QTEMP)
_____________CHGVAR_____VAR(&USRSPC)_VALUE(&NUSRSPC_*CAT_&LUSRSPC)

___/*_DELETE_USER_SPACE_IF_IT_ALREADY_EXISTS____________________________*/

_______________DLTUSRSPC__USRSPC(&LUSRSPC/&NUSRSPC)
_______________MONMSG_CPF0000

___/*_CREATE_USER_SPACE_________________________________________________*/

_______________CALL_QUSCRTUS_(+
____________________&USRSPC_______________________/*_LE_NOM_*/_+
____________________’ENDSBSJOB_’__________________/*_ATTRIBUT_*/_+
____________________X’00100000′___________________/*_TAILLE_*/_+
____________________’_’___________________________/*_INITIALISATION_*/_+
____________________’*ALL______’__________________/*_AUTORISATIONS_*/_+
____________________’QUSLJOB_=_LIST_JOBS’_________/*_TITRE_*/)

___/*_LIST_JOBS____________________________*/
_____________CHGVAR_____VAR(&ERRCOD)_VALUE(‘_’)
_____________CHGVAR_____VAR(%BIN(&ERRCOD_1_4))_VALUE(255)
_____________CALL_______PGM(QUSLJOB)_PARM(+
____________________&USRSPC_______________________/*_USER_SPACE_*/_____+
____________________’JOBL0100′____________________/*_FORMAT_NAME_*/____+
____________________’*ALL______*ALL______*ALL__’__/*_JOB_NAME_*/_______+
____________________’*ACTIVE___’__________________/*_STATUS_*/_________+
____________________&ERRCOD_______________________/*_ERROR_CODE_*/_____)
_____________CHGVAR_____VAR(&CODRET)_VALUE(%SST(&ERRCOD_9_7))
_____________IF_________COND(&CODRET_*NE_’_______’)_THEN(DO)
_____________SNDPGMMSG__MSGID(&CODRET)_MSGF(*LIBL/QCPFMSG)_+
__________________________MSGTYPE(*ESCAPE)
_____________ENDDO

___/*_RETRIEVE_NUMBER_OF_ENTRIES_RETURNED._CONVERT_TO_DECIMAL_AND_______*/
___/*_IF_ZERO_GO_TO_NOJOBS_LABEL_TO_SEND_OUT_’NO_JOBS’_MESSAGE._________*/

_______________CALL_QUSRTVUS_(&USRSPC_X’00000085′_X’00000004′_+
______________________________&BIN4)
_______________CHGVAR_____&LOOP______%BINARY(&BIN4)
_______________IF_________COND(&LOOP_=_0)_THEN(GOTO_CMDLBL(NOJOB))

___/*_RETRIEVE_LIST_ENTRY_LENGTH,_CONVERT_TO_DECIMAL.___________________*/
___/*_RETRIEVE_LIST_ENTRY_OFFSET,_CONVERT_TO_DECIMAL,_AND_ADD_ONE_______*/
___/*_TO_SET_THE_POSITION.______________________________________________*/
_______________CALL_QUSRTVUS_(&USRSPC_X’00000089′_X’00000004′_+
______________________________&ELENB)
_______________CHGVAR_____&ELEN______%BINARY(&ELENB)
_______________CALL_QUSRTVUS_(&USRSPC_X’0000007D’_X’00000004′_+
______________________________&BIN4)
_______________CHGVAR_____&DEC8______%BINARY(&BIN4)
_______________CHGVAR_____VAR(&DEC8)_VALUE(&DEC8_+_1)
/*_LONGUEUR_DE_LA_LISTE_DES_TYPES_RECHERCHES_*/
_____________CHGVAR_____VAR(&LJOBTLEN)_VALUE((%BINARY(&LJOBTYPE_1_2)_+
__________________________*_10)_+_2)
/*_DELAY_IMPRIMABLE_*/
_____________CHGVAR_____VAR(&DELAYX)_VALUE(&DELAY)

_STARTLOOP:__IF_________COND(&LOOP_=_0)_THEN(GOTO_CMDLBL(FINPGM))

___/*_CONVERT_DECIMAL_POSITION_TO_BINARY_4_AND_RETRIEVE_LIST_JOB_ENTRY__*/

_____________CHGVAR_____VAR(%BINARY(&BIN4))_VALUE(&DEC8)
_____________CALL_______PGM(QUSRTVUS)_PARM(&USRSPC_&BIN4_&ELENB_+
__________________________&JOBL0100)

/*_REQUIRED_JOB_TYPE_?_SCAN_&JOBTYP_IN_&LJOBTYP_*/
_____________CHGVAR_____VAR(&JOBTYP)_VALUE(%SST(&JOBL0100_53_2))
_____________CHGVAR_____VAR(&POS)_VALUE(0)
_____________CALL_QCLSCAN_PARM(+
__________________&LJOBTYPE_______________/*/CHARACTER_STRING____________/*/_+
__________________&LJOBTLEN_______________/*/LENGTH_OF_CHARACTER_STRING__/*/_+
__________________X’001F’_________________/*/STARTING_POSITION___________/*/_+
__________________&JOBTYP_________________/*/CHARACTER_PATTERN___________/*/_+
__________________X’002F’_________________/*/LENGTH_OF_CHARACTER_PATTERN_/*/_+
__________________’_’_____________________/*/TRANSLATE_CHARACTERS________/*/_+
__________________’_’_____________________/*/TRIM_TRAILING_BLANKS________/*/_+
__________________’_’_____________________/*/WILDCARD_CHARACTER__________/*/_+
__________________&POS____________________/*/CHARACTER_STRING_RESULT_____/*/_)
_____________IF_________COND(&POS_<_0)_THEN(DO)
_____________DMPCLPGM
_____________SNDPGMMSG__MSGID(CPF9898)_MSGF(*LIBL/QCPFMSG)_+
__________________________MSGDTA(‘erreur_de_parametrage_de_qclscan_+
__________________________-_voir_dump,_zone_&POS’)_MSGTYPE(*ESCAPE)
_____________GOTO_______CMDLBL(FINPGM)
_____________ENDDO
_____________IF_________COND(&POS_=_0)_THEN(GOTO_ENDLOOP)
/*_FIND_THE_JOB_SUBSYSTEM_*/
_____________CHGVAR_____VAR(&ERRCOD)_VALUE(‘_’)
_____________CHGVAR_____VAR(%BIN(&ERRCOD_1_4))_VALUE(255)
_____________CHGVAR_____VAR(&INTJOBID)_VALUE(%SST(&JOBL0100_27_16))
_____________CALL_______PGM(QUSRJOBI)_PARM(+
____________________&JOBI0200_____________________/*_RECEIVER___*/_____+
____________________X’0085′_______________________/*_RECEIVER_LENGTH_*/____+
____________________’JOBI0200′____________________/*_FORMAT_NAME_*/____+
____________________’*INT______________________’__/*_JOB_NAME_*/_______+
____________________&INTJOBID_____________________/*_INTERNAL_JOB_NUMBER_*/_+
____________________&ERRCOD_______________________/*_ERROR_CODE_*/_____)
_____________CHGVAR_____VAR(&CODRET)_VALUE(%SST(&ERRCOD_9_7))
_____________IF_________COND(&CODRET_*NE_’_______’)_THEN(DO)
_____________SNDPGMMSG__MSGID(&CODRET)_MSGF(*LIBL/QCPFMSG)_+
__________________________MSGTYPE(*ESCAPE)
_____________ENDDO
_____________IF_(%SST(&JOBI0200_63_10)_^=_&SBS)_THEN(GOTO_ENDLOOP)
_____________CHGVAR_____VAR(&JOBNAME)_VALUE(%SST(&JOBL0100_1_10))
_____________CHGVAR_____VAR(&JOBUSER)_VALUE(%SST(&JOBL0100_11_10))
_____________CHGVAR_____VAR(&JOBNUM)_VALUE(%SST(&JOBL0100_21_6))
/*_SELON_LA_DEMANDE,_MESSAGE_OU_ARRET_TRAVAIL_*/
IF_(&ACTION_=_’*MSG’)_THEN(DO)
__IF_(&DELAY_=_0)_THEN(DO)
/*_MESSAGE_VOTRE_TRAVAIL_VA_ETRE_ARRETE_*/
_____________SNDMSG_____MSG(‘Arret_controle_du_systeme_en_cours._+
__________________________Votre_travail’_*BCAT_&JOBNAME_*TCAT_’/’_+
__________________________*CAT_&JOBUSER_*TCAT_’/’_*CAT_&JOBNUM_+
__________________________*BCAT_’va_etre_arrete_brutalement_dans_+
__________________________quelques_secondes’)_TOUSR(&JOBUSER)
__________________________MONMSG_CPF0000
__ENDDO
__ELSE_DO
/*_MESSAGE_VOTRE_TRAVAIL_VA_ETRE_ARRETE_DANS_NNNN_SECONDES*/
_____________SNDMSG_____MSG(‘Arret_controle_du_systeme_en_cours._+
__________________________Votre_travail’_*BCAT_&JOBNAME_*TCAT_’/’_+
__________________________*CAT_&JOBUSER_*TCAT_’/’_*CAT_&JOBNUM_+
__________________________*BCAT_’va_etre_arrete_brutalement_dans’_+
__________________________*BCAT_&DELAYX_*BCAT_’secondes’)_+
__________________________TOUSR(&JOBUSER)
__________________________MONMSG_CPF0000
__ENDDO
ENDDO

ELSE_DO
__IF_(&DELAY_=_0)_THEN(DO)
/*_ENDJOB_*IMMED_*/
_____________ENDJOB_____JOB(&JOBNUM/&JOBUSER/&JOBNAME)_OPTION(*IMMED)
__ENDDO
__ELSE_DO
/*_ENDJOB_DELAY*/
_____________ENDJOB_____JOB(&JOBNUM/&JOBUSER/&JOBNAME)_DELAY(&DELAY)
__ENDDO
ENDDO

___/*_AT_END_OF_LOOP_SET_NEW_DECIMAL_POSITION_TO_NEXT_ENTRY_AND_________*/
___/*_DECREMENT_LOOP_COUNTER_BY_ONE.____________________________________*/

___ENDLOOP:____CHGVAR_____VAR(&DEC8)_VALUE(&DEC8_+_&ELEN)
_______________CHGVAR_____VAR(&LOOP)_VALUE(&LOOP_-_1)
_______________GOTO_______CMDLBL(STARTLOOP)

___NOJOB:

___/*_ALL_DONE._NOW_DELETE_TEMPORARY_USER_SPACE_THAT_WE_CREATED.________*/

FINPGM:
_____________DLTUSRSPC__USRSPC(&LUSRSPC/&NUSRSPC)
_____________MONMSG_____MSGID(CPF0000)
_____________ENDPGM

_FIN:________ENDPGM

Discuss This Question: 7  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Vatchy
    I can think of three ways to do this. For both, though, I assume that the program that you want to end is runing in a loop. 1) Create a data queue and have the program that is running monitor the data queue. When it receives and "END" message then it ends. The "END" message would be sent by the CL that needs to kill the running job. The last thing that the new job does is start the old job again. 2) Have the running job monitor the time. When the time comes to run the scheduled job, have the current job run the new job after closing the files, if any, that it has open. After the new job completes, open any necessary files and continue processing. 3) At the correct time, have the old job submit the new job and then end; then have the new job submit the old job when it ends. I hope one of these helps.
    1,410 pointsBadges:
    report
  • Vatchy
    I can think of three ways to do this. For both, though, I assume that the program that you want to end is runing in a loop. 1) Create a data queue and have the program that is running monitor the data queue. When it receives and "END" message then it ends. The "END" message would be sent by the CL that needs to kill the running job. The last thing that the new job does is start the old job again. 2) Have the running job monitor the time. When the time comes to run the scheduled job, have the current job run the new job after closing the files, if any, that it has open. After the new job completes, open any necessary files and continue processing. 3) At the correct time, have the old job submit the new job and then end; then have the new job submit the old job when it ends. I hope one of these helps.
    1,410 pointsBadges:
    report
  • Vatchy
    I can think of three ways to do this. For both, though, I assume that the program that you want to end is runing in a loop. 1) Create a data queue and have the program that is running monitor the data queue. When it receives and "END" message then it ends. The "END" message would be sent by the CL that needs to kill the running job. The last thing that the new job does is start the old job again. 2) Have the running job monitor the time. When the time comes to run the scheduled job, have the current job run the new job after closing the files, if any, that it has open. After the new job completes, open any necessary files and continue processing. 3) At the correct time, have the old job submit the new job and then end; then have the new job submit the old job when it ends. I hope one of these helps.
    1,410 pointsBadges:
    report
  • Atgidm
    Another option is when the job that is running that needs to be ended: Have a CL to submit this job, use the RTVJOBA and retrieve the job name, user, and job number and write it to a Physical File. Then have the job schedule submit cl first call a program to get the values from the Physical File, and then use these parms for the ENDJOB command to end the job running and then delete the record from the Physical File. Then your submit of the ended job starts back with the process at the top of this - writing the job information to the physical file. This sounds like a lot to do but only takes a few lines of code to write in each of the processes.
    0 pointsBadges:
    report
  • Jgsnsbt
    I would definitely go with Vatchy to solve this problem, because it's the cleanest way to end the job in question in a controlled manner. When you issue an endjob, the job will end somewhere (inside the code) and somehow. (And maybe leave an endless joblog printout). Like Vatchy said, put in some async communication and you'll be fine. Make sure the running job is not only retrieving a message, but also telling the new job: Hey, I'm finished now!
    30 pointsBadges:
    report
  • Jwebb901
    KISS........Since you know exactly what job(s) need to be ended....why don't you have the jobs you want to cancel, load their job data to a data que when they start so that all you need to do is receive the data que and end the jobs when the time comes.
    0 pointsBadges:
    report
  • TomLiotta
    The best by far so far is the code in the answer. I'd simplify it, speed it up potentially a lot and probably modernize it to at least V5R3, but it's the right way to go. There is an assumption, of course, that there is only one active job of the given name from the given user at the time the program runs; but that's the assumption for any technique that doesn't rely on the cooperation of the job in question. Because any job can be given any valid job name, you can never be sure that a job is the one you want. If you're sure that there will be no mistake in canceling the job, go with the supplied example. Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following