Re: Running a job in AIX
- From: StephenRichter@xxxxxxxxx
- Date: 22 Mar 2006 09:00:29 -0800
steven_nospam at Yahoo! Canada wrote:
StephenRichter@xxxxxxxxx wrote:
Looking to compare features of AIX and OS400 ...
How do you submit a job to run on AIX? Once it is running, can I hold
it, release it, cancel it? Can I display how much CPU it is using, can
I display all the jobs running on the system and see the share of the
system each job is using?
The "at" command that can be used to start a batched job now or at a
specific time. There is also the cron daemon that lets you submit a job
on a regular basis, such as every morning at 8am. There is the "atq"
command to show what is in the queue, and "atrm" command to cancel
jobs.
Our company created special "batch" queues in the qdaemon subsystem
that lets us queue up batch jobs much like you would do for a print
job. For example, we create a short script that sets our environment
and then calls a COBOL program, and then we simply use the lp command
to submit to that queue, whose backend program is /bin/ksh instead of
piobe (the standard printer I/O backend).
CPU usage can be seen for each process using the ps command.
Here is a scenario. I run a job every morning. It checks an ftp site
for a file. If the file is there, it receives the file, copies the file
into an sql table, then runs an sql procedure to process the data in
the table.
What AIX facility would I use to submit the job everyday at 8am? The
code that runs this job, what language would it be written in? The
automated FTP work, how is that done?
What facility would I use to copy the FTP stream file, containing comma
delimeted columns in text line rows, into an SQL table?
Then the final step, how would I initiate the sql procedure to process
the received table?
This can easily be done using a Korn shell script, FTP service, and a
.netrc file. I would put the script in CRON to run at 8am, it would
start, connect to the FTP site, retrieve the file (if any exist),
confirm whether a file was received, and then call the appropriate SQL
script to do the insertion.
I would recommend that you get a copy of "Learning the Korn Shell" from
O'Reilly & Associates or "Korn Shell Command And Programming Language"
from Bolsky/Korn as these can help get you familiar with scripting
techniques for the AIX environment.
Keep in mind that your UNIX system may be using Bourne shell or C-Shell
instead of Korn. In that case, you will want to pursue other guides.
If time permits, I will publish a sample Korn shell script.
thanks.
are there any shells that use descriptive names for their commands?
Also, do shells have prompting facilities that prompt the parameters of
the command ( I am aware of the man command to read the help text )
another thing ... When a shell script is running does it log the steps
it is running to a log file of some sort? On the as400 I can run a job
in LOGCLPGM(*YES) mode. Each CL command that is run is written to the
joblog. The joblog can be displayed as the job is running and saved
after it completes.
Here is a screen shot of the CPYFRMIMPF ( copy from import file )
command on the as400 when it is prompted:
Copy From Import File (CPYFRMIMPF)
From stream file . . . . . . . .
From file:
File . . . . . . . . . . . . . Name
Library . . . . . . . . . . *LIBL Name, *LIBL, *CURLIB
Member . . . . . . . . . . . . *FIRST Name, *FIRST
To data base file:
File . . . . . . . . . . . . . Name
Library . . . . . . . . . . *LIBL Name, *LIBL, *CURLIB
Member . . . . . . . . . . . . *FIRST Name, *FIRST
Replace or add records . . . . . *ADD *ADD, *REPLACE,
*UPDADD
Stream file record length . . . *TOFILE Number, *TOFILE
From CCSID . . . . . . . . . . . *FILE 1-65533, *FILE
Record delimiter . . . . . . . . *EOR Character value,
*ALL...
Record format of import file . . *DLM *DLM, *FIXED
String delimiter . . . . . . . . '"' Character value,
*NONE
.
- Follow-Ups:
- Re: Running a job in AIX
- From: pedzsan
- Re: Running a job in AIX
- From: steven_nospam at Yahoo! Canada
- Re: Running a job in AIX
- References:
- Running a job in AIX
- From: StephenRichter
- Re: Running a job in AIX
- From: steven_nospam at Yahoo! Canada
- Running a job in AIX
- Prev by Date: Re: Running a job in AIX
- Next by Date: Re: Running a job in AIX
- Previous by thread: Re: Running a job in AIX
- Next by thread: Re: Running a job in AIX
- Index(es):
Relevant Pages
|