Batch files? - IBM AS400

This is a discussion on Batch files? - IBM AS400 ; My company runs everything on an AS400. I am very familiar with DOS, Windows and Linux. Is there a way to create a batch file on the AS400? As an example, I would like to run a script and pass ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: Batch files?

  1. Batch files?

    My company runs everything on an AS400. I am very familiar with DOS,
    Windows and Linux. Is there a way to create a batch file on the
    AS400? As an example, I would like to run a script and pass along a
    date. Then have that run several commands filling in the date with
    what was provided with the batch.

    Example:

    Doit 20080410

    Results:
    One of our commands is ran:
    command (supplier1) (account number1) (date from above)
    command (supplier2) (account number2) (date from above)
    command (supplier3) (account number3) (date from above)

    Any helps or pointing in the right direction would be appreciated. I
    haven't a clue how much access I have on our system. I know I can
    create files and libraries. I can run SQL commands.

    Thank you in advance for your help.

  2. Re: Batch files?

    Lee wrote:
    > My company runs everything on an AS400. I am very familiar with DOS,
    > Windows and Linux. Is there a way to create a batch file on the
    > AS400? As an example, I would like to run a script and pass along a
    > date. Then have that run several commands filling in the date with
    > what was provided with the batch.
    >
    > Example:
    >
    > Doit 20080410
    >
    > Results:
    > One of our commands is ran:
    > command (supplier1) (account number1) (date from above)
    > command (supplier2) (account number2) (date from above)
    > command (supplier3) (account number3) (date from above)
    >
    > Any helps or pointing in the right direction would be appreciated. I
    > haven't a clue how much access I have on our system. I know I can
    > create files and libraries. I can run SQL commands.
    >
    > Thank you in advance for your help.


    A CL (control language) program will do this easily. Once you have it
    built, you run it something like this:
    call mylib/doit parm('20080410')

    http://publib.boulder.ibm.com/infoce...bam6/clpro.htm

    --
    Karl Hanson

  3. Re: Batch files?

    il 15/04/2008 14.47, Scrive Lee 40652392:
    > My company runs everything on an AS400. I am very familiar with DOS,
    > Windows and Linux. Is there a way to create a batch file on the
    > AS400? As an example, I would like to run a script and pass along a
    > date. Then have that run several commands filling in the date with
    > what was provided with the batch.
    >
    > Example:
    >
    > Doit 20080410
    >
    > Results:
    > One of our commands is ran:
    > command (supplier1) (account number1) (date from above)
    > command (supplier2) (account number2) (date from above)
    > command (supplier3) (account number3) (date from above)
    >
    > Any helps or pointing in the right direction would be appreciated. I
    > haven't a clue how much access I have on our system. I know I can
    > create files and libraries. I can run SQL commands.
    >

    You can do with a compiled CL (control language) program, with an
    interpreted job stream (cl command written in a source file), with a
    shell script (cl commands executed by "system" function), with a rexx
    procedure...

    --
    Dr.Ugo Gagliardelli,Modena,ItalyCertifiedUindoscrasherAñe joAlcoolInside
    Spaccamaroni andate a cagare/Spammers not welcome/Spammers vão à merda
    Spamers iros a la mierda/Spamers allez vous faire foutre/Spammers loop
    schijten/Spammers macht Euch vom Acker/Spamerzy wypierdalac'

  4. Re: Batch files?

    You might consider Qshell, a unix like shell.

    http://publib.boulder.ibm.com/infoce...zahz/intro.htm


    Lee wrote in news:1da7d60d-300c-4730-88e6-
    ee2b12defdb0@t54g2000hsg.googlegroups.com:

    > My company runs everything on an AS400. I am very familiar with DOS,
    > Windows and Linux. Is there a way to create a batch file on the
    > AS400?


  5. Re: Batch files?

    On Apr 15, 6:33*pm, Mike Brown wrote:
    > You might consider Qshell, a unix like shell.
    >
    > http://publib.boulder.ibm.com/infoce...opic/rzahz/int...
    >
    > Lee wrote in news:1da7d60d-300c-4730-88e6-
    > ee2b12def...@t54g2000hsg.googlegroups.com:
    >
    >
    >
    > > My company runs everything on an AS400. *I am very familiar with DOS,
    > > Windows and Linux. *Is there a way to create a batch file on the
    > > AS400? *- Hide quoted text -

    >
    > - Show quoted text -


    I wouldnt use qsh scripts too much - just as in unix, a new job is
    started for each command. Last week I managed to generate 100,000
    joblogs with a command like:
    find . -newer $file -exec mv {} archive/ \;

    I should have 1) added ! -path '*archive*' which stops find descending
    into the archive dir and 2) added chgjob log(4 0 *nolist) to the
    submitting CL. Having done these 2 steps & making the job process a
    2nd directory the runtime went from 3 hours to 8 minutes !
    I only use qsh since I'm too lazy to either try RPG to IFS APIs, or
    simply parse out the result of the qsh ls -l command to archive by
    date.

    ps - does anyone know how I can use mv with xargs? I can get rm to
    work fine for the oldest files.

    Jonathan.

  6. Re: Batch files?

    Suggest you go to IBM's iSeries info center and start reading the
    basics.

    "Lee" wrote in message
    news:1da7d60d-300c-4730-88e6-ee2b12defdb0@t54g2000hsg.googlegroups.com...
    > My company runs everything on an AS400. I am very familiar with DOS,
    > Windows and Linux. Is there a way to create a batch file on the
    > AS400? As an example, I would like to run a script and pass along a
    > date. Then have that run several commands filling in the date with
    > what was provided with the batch.
    >
    > Example:
    >
    > Doit 20080410
    >
    > Results:
    > One of our commands is ran:
    > command (supplier1) (account number1) (date from above)
    > command (supplier2) (account number2) (date from above)
    > command (supplier3) (account number3) (date from above)
    >
    > Any helps or pointing in the right direction would be appreciated. I
    > haven't a clue how much access I have on our system. I know I can
    > create files and libraries. I can run SQL commands.
    >
    > Thank you in advance for your help.




+ Reply to Thread