You are here:

AS400 Mid Range/Create Cl to restore Libraries from a file

Advertisement


Question
Can I use a CL program to retrieve a list of libraries from a file and use the list as a parameter in driving a RSTLIB command in a CL

Answer
Yes, if it is a file defined by DDS - use the DCLF statement at the top of your CL program to declare the file, then use the RCVF statement to read a record from the file.  If the file calls the library-name field LIB, you will refer to it in the CL program as &LIB.  Then just use the RSTLIB command with whatever options your prefer, using the field name &LIB as the name of the library to be restored.  Your program should then GOTO the RCVF line to read the next record (I use RCVF: as the tag at the front of the RCVF line).  You will have to monitor for a CPF message with the MONMSG command when you reach the end of the file.

AS400 Mid Range

All Answers


Answers by Expert:


Ask Experts

Volunteer


Concise Systems/Laird Scranton

Expertise

General AS/400, RPG/400, SDA and CL programming questions. AS/400 performance tuning.

Experience


Past/Present clients
CB Sportswear
Coca-Cola of New York
Encore Paper Company
Golub Corporation
HBO Home Video
Imperial Pools
Kaiser Permanente of NE New York
Mallinckrodt Medical
Marigold Foods
Manpower & Associates
National Datacomputers
New York State Easter Seals Society
New York State Food Merchants Association
Pepsi-Cola Allied Bottlers
Petricca Construction
Taconic Telephone Corporation
TOMRA Recycling
Unistress Corporation

©2012 About.com, a part of The New York Times Company. All rights reserved.