Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 753
  • Last Modified:

script to hold job queues

I want to create a very simple script which just puts some AS/400 job queues on hold.  I'm a complete neophyte to CL programming, but from the reference materials I've been able to cobble together the commands below which should do the trick.

Now, how do I compile this and run it?

Is there an easier way to do this, say with a REXX script?

PGM
HLDJOBQ JOBQ(FOO)
HLDJOBQ JOBQ(BAR)
ENDPGM

Open in new window

0
Shift-3
Asked:
Shift-3
  • 2
  • 2
1 Solution
 
Gary PattersonVP Technology / Senior Consultant Commented:
CRTCLPGM to compile
CALL to execute

You can do a Rexx script if you like.  Can't say it is any easier.

See the CL Programmer's Guide - it has everything you need:

http://publib.boulder.ibm.com/iseries/v5r2/ic2924/books/c4157215.pdf

- Gary Patterson
0
 
Shift-3Author Commented:
Pretend for a moment that I don't know anything about metallurgy, engineering, or CL programming.  Can you give more specific examples of command syntax one would use?

I'm looking at the manual, but to describe it as abstruse would be charitable.

Before I can compile the program, I have to enter the commands into a source file using STRSEU, right?  Are there any other intermediate steps?
0
 
Shift-3Author Commented:
Never mind to the follow-up.  I worked it out.
0
 
Gary PattersonVP Technology / Senior Consultant Commented:
glad you figured it out.  for anyone else that might look here:

1) Create a source file to hold your source code using the CRTSRCPF command.  OPM CL source is usually stored in a file called QCLSRC, and ILE C source is often stored in CLLESRC.  You can call it anything, but it may confuse others.  Sample source files exist in QGPL, and you can copy them using CRTDUPOBJ if you prefer.

2) Use SEU to enter the source code (WRKPDM or STRSEU).  F4 and F1 are your friends.  Press them a lot in various regions of the SEU screen.  Type a command name and press F4 for prompt help with parameters.  Press F4 without typing a command to get a series of command menus to help you find the command you need.  Press F1 any time for help.

3) Compile using PDM option 14, or CRTCLPGM command

4) Execute using PDM "C" option or CALL command

- Gary Patterson
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now