[Last Call] Learn how to a build a cloud-first strategyRegister Now

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

Automate CPYSPLF

Hi all. We are trying to automate a CPYSPLF command using a CLP. The issue that we are having is that we can not get the appropriate job info for the spoolfile. The name is unique but there may be multiple files in the outq. Can someone help us with some sample code? We are on V5R3 and do not have the IBM APIs installed (that I know of). We also have a COBOL compiler but no RPG compiler.

Thank you in advance..

Mitch
0
mcs1169
Asked:
mcs1169
  • 2
1 Solution
 
daveslaterCommented:
Hi Mitch
I am sure that V5R3 comes with all languages as standard (I am sure Tom will correct me on that if I am wrong).
The API's are part of the OS and will be on the box.

Yout have the *LAST option for a copy spool file so you can easily do
CPYSPLF FILE(MYSPLF) TOFILE(MYDB) SPLNBR(*LAST)
you can the delete using
dltsplf and the *LAST option
to copy the spool files in reverse order

If you can be more specific on how many spool files you want to copy, are they generated by the same job, etc.. We can help a bit more

Dave
0
 
odumbruceCommented:
I have a rpg program that makes use of the API's your welcome to and can try to translate it to cobol.  The API's will be on your system they are parto f the operating system. if you


                                                 
 Spooled file . . . . . . . . . .                
 To data base file  . . . . . . .                
   Library  . . . . . . . . . . .     *LIBL      
 Job name . . . . . . . . . . . .   *            
   User . . . . . . . . . . . . .                
   Number . . . . . . . . . . . .                
 Spooled file number  . . . . . .   *LAST        
0
 
odumbruceCommented:
Sorry for the prev post finger hit enter.  I have a rpg program that makes use of the API's your welcome to and can try to translate it to cobol.  The API's will be on your system they are parto f the operating system. if you use RTVJOBA you can get the JOB USER and number and like dave stated you use the *LASR for the spooled file number and you will always get the last print for that job.  See below

Spooled file . . . . . . . . . .                
 To data base file  . . . . . . .                
   Library  . . . . . . . . . . .     *LIBL      
 Job name . . . . . . . . . . . .   *            
   User . . . . . . . . . . . . .                
   Number . . . . . . . . . . . .                
 Spooled file number  . . . . . .   *LAST        
0
 
tliottaCommented:
Yes... #1. If you have any licensed language such as COBOL, you also may install similar languages such as RPG for no additional cost. RPG might not be installed yet, but it should be installable from your CD. If you also have any licensed tool such as SEU, then you also have all tools at no additional cost. This means VisaulAge for RPG, CODE/400, etc. Again, the code might not yet be installed, but it ought to be on your CDs. If you have COBOL, then there's no need for RPG. I'm not aware of any function that's not available to all the licensed languages. ILE CL (and REXX) are the non-licensed languages that can't always access every API, primarily due to no pointer support.

#2. The only APIs I could think might not be installed would be some that were specific to environments such as QShell or PASE. I don't actually know if that's true, but I've never needed an API that wasn't available. I suspect you'll always know ahead of time if you need to install options such as those, so I wouldn't be concerned that any APIs weren't in the base system.

#3. You _might_ get some ideas by studying examples. I've got one at < http://zap.to/tl400 > -- Look in the Files section under Age Spool Files. It's a basic procedure for listing all spooled files on the system (from *ALL outqs) and aging them. Ones that are deemed too old are moved to outqs that regularly get cleared. It's pretty old but does the job and shows various spooled file functions. It's written in CL but could be fairly directly translated to any other language once it's understood.

Tom


0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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