<?xml version="1.0" encoding="utf-8"?>
<ManualTopic ID="/baanerp/basictasks/000038" xml:lang="en">
   <Header>
      <Title>Defining a job</Title>
   </Header>
   <AimSection ID="aim_tt_define_job">
      <Paragraph>To create a job, you must specify basic job data and link
		sessions and/or shell commands to the job. In the basic job data you specify
		whether the job is periodical. For periodical jobs, you specify how the job
		will be scheduled.</Paragraph>
   </AimSection>
   <GeneralSection>
      <ProcedureList>
         <ListIntro>To define a new job, take the following steps:</ListIntro>
         <ListItem>Start a session that you want to include in the job, and enter
		  the data in the regular way.</ListItem>
         <ListItem>Click <GUIRef href="" role="manual">Add to Job</GUIRef>. The <GUIRef href="/baanerp/tt/aad/ttaad5102s000" role="session">Add Session to Job (ttaad5102s000)</GUIRef> session starts.</ListItem>
         <ListItem>Click the browse arrow on the <GUIRef href="" role="manual">Job</GUIRef> field to
		  zoom to the <GUIRef href="/baanerp/tt/aad/ttaad5500m000" role="session">Job Data (ttaad5500m000)</GUIRef> session.</ListItem>
         <ListItem>Click <GUIRef href="" role="manual">New</GUIRef>. The <GUIRef href="/baanerp/tt/aad/ttaad5100s000" role="session">Job Data (ttaad5100s000)</GUIRef> details session starts , which you can use to create a
		  new job for your session.</ListItem>
         <ListItem>Enter a job code and a job description.</ListItem>
         <ListItem>Specify when you want the job to run as described in the next
		  section <DocRef>To schedule a job.</DocRef>
         </ListItem>
         <ListItem>Click <GUIRef href="" role="manual">Save</GUIRef> and close the <GUIRef href="/baanerp/tt/aad/ttaad5100s000" role="session">Job Data (ttaad5100s000)</GUIRef> session. You return to the <GUIRef href="/baanerp/tt/aad/ttaad5102s000" role="session">Add Session to Job (ttaad5102s000)</GUIRef> session. You can now add the session to the job as
		  described in <Link href="/baanerp/basictasks/000039" role="manual">To add a session to a job</Link>.</ListItem>
      </ProcedureList>
      <GeneralSection>
         <SectionTitle>To schedule a job</SectionTitle>
         <List>
            <ListIntro>To schedule a job, take one of the following steps in the <GUIRef href="/baanerp/tt/aad/ttaad5100s000" role="session">Job Data (ttaad5100s000)</GUIRef> details session:</ListIntro>
            <ListItem>To run the job at a specific time, clear the <GUIRef href="" role="manual">Use External Sched</GUIRef> check box. You can enter the job's start date and time
			 in the <GUIRef href="" role="manual">Next Execution Date</GUIRef> fields further down in the session.</ListItem>
            <ListItem>To start the job yourself, select the <GUIRef href="" role="manual">Use External Sched</GUIRef> check box. You can start the job by using the <GUIRef href="/baanerp/tt/aad/ttaad5500m000" role="session">Job Data (ttaad5500m000)</GUIRef> session. For details, see <Link href="/baanerp/basictasks/000041" role="manual">To run a job</Link>.</ListItem>
            <ListItem> 
               <List>
                  <ListIntro>To run the job at regular intervals, select the <GUIRef href="" role="manual">Periodical</GUIRef> check box. You must then either:</ListIntro>
                  <ListItem>Define a calendar for the job. ERP Enterprise will run the job on
				  the dates and times that you define in the job calendar. For details, refer to <Link href="/baanerp/basictasks/000040" role="manual">To define a job calendar</Link>.</ListItem>
                  <ListItem>Specify the period length. ERP Enterprise starts the job at the
				  start of each period.</ListItem>
               </List>
            </ListItem>
         </List>
         <Paragraph>If you enter a date and time in the <GUIRef href="" role="manual">End of Period</GUIRef> fields, ERP Enterprise will not start the job after this time.</Paragraph>
         <List>
            <ListIntro>Select the <GUIRef href="" role="manual">Use External Scheduler</GUIRef> check
			 box if you want to start the job in one of the following ways:</ListIntro>
            <ListItem>Through an external job scheduler such as Maestro from
			 UNISON, or through an external program such as a UNIX crontab.</ListItem>
            <ListItem>In the <GUIRef href="/baanerp/tt/aad/ttaad5203m000" role="session">Activate Job (ttaad5203m000)</GUIRef> session.</ListItem>
            <ListItem>Through the rc.startjob shell command (UNIX
			 platform)</ListItem>
            <ListItem>Through the startjob.bat batch file (Windows platform)</ListItem>
         </List>
         <Paragraph>See <Link href="/baanerp/tt/onlinemanual/job_execution" role="manual" Update="No">Job execution</Link> and <Link href="/baanerp/tt/onlinemanual/job_handling_procedure" role="manual">Job handling procedure</Link>.</Paragraph>
      </GeneralSection>
      <GeneralSection>
         <SectionTitle>To stop the job after a specific time</SectionTitle>
         <Paragraph>To stop the job if it runs longer than a specific time, enter
		  a value in the <GUIRef href="" role="manual">Maximum Duration</GUIRef> field of the <GUIRef href="/baanerp/tt/aad/ttaad5100s000" role="session">Job Data (ttaad5100s000)</GUIRef> details session. If the maximum duration is reached, ERP Enterprise finishes running the
		  current session, but does not start the next session.</Paragraph>
         <Paragraph>Values up to 59 to represent minutes. To represent values of
		  more than one hour, enter the number of hours followed by the number of
		  minutes, without a separator.</Paragraph>
      </GeneralSection>
      <GeneralSection>
         <SectionTitle>Example</SectionTitle>
         <List>
            <ListItem>To specify 30 minutes, enter 30.</ListItem>
            <ListItem>To specify one hour, enter 100.</ListItem>
            <ListItem>To specify one hour plus 30 minutes, enter 130.</ListItem>
         </List>
      </GeneralSection>
   </GeneralSection>
   <RelatedTopics>
      <SectionTitle>Related topics</SectionTitle>
      <RelTopic>
         <Link href="/baanerp/basictasks/000037" role="manual">Using jobs</Link>
      </RelTopic>
      <RelTopic>
         <Link href="/baanerp/basictasks/000039" role="manual">To add a session to a job</Link>
      </RelTopic>
      <RelTopic>
         <Link href="/baanerp/basictasks/000040" role="manual">To define a job calendar</Link>
      </RelTopic>
      <RelTopic>
         <Link href="/baanerp/basictasks/000041" role="manual">To run a job</Link>
      </RelTopic>
      <RelTopic>
         <Link href="/baanerp/tt/onlinemanual/job_data_procedure" role="manual">Job data procedure</Link>
      </RelTopic>
   </RelatedTopics>
</ManualTopic>