batch jobs

47
Batch Job Description, FTP, EDS Questions Batch jobs A batch job is a predefined group of processing actions that is submitted to the system. Batch jobs run in the system background, freeing the user who submitted the job to do other work. The job requires no interaction on the part of the user once it has been set up. Batch jobs are typically low priority jobs. Several batch jobs can be active at the same time. Following are different kinds of batch jobs: Simple batch job Most people are familiar with the simple batch job that is submitted to a job queue. For more information about a simple batch job's life, see A job's life . Batch immediate job A batch immediate job is a batch job that was started with many of the attributes of its parent job. The job runs in the same subsystem as the parent job. Because the job copies attributes from the parent job and does not go through a job queue, it can start faster than jobs submitted to a job queue. Batch MRT job A batch MRT job is a multiple requester terminal (MRT) job. MRT jobs are S/36 Environment jobs that act like servers, allowing other S/36 Environment jobs to attach to them in order to run an MRT procedure. Batch print job Batch print jobs track the printer output files (also called spooled files) that were created by a job whose current user profile is different from the user profile that it was started under. 1) Simple batch job:- job's life To understand the basics of iSeries work management, follow a simple batch job as it moves through the system. The life of a simple batch job begins when you submit it to the system. The job is then sent to a job queue where it waits to enter a subsystem where it can run. Once the job moves to Page 1 of 47

Upload: diram007

Post on 29-Oct-2015

294 views

Category:

Documents


4 download

TRANSCRIPT

Batch Job Description, FTP, EDS Questions

Batch jobs

A batch job is a predefined group of processing actions that is submitted to the system. Batch jobs run in the system background, freeing the user who submitted the job to do other work. The job requires no interaction on the part of the user once it has been set up. Batch jobs are typically low priority jobs. Several batch jobs can be active at the same time.

Following are different kinds of batch jobs:

Simple batch jobMost people are familiar with the simple batch job that is submitted to a job queue. For more information about a simple batch job's life, see A job's life.

Batch immediate jobA batch immediate job is a batch job that was started with many of the attributes of its parent job. The job runs in the same subsystem as the parent job. Because the job copies attributes from the parent job and does not go through a job queue, it can start faster than jobs submitted to a job queue.

Batch MRT jobA batch MRT job is a multiple requester terminal (MRT) job. MRT jobs are S/36 Environment jobs that act like servers, allowing other S/36 Environment jobs to attach to them in order to run an MRT procedure.

Batch print jobBatch print jobs track the printer output files (also called spooled files) that were created by a job whose current user profile is different from the user profile that it was started under.

1) Simple batch job:-

job's life

To understand the basics of iSeries work management, follow a simple batch job as it moves through the system. The life of a simple batch job begins when you submit it to the system. The job is then sent to a job queue where it waits to enter a subsystem where it can run. Once the job moves to the subsystem it is allocated memory in which to run. The printer output file (also called spooled files) is then sent to the output queue to await further instruction on what to do (for example, printing).

Page 1 of 37

Batch Job Description, FTP, EDS Questions

Not every job follows this exact path; however, you can better understand how other work is completed on the system by learning more about the topics below:

  Submit a jobLearn what happens when a batch job is submitted to an iSeries server.

  The job enters a job queueLearn what happens when a job enters the job queue.

  The job enters the subsystemLearn what happens to the job when it enters the subsystem.

  The memory pool allocates memory to the subsystemLearn what happens when memory is allocated to the subsystem.

  The job finishes and moves to the output queueLearn what happens when the job is finished running.

a) Submit a Job:-

A job's life: Submit a job

When a job is submitted to the iSeries, it is created and enters the system. At this time, the properties are given to the job. Once the job receives its job description and defines its properties, it moves to the job queue where it waits to enter the subsystem. 

Where do you want to go from here?

Page 2 of 37

Batch Job Description, FTP, EDS Questions

  Submit a job > Job description

A job's life: Job description

The job description holds properties the job will use to go through the work management life cycle. These properties include the user profile the job will start to run under, the request data (which tells the job what it will do), and the initial user portion of the library list, as well as others. The job description also holds information that tells the job which job queue to enter and the routing data. The routing data is later used by the subsystem to find the routing entry that contains information needed for the job to start running. The output queue is also defined within the job description. It tells where printer output (also called spooled files) from a job will go.  Where do you want to go from here?

  Submit a job > Job description

b) The job enters a job queue

Page 3 of 37

Batch Job Description, FTP, EDS QuestionsJob queues are work entry points for batch jobs to enter the system. They can be thought of as "waiting rooms" for a subsystem. A number of factors affect when the job is pulled off the job queue into the subsystem, such as the job priority on the job queue, the sequence number of the job queue, and the maximum active jobs. When all of these factors work together, the job will be pulled off the job queue to start running in the subsystem. 

Where do you want to go from here?

The job enters a job queue > Job queue

A job's life: Job queue

When the job enters the job queue, it is available to a subsystem that has the job queue allocated to it. The subsystem looks at the sequence number of the job queue before the job priority of the jobs in the job queues. The subsystem uses the priority on job queue to determine when a job can enter relative to other jobs on the job queue. Because subsystems can have more than one job queue feeding into them (however, job queues cannot feed into more than one subsystem), a sequence number in the subsystem determines when the subsystem processes a job queue. The job priority and the maximum active jobs determine when a job enters the subsystem.  

Where do you want to go from here?

Page 4 of 37

Batch Job Description, FTP, EDS Questions

    The job enters a job queue > Job queue

c) The job enters the subsystem

When the job enters the subsystem it becomes active. Until a job gets its activity level and memory from a memory pool, it cannot run. The job uses several pieces of information before it can receive memory to run. The subsystem description, like the job description, carries information, such as the memory pool to use, the routing entry, the maximum active jobs, and the number of active jobs currently in the subsystem.  

Where do you want to go from here?

  The job enters the subsystem > Subsystem

A job's life: Subsystem

Subsystems are operating environments where the system manages the resources jobs use and controls the jobs that run within it. Once jobs are running in the subsystem, the subsystem job carries out user requests on a job such as holding, releasing, and ending a job. Like jobs, subsystems have descriptions that carry important information needed to complete the work. In the subsystem description is the routing entry. The routing entry references the class object, which contains the properties that control the run-time environment. However, before the job can get its routing entry, the routing data must make a match with a compare value in the routing entry. If this association is not made, the job will not run. Once the association between the routing data and the routing entry is made, the class object the job will

Page 5 of 37

Batch Job Description, FTP, EDS Questionsuse is determined. Some of the properties that control the run-time environment include the run priority, the timeslice, the maximum wait time, the maximum processing time, the maximum temporary storage, and the maximum number of threads. For more information, see class object in Chapter 5 of the V4R5 Work

Management (about 2720 KB or 573 pages) manual.The subsystem description defines the memory pools that will be allocated to the subsystem. The subsystem description also contains the maximum active jobs, which is the maximum number of active jobs at one time in the subsystem. Where do you want to go from here?

  The job enters the subsystem > Subsystem

d) The subsystem uses memory from a memory pool to run the job

Memory is a resource from the memory pool that the subsystem uses to run the job. The amount of memory from a memory pool, as well as how many other jobs are competing for memory, affect how efficiently a job runs. Subsystems use different memory pools to support different types of jobs that run within them. The subsystem gives the memory pool the information it needs to process the order in which jobs are allocated memory, and the memory pool allocates memory for the job to run to completion.

Where do you want to go from here?

Page 6 of 37

Batch Job Description, FTP, EDS Questions

 The subsystem uses memory from a memory pool to run the job > Memory pool

A job's life: Memory pools

Memory pools provide jobs with memory in which to run. Many factors affect how the job runs in the memory pool, such as the size and the activity level in the memory pool, as well as paging and faulting.The activity level in memory pools directly relates to the number of threads allowed to run in the memory pool at one time. Remember, every job has at least one active thread, but some can have multiple threads. Threads give a job the ability to do more than one thing at a time. For example, one thread can go out and do calculations while another thread waits for more data to process.

Paging is the movement of data in and out of memory, both synchronously and asynchronously. Pages can be written out to storage or removed from memory without being written if they have not been changed. Faulting causes paging to occur on the iSeries server. Faulting occurs when a referenced page, or piece of data, is not in memory. This causes programs to stop because they must wait for the data to be paged in.

Once the job is finished running, the memory it used is made available for other jobs to use.

 Where do you want to go from here?

Page 7 of 37

Batch Job Description, FTP, EDS Questions

 The subsystem uses memory from the memory pool to run the job > Memory pools

e) The job finishes and moves to the output queue

A job's printer output (also called spooled files) is sent to an output queue where it waits to be sent to a printer or file. The output queue is similar to the job queue in that it controls how the output is made available to the printer. The output queue allows the user to control what files are printed first.

Where do you want to go from here?

Output queues

Output queues are areas where printer output files (also called spooled files) wait to be processed and sent to the printer. Printer output is created either by the system or by the user using a print file. A print file is similar to a template or a guideline where the default values for the attributes of printer output are set. It is the beginning of the printer output life cycle.

The print file contains the output queue (OUTQ) and print device (DEV)attributes, which dictate how the printer output is to be directed. The default settings are usually *JOB, meaning that the job attributes of the output queue and printer device determine how the printer output is directed. The job attributes of the output queue and printer device settings are based on information obtained when the job is created. This is based on information from the user profile the job is running under, the job description, the workstation device description, and the default printer system value(QPRTDEV).

When the printer output is ready to be created, the system checks the print file and the job attributes (in this order) to see what output queue will process the printer output and which printer device the system will use. You can change the parameters of the output queue (OUTQ) and printer device (DEV) at the time the job is submitted or at job run-time to bypass extended processing. For example, the user can set the print file output queue to a specific queue and set the printer device to their specific

Page 8 of 37

Batch Job Description, FTP, EDS Questionsprinter in the print file at job initiation for the changes to take effect immediately. In doing this, the printer output does not have to go through the job attributes to find the output queue and printer device it will use. If a specified output queue cannot be found, the printer output will be directed to QGPL/QPRINT. For more information on how printer output is created, see Chapter 1 of the Printer Device Programming

manual.

Printer output files are files that hold information waiting to be printed or processed. The printer output file holds important attributes that define the position of the printer output on the queue with relation to other printer output. The position is defined by the priority, status, and schedule attributes.

Output queueAn output queue is an object that contains a list of printer output files to be written to an output device. The output queue carries important attributes that determine the order in which printer output is processed and the authority needed to make changes to the printer output file.

PriorityPrinter output that is waiting to process is moved to the output queue based on its priority (ranges from 1-9 where 1 is the highest priority).

StatusThe current status of printer output. You can view this status from the General page in Output properties.

ScheduleThe schedule attribute tells when the file should start physical printing of the output data.

ImmediatePrint immediately, even if the printer output file is not closed.File end (default)Printing begins as soon as the printer output file is closed.Job endPrinting begins when the job ends.

Once the printer output file is ready to be printed, a writer job, a job that processes the printer output from the output queue to the printer device, takes data from the printer output file and sends it to the designated printer.

Communications performance considerations for batch jobs

Each piece of work run on the iSeries system is called a job. Each job is a single, identifiable sequence of processing actions that represents a single use of the system. The basic types of jobs that are performed are interactive jobs, batch jobs, spooling jobs, autostart jobs, and prestart jobs.

Batch jobs are predefined groups of processing actions that are submitted to the system to be performed with little or no interaction between the user and the system. Batch jobs can be tuned for optimized performance.

To optimize batch jobs for communications, consider the following:

Page 9 of 37

Batch Job Description, FTP, EDS Questions

Break the application into pieces and having multiple batch threads (jobs) operate concurrently.

Reduce the number of open and close operations, input and output operations.

If you have a considerable amount of main storage available, consider using the Set Object Access (SETOBJACC) command. This command preloads the complete database file, database index, or program into the assigned main storage pool if sufficient storage is available. The objective is to improve performance by eliminating disk-read/write operations.

Try to limit the number of communications input and output operations by doing fewer (and perhaps larger) application sends and receives when communications lines are used.

Block the data in the application. Try to place the application on the same system as the frequently accessed data

Prestart jobs

A prestart job starts before a work request is received, either when the subsystem starts or as a result of the Start Prestart Jobs (STRPJ) command. Prestart jobs start from a prestart job entry (PJE) in the subsystem description. The prestart job entry specifies properties such as what program to run in the prestart job, the user profile under which the prestart job starts running, the job description, the class used to specify the run-time properties of the job, and the memory pool in which the prestart job runs.

Prestart jobs can start and initialize themselves before a work request is received. This reduces the amount of time required to handle the requests. A new job is not required for every work request. In addition, prestart jobs provide the ability to initialize once and handle many requests so that a new job is not needed for every request. Most client server applications use prestart jobs to handle the requests for the client user. Having a job ready to go makes the performance better in this situation because the prestart job can start processing the request for the user immediately.

Note: The value specified for the maximum number of jobs in the subsystem can prevent prestart jobs from starting. If the maximum number of jobs in the subsystem is exceeded, no prestart jobs can be started. When enough jobs have completed so that the number of jobs running is below the maximum number of jobs in the subsystem, prestart jobs in the subsystem can start.

Two types of prestart jobs exist. Each type handles different types of requests. Before a job waits for its first request, it will be shown as Prestart only because the system does not know yet what type of requests the job will handle. Following are the two types of prestart jobs:

Prestart communications job A prestart communications job is a communications batch job that starts running before a remote system sends a program start request.

For more information about prestart communications jobs, see Prestart Jobs in

Chapter 11 of the V4R5 Work Management (about 2720 KB or 573 pages) manual.

Page 10 of 37

Batch Job Description, FTP, EDS QuestionsPrestart batch job A prestart batch job is a batch job that starts before a work request is received.

Use of prestart jobs

A prestart job is a batch job that starts running before a program on a remote system initiates communications with the server. Prestart jobs use prestart job entries in the subsystem description to determine which program, class, and storage pool to use when the jobs are started. Within a prestart job entry, you must specify attributes for the subsystem to use to create and to manage a pool of prestart jobs.

Prestart jobs increase performance when you initiate a connection to a server. Prestart job entries are defined within a subsystem. Prestart jobs become active when that subsystem is started, or they can be controlled with the Start Prestart Job (STRPJ) and End Prestart Job (ENDPJ) commands.

System information that pertains to prestart jobs (such as DSPACTPJ) uses the term 'program start request' exclusively to indicate requests made to start prestart jobs, even though the information may pertain to a prestart job that was started as a result of a sockets connection request.

Notes: Prestart jobs can be reused, but there is no automatic cleanup for the

prestart job once it has been used and subsequently returned to the pool. The number of times the prestart job is reused is determined by the value specified for the maximum number of uses (MAXUSE) value of the ADDPJE or CHGPJE CL commands. This means that resources that are used by one user of the prestart job must be cleaned up before ending use of the prestart job. Otherwise, these resources will maintain the same status for the next user that uses the prestart job. For example, a file that is opened but never closed by one user of a prestart job remains open and available to the following user of the same prestart job.

By default, some of the server jobs run in QUSRWRK or QSERVER. Using iSeries(TM) Navigator, you can configure some or all of these servers to run in a subsystem of your choice.

1. Double-click iSeries Navigator --> Network --> Servers --> iSeries Access.

2. Right-click the server that you want to configure subsystems for and select Properties.

3. Configure the server using the Subsystems page.

If you move jobs from the default subsystem, you must:

4. Create your own subsystem description. 5. Add your own pre-start job entries using the ADDPJE

command. Set the STRJOBS parameter to *YES.

If you do not do this, your jobs will run in the default subsystem

Page 11 of 37

Batch Job Description, FTP, EDS QuestionsCreate and work with local data area

A local data area is a portion of space that is allocated for a job. Not all jobs use their local data area but some do. Each command within a job has access to the job's local data area. You may want to use a local data area if you are scheduling a job that previously required you to manually specify additional parameters. Use the local data area to specify the additional parameters so you do not have to manually specify them each time the job starts.

You can now specify the local data area for a scheduled job. Use the local data area to store data specific to the job. Each command within a job has access to the job's local data area.

Send Network File (SNDNETF)

The Send Network File (SNDNETF) command sends a save file or a member of a physical database file to another user on the local system or on a remote system through the SNADS network. This command can be used to:

Send data files to a user. Send source files to a user. Source sequence information is kept in the file

sent. Send other object types stored in a save file to a user.

When the file arrives at its destination, a notification message is sent to both the recipient and sender of the file.

When a source physical file is sent, the source sequence number and change date in positions 1 through 12 of the record are sent with the file. These are kept if the file is received into a source physical file, and are truncated if the file is received into a nonsource physical file. When a file that was originally a nonsource physical file is received into a source physical file, the source sequence numbers are created and placed in front of the records.

Note: Save files created on the AS/400 system cannot be distributed to System/38. However, save files created on System/38 can be distributed to the AS/400 system.

Restrictions:

1. The user must be enrolled in the system distribution directory. 2. The maximum size of a file that can be sent using the SNDNETF command is

approximately 2 billion bytes.

Parameters

Keyword Description Choices Notes

FILE File Qualified object name Required, Positional 1

Qualifier 1: File

Name

Page 12 of 37

Batch Job Description, FTP, EDS Questions

Qualifier 2: Library

Name, *LIBL, *CURLIB

TOUSRID

User ID Values (up to 50 repetitions): Element list Required, Positional 2

Element 1: User ID

Character value

Element 2: Address

Character value

MBR Member Name, *FIRST Optional, Positional 3

TOTYPE

To file type *FROMFILE, *DATA Optional

CLASS VM/MVS class A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

Optional

FORMAT

Send format *V, *F, *U Optional

PTY Send priority *NORMAL, *HIGH Optional

Top

Examples

Example 1: Sending a Member

SNDNETF TOUSRID ((JONES SYSTEM1)) FILE (EMPLOYEE) MBR (PGMR)

This command sends member PGMR of file EMPLOYEE to the user identified to the network with a user ID of (JONES SYSTEM1). The library list is used to locate the file.

Example 2: Sending a No source File

SNDNETF TOUSRID ((JONES SYSTEM2)) FILE (EMPLOYEE) MBR (PGMR) TOTYPE (*DATA)

This command sends member PGMR of file EMPLOYEE to the user identified to the network with a user ID of (JONES SYSTEM2). The library list is used to locate the file. The file is being sent as a nonsource file removing the sequence numbers and date fields.

Error messages

*ESCAPE Messages

CPF8057 File &1 in &2 not a physical file or save file.

CPF8058 File &1 is a spooled file.

Page 13 of 37

Batch Job Description, FTP, EDS QuestionsCPF8059

Member name not allowed for save file. CPF8063

Cannot assign necessary resource. CPF8064

File &1 in &2 member &3 not sent to any users. CPF8066

One or more user identifiers on this command is not correct. CPF8068

Error detected while processing file to be sent. CPF8072

Object to be sent is greater than maximum size of 2GB. CPF9005

System resource required to complete this request not available. CPF9006

User not enrolled in system distribution directory. CPF9803

Cannot allocate object &2 in library &3. CPF9807

One or more libraries in library list deleted. CPF9808

Cannot allocate one or more libraries on library list. CPF9810

Library &1 not found. CPF9812

File &1 in library &2 not found. CPF9820

Not authorized to use library &1. CPF9822

Not authorized to file &1 in library &2. CPF9830

Cannot assign library &1. CPF9845

Error occurred while opening file &1. CPF9846

Error while processing file &1 in library &2. CPF9847

Error occurred while closing file &1 in library &2. CPF9848

Cannot open file &1 in library &2 member &3. CPF9849

Error while processing file &1 in library &2 member &3.

Receive Network File (RCVNETF)

The Receive Network File (RCVNETF) command receives a network file and copies the records into a physical database file or a save file. Once the file has been received, it is removed from the queue of network files.

Page 14 of 37

Batch Job Description, FTP, EDS QuestionsIf the original file is a save file, it must be received into a save file. Before a file can be received, the file specified by the TOFILE parameter must already exist.

When a source physical file is sent, the source sequence number and change date in positions 1 through 12 of the record are sent with the file. These are kept if the file is received into a source physical file, and are truncated if the file is received into a nonsource physical file. When a file that was originally a nonsource physical file is received into a source physical file, the source sequence numbers are created and placed in front of the records.

If the file is a physical file, the record length of the to-file must be at least as large as the record length of the original file. If the record length of the to-file is larger than that of the original file, the records are padded to the end with the default record value for the to-file.

Restrictions:

1. A user with security officer authority can receive the files sent to any user. Users with other than security officer authority can receive only files sent to them or to their group profile.

2. The user must have read authority to the library containing the to-file, and use and add authority to the to-file. The following additional authority may be required:

o Object management authority, if a member is added to the file. o Object management authority and delete authority, if a save file or

existing physical file member is cleared.

Parameters

Keyword Description Choices Notes

FROMFILE

From file Character value Required, Positional 1

TOFILE To file Qualified object name Optional, Positional 2

Qualifier 1: To file Name, *FROMFILE

Qualifier 2: Library Name, *LIBL, *CURLIB

FROMMBR

Member to be received

Character value, *ONLY Optional, Positional 3

TOMBR To member Name, *FROMMBR, *FIRST

Optional, Positional 4

MBROPT Replace or add records

*REPLACE, *ADD Optional

NBR File number Integer, *LAST, *ONLY, *FIRST

Optional

USER User Name, *CURRENT Optional

FROMTYPE

From file type *NETFILE, *SRC Optional

Page 15 of 37

Batch Job Description, FTP, EDS QuestionsTop

Examples

Example 1: Receiving a Member

RCVNETF FROMFILE (FILEA) TOFILE (FILEB/FILEA) FROMMBR (PAYROLL)

This command receives member PAYROLL of file FILEA into member PAYROLL of file FILEA in library FILEB. If there is an existing member of that name, the records in the member are replaced. If multiple members of that name are available, the last one to arrive at the destination system is received.

Example 2: Receiving a Network File

RCVNETF FROMFILE (PERSONNEL) NBR (*LAST) USER (USR1)

This command receives a network file named PERSONNEL, which was sent to user USR1, into a file with the same name. Because the FROMMBR parameter is not specified, there must be only one member name available for this file. Because USR1 is specified, only someone with a user profile of USR1, someone with a group profile of USR1, or someone with security officer authority can use this command.

Example 3: Receiving a Source File

RCVNETF FROMFILE (FILEA) TOFILE (FILEB/FILEA) FROMMBR (PAYROLL) FROMTYPE (*SRC)

This command specifies that the file being received is a source file and the sequence numbers and date fields are not added to the file being received.

Error messages

*ESCAPE Messages

CPF2204 User profile &1 not found.

CPF2207 Not authorized to use object &1 in library &3 type *&2.

CPF4101 File &2 in library &3 not found or inline data file missing.

CPF5715 File &1 in library &2 not found.

CPF8057 File &1 in &2 not a physical file or save file.

CPF8059 Member name not allowed for save file.

CPF8060 No files compare to the specified selection.

CPF8062 Record length of network file larger than receiving file.

Page 16 of 37

Batch Job Description, FTP, EDS QuestionsCPF8063

Cannot assign necessary resource. CPF8070

Not allowed to process files for user &1. CPF8077

More than one file with same name found. See previously displayed messages.

CPF8080 MBROPT(*ADD) not allowed for save file.

CPF8081 File &5 member &6 number &7 already processed.

CPF8082 Cannot get network file &5 member &6 number &7.

CPF9005 System resource required to complete this request not available.

CPF9006 User not enrolled in system distribution directory.

CPF9803 Cannot allocate object &2 in library &3.

CPF9807 One or more libraries in library list deleted.

CPF9808 Cannot allocate one or more libraries on library list.

CPF9810 Library &1 not found.

CPF9812 File &1 in library &2 not found.

CPF9820 Not authorized to use library &1.

CPF9822 Not authorized to file &1 in library &2.

CPF9830 Cannot assign library &1.

CPF9843 Object &1 in library &3 type &2 cannot be accessed.

CPF9845 Error occurred while opening file &1.

CPF9846 Error while processing file &1 in library &2.

CPF9847 Error occurred while closing file &1 in library &2.

CPF9848 Cannot open file &1 in library &2 member &3.

CPF9849 Error while processing file &1 in library &2 member &3.

Work with Network Files (WRKNETF)

The Work with Network Files (WRKNETF) command displays or prints a list of files that have arrived for a user, or creates an output file containing a list of the files. When the list is shown, you can:

Receive the file into a user file. Delete the file. Browse the file (not valid for save files).

Page 17 of 37

Batch Job Description, FTP, EDS Questions Submit files (submit the input stream). (Also not valid for save files).

Restrictions:

1. A user with security officer authority can display the network files for any user. Users other than the security officer can show only those files that were sent to them or to their group profile.

2. To perform any of the options from this display, you must be authorized to the command corresponding to that option. For example, you must be authorized to the Display Physical File Member (DSPPFM) command for the browse function, and the Submit Database Jobs (SBMDBJOB) command for the submit job function.

3. To perform WRKNETF in debug mode, update of production files must be allowed by specifying UPDPROD(*YES) on the STRDBG command.

Parameters

Keyword Description Choices Notes

USER User Name, *CURRENT, *ALL

Optional, Positional 1

OUTPUT

Output *, *PRINT, *OUTFILE Optional, Positional 2

OUTFILE

File to receive output Qualified object name

Optional

Qualifier 1: File to receive output Name

Qualifier 2: Library Name, *LIBL, *CURLIB

OUTMBR

Output member options Element list Optional

Element 1: Member to receive output

Name, *FIRST

Element 2: Replace or add records

*REPLACE, *ADD

Top

Examples

Example 1: Working with User's Network Files

WRKNETF

This command allows you to work with all network files for the user running this command. If the command is issued as an interactive job, the list of files is shown at the requesting work station. If the command is issued as a batch job, the list of files is printed with the job's spooled output.

Page 18 of 37

Batch Job Description, FTP, EDS QuestionsExample 2: Printing Output

WRKNETF USER (USR1) OUTPUT (*PRINT)

This command allows you to work with the network files for USR1 and prints the output with the job's spooled output. This command can only be issued by USR1, a member of the USR1 group, or a user with security officer authority.

Example 3: Working with Network Files for All Users

WRKNETF USER (*ALL) OUTPUT (*OUTFILE) OUTFILE (NETFILES)

This command allows you to work with the network files for all users and is written to the first member of a database named NETFILES. If the file exists in a library on the library list, the existing file is used; otherwise, the file is created in the QGPL library. If the file did not exist, or did not contain any members, a member with the same name as the file is added to the file; otherwise, the first member of the file is cleared and used. This command can be issued only by a user with security officer rights.

Error messages

*ESCAPE Messages

CPF2204 User profile &1 not found.

CPF8070 Not allowed to process files for user &1.

CPF9005 System resource required to complete this request not available.

CPF9006 User not enrolled in system distribution directory.

CPF9830 Cannot assign library &1.

CPF9845 Error occurred while opening file &1.

CPF9846 Error while processing file &1 in library &2.

CPF9847 Error occurred while closing file &1 in library &2.

CPF9860 Error occurred during output file processing.

Save Object (SAVOBJ)

The Save Object (SAVOBJ) command saves a copy of a single object or a group of objects located in the same library. When *ALL is specified for the Objects (OBJ) parameter, objects can be saved from up to 300 libraries. When saving to a save file, only one library can be specified. The system saves the specified objects by writing a copy of each object on tape or optical media, or in a save file. The objects are not affected in the system unless the command specifies that the storage should be freed. However, the description of each object is changed with the date, time, and

Page 19 of 37

Batch Job Description, FTP, EDS Questionsplace when it was last saved, unless *NO is specified for the Update history (UPDHST) parameter.

For job queues, output queues, data queues, message queues, and logical files, only the object descriptions are saved, and the contents of the objects are not saved. However, logical file access paths can be saved by specifying *YES for the Save access paths (ACCPTH) parameter. The contents of a save file can be saved by specifying *YES for the Save file data (SAVFDTA) parameter or using the Save Save File Data (SAVSAVFDTA) command.

Note: This command ignores all file overrides currently in effect for the job, except for the output file.

Restrictions:

You must either have save system (*SAVSYS) special authority or the following object authorities:

o object existence (*OBJEXIST) authority for each object to be saved o execute (*EXECUTE) authority to each library objects are saved from

If you do not have *SAVSYS special authority, only those objects that you have authority for are saved.

When saving to a tape or optical device, you must have use (*USE) authority to the device description and device file. When saving to a save file, you must have object operational (*OBJOPR) and add (*ADD) authorities to the save file, and *EXECUTE authority to the library where the save file is located.

When using a media definition, you must have *USE authority to the media definition and *EXECUTE authority to the media definition library.

This command does not save the data dictionary for the library or its associated database files. To save them, the Save Library (SAVLIB) command should be used.

When using the OUTFILE parameter to save to an existing database file, you must have *EXECUTE authority to the output file library.

If tape is used, a standard-labeled volume must be placed in the device. No object being saved can be changed by a job that is running at the time the

save operation occurs unless save-while-active is used. When the contents of a save file are being saved to the same save file by

specifying SAVFDTA(*YES), only the description of the save file is saved. When the contents of a save file are saved by specifying SAVFDTA(*YES), the

save file must be restored before objects contained in it can be restored.

Parameters

Keyword Description Choices Notes

OBJ Objects Single values: *ALLOther values (up to 300 repetitions): Generic name, name

Required, Positional 1

LIB Library Values (up to 300 repetitions): Generic name, name

Required, Positional 2

DEV Device Single values: *SAVF, *MEDDFNOther values (up to 4

Required, Positional 3

Page 20 of 37

Batch Job Description, FTP, EDS Questions

repetitions): Name

OBJTYPE Object types Single values: *ALLOther values (up to 300 repetitions): Character value

Optional, Positional 4

VOL Volume identifier Single values: *MOUNTEDOther values (up to 75 repetitions): Character value

Optional, Positional 5

SEQNBR Sequence number 1-16777215, *END Optional

LABEL Label Character value, *LIB Optional

EXPDATE File expiration date Date, *PERM Optional

ENDOPT End of media option *REWIND, *LEAVE, *UNLOAD Optional

SAVF Save file Qualified object name Optional

Qualifier 1: Save file Name

Qualifier 2: Library Name, *LIBL, *CURLIB

MEDDFN Media definition Qualified object name Optional

Qualifier 1: Media definition

Name

Qualifier 2: Library Name, *LIBL, *CURLIB

OPTFILE Optical file Path name, * Optional

USEOPTBLK

Use optimum block *YES, *NO Optional

TGTRLS Target release *CURRENT, *PRV, V5R1M0, V5R2M0, V5R3M0

Optional

UPDHST Update history *YES, *NO Optional

CLEAR Clear *NONE, *ALL, *AFTER, *REPLACE

Optional

PRECHK Object pre-check *NO, *YES Optional

SAVACT Save active *NO, *LIB, *SYNCLIB, *SYSDFN Optional

SAVACTWAIT

Save active wait time Element list Optional

Element 1: Object locks

0-99999, 120, *NOMAX

Element 2: Pending record changes

0-99999, *LOCKWAIT, *NOCMTBDY, *NOMAX

Element 3: Other pending changes

0-99999, *LOCKWAIT, *NOMAX

SAVACTMS Save active message Qualified object name Optional

Page 21 of 37

Batch Job Description, FTP, EDS Questions

GQ queue

Qualifier 1: Save active message queue

Name, *NONE, *WRKSTN

Qualifier 2: Library Name, *LIBL, *CURLIB

FILEMBR File member Values (up to 50 repetitions): Element list

Optional

Element 1: File Name, *ALL

Element 2: Member Single values: *ALL, *NONEOther values (up to 50 repetitions): Generic name, name

ACCPTH Save access paths *SYSVAL, *NO, *YES Optional

SAVFDTA Save file data *YES, *NO Optional

STG Storage *KEEP, *FREE Optional

DTACPR Data compression *DEV, *NO, *YES, *LOW, *MEDIUM, *HIGH

Optional

COMPACT Data compaction *DEV, *NO Optional

OMITLIB Libraries to omit Single values: *NONEOther values (up to 300 repetitions): Generic name, name

Optional

OMITOBJ Objects to omit Values (up to 300 repetitions): Element list

Optional

Element 1: Object Qualified object name

Qualifier 1: Object Generic name, name, *NONE, *ALL

Qualifier 2: Library Generic name, name, *ALL

Element 2: Object type Character value, *ALL

ASPDEV ASP device Name, *, *SYSBAS, *CURASPGRP

Optional

OUTPUT Output *NONE, *PRINT, *OUTFILE Optional

OUTFILE File to receive output Qualified object name Optional

Qualifier 1: File to receive output

Name

Qualifier 2: Library Name, *LIBL, *CURLIB

OUTMBR Output member options

Element list Optional

Page 22 of 37

Batch Job Description, FTP, EDS Questions

Element 1: Member to receive output

Name, *FIRST

Element 2: Replace or add records

*REPLACE, *ADD

INFTYPE Type of output information

*OBJ, *LIB, *MBR, *ERR Optional

Top

Examples

Example 1: Saving Program and File With Same Name

SAVOBJ OBJ (PETE) LIB (LIBX) DEV (TAP01)

This command saves the objects named PETE which are located in the LIBX library. If, for example, LIBX contains both a program and a file named PETE, both objects are saved. The storage occupied by the object is not freed because the STG parameter default (*KEEP) was assumed.

Example 2: Freeing System Storage

SAVOBJ OBJ (MSTRPAY PAY*) LIB (QGPL) DEV (TAP01) STG (*FREE)

The object named MSTRPAY, and all the objects whose names start with the characters PAY located in the general purpose library (QGPL), are saved. As part of the save operation, the system storage that was occupied by the data portion of the saved member, module, program, service program, SQL package, and journal receiver objects is freed.

Example 3: Saving File on Optical

SAVOBJ OBJ (FILEA) OBJTYPE (*FILE) LIB (LIBY) DEV (OPT01) VOL (TOM) CLEAR (*REPLACE)

The file named FILEA in the LIBY library is saved in a file with the library name LIBY on the optical volume that is identified by the volume identifier TOM. If the LIBY file already exists on the optical volume, it is automatically replaced when FILEA is saved.

Example 4: Saving Objects Supported on Previous Release

SAVOBJ OBJ (PAY*) LIB (LIB1) DEV (TAP01) TGTRLS (*PRV)

This command saves the objects beginning with the characters PAY from the LIB1 library in a format compatible with the previous release of the OS/400 system. Only those objects supported on the previous release are saved.

Example 5: Saving Description and Data of File

Page 23 of 37

Batch Job Description, FTP, EDS QuestionsSAVOBJ OBJ (SAVEFILE) LIB (MYLIB) OBJTYPE (*FILE) DEV (TAP01) SAVFDTA (*YES)

This command saves the file named SAVEFILE which is located in the library named MYLIB. Both the description and the data are saved for this save file.

Error messages

*ESCAPE Messages

CPF3701 &1 objects were saved; &2 objects were not saved.

CPF3702 &1 objects saved; &2 not saved; &9 not included.

CPF3703 &2 &1 in &3 not saved.

CPF3708 Save file &1 in &2 too small.

CPF3709 Tape devices do not support same densities.

CPF3727 Duplicate device &1 specified on device name list.

CPF3728 Device &1 specified with other devices.

CPF3730 Not authorized to &2 &1 in library &3.

CPF3731 Cannot use &2 &1 in library &3.

CPF3733 &2 &1 in &3 previously damaged.

CPF3735 Storage limit exceeded for user profile &1.

CPF3738 Device &1 used for save or restore is damaged.

CPF3747 Object names cannot be specified with more than one library.

CPF3749 Objects from library &2 not saved.

CPF3767 Device &1 not found.

CPF3768 Device &1 not valid for command.

CPF377D Save ended because of read error on internal system resource.

CPF377E Not enough storage for save-while-active request.

CPF377F Save-while-active request prevented by pending record changes.

CPF3770 No objects saved or restored for library &1.

CPF3771 &1 objects saved from &3. &2 not saved.

CPF3774 Not all objects saved from library &3.

Page 24 of 37

Batch Job Description, FTP, EDS QuestionsCPF3778

Not all objects saved from all libraries. CPF378A

Message queue not available. CPF378C

SAVACTMSGQ(*WRKSTN) not valid for batch job. CPF378E

Library &1 not saved. CPF3781

Library &1 not found. CPF3782

File &1 in &2 not a save file. CPF3789

Only one library allowed with specified parameters. CPF388B

Optical file path name not valid. CPF379E

Not enough storage available to save library &1. CPF3793

Machine storage limit reached. CPF3794

Save or restore operation ended unsuccessfully. CPF3797

Objects from library &3 not saved. Save limit exceeded. CPF380B

Save cannot be completed at this time. CPF3812

Save file &1 in &2 in use. CPF3815

Save file &1 in &2 too small for save operation. CPF384E

USEOPTBLK(*YES) not valid for CD-ROM premastering. CPF3867

Contents of FILEMBR parameter not correct. CPF3868

FILEMBR specified but OBJTYPE must be *ALL or *FILE. CPF3871

No objects saved or restored; &3 objects not included. CPF388B

Optical file path name not valid. CPF3892

&2 &1 in &3 not saved. CPF3894

Cancel reply received for message &1. CPF38A2

ASP device &1 not correct. CPF38A3

File &1 in &2 not valid with ASPDEV. CPF38A4

ASP device &1 not correct. CPF5729

Not able to allocate object &1. CPF9809

Library &1 cannot be accessed. CPF9812

Page 25 of 37

Batch Job Description, FTP, EDS QuestionsFile &1 in library &2 not found.

CPF9814 Device &1 not found.

CPF9820 Not authorized to use library &1.

CPF9822 Not authorized to file &1 in library &2.

CPF9825 Not authorized to device &1.

CPF9833 *CURASPGRP or *ASPGRPPRI specified and thread has no ASP group.

CPFB8ED Device description &1 not correct for operation.

OPT1332 Optical volume not found in device &1.

*STATUS Messages

CPF3770 No objects saved or restored for library &1.

CPF3771 &1 objects saved from &3. &2 not saved.

CPF3871 No objects saved or restored; &3 objects not included.

Restore Object (RSTOBJ)

The Restore Object (RSTOBJ) command restores to the system a single object or a group of objects in a single library that were saved on a tape or optical volume, or in a save file using a single command. Objects to be restored could have been saved by the Save Object (SAVOBJ), Save Changed Objects (SAVCHGOBJ) or Save Library (SAVLIB) command. The RSTOBJ command restores the object description and contents of each object specified in the command.

For job queues, output queues, user-defined message queues, logical files, and data queues, only the object descriptions are restored; the contents of those objects are not restored. However, logical file access paths can be saved by a save command with ACCPTH(*YES) specified; if this is done, the access paths can be restored. More information on restoring access paths is in the Database information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.

The command can be used to restore the objects even if the object storage was freed when the objects were saved, or if the objects were deleted after they were saved. If the storage was not freed as part of a save operation, each object is restored in the same area of storage that it previously occupied. If the version of the object being restored is larger than the version in the system (for example, data records that were deleted from the system still exist in the saved version of a file), the additional storage needed for the object is acquired. If the saved version of the object is smaller (for example, data records that are added to the system), the space that was acquired for the object remains assigned to that object and available for use by that object.

If logical file access paths were saved (ACCPTH(*YES) was specified when the objects were saved), the access paths are restored if (1) all based-on physical files are also

Page 26 of 37

Batch Job Description, FTP, EDS Questionsbeing restored by the same restore command, (2) the logical file is also being restored by the same restore command, or the logical file already exists on the system (the same file exists, not a re-created version), and (3) MAINT(*IMMED or *DLY) is in effect for the logical file if it still exists on the system.

If the storage was freed, the system finds the storage space needed to store the contents (only the data portion) of each file, module, program, service program, journal receiver, and Structured Query Language (SQL) package. If the objects do not exist on the system because they were deleted or they are being restored in a different system, the system must find the storage to store everything (the description and the data portion) about each unknown object.

The user profile of the system default owner (QDFTOWN) becomes the default owner of objects restored in the system whose owner is not known to the system.

If an object is being restored over an existing object on the system, the object auditing value of the existing object is kept. If the object is being restored as new to the system, the object auditing value is restored from the media.

ATTENTION: Do not use this command to restore licensed programs into library QSYS. Unpredictable results can occur.

Restrictions:

This command is shipped with no public authority (*EXCLUDE). You must have use (*USE) authority for the Create Save File (CRTSAVF)

command when restoring a save file that does not currently exist on the system.

When saving or restoring to an existing database file using the OUTFILE parameter, you must have execute (*EXECUTE) authority to the library where the output database file is located.

With the exception of overrides for the restore listing file and database files specified for the OUTFILE parameter, this command ignores all file overrides that are currently in effect for the job.

You must have save system (SAVSYS) special authority, or all of the following object authorities:

o Add (*ADD) and execute (*EXECUTE) authorities for the specified library and save file library.

o Object existence (*OBJEXIST) authority for, or be the owner of, each object specified if the object already exists in the library on the system. *OBJEXIST and use (*USE) authorities are required for message queue objects. If the object does not already exist in the library on the system, you must have *ADD authority for the user profiles that own each object being restored.

o If VOL(*SAVVOL) is specified, *USE authority to the saved-from library. The RSTOBJ command does not restore the library's data dictionary or its

associated database files. To do this, the RSTLIB command must be used. You must have *USE authority for the save file to restore from the save file. In

addition, the user must have *USE authority for the device description when restoring from a tape or optical device.

When using a media definition, you must have *USE authority to the media definition and *EXECUTE authority to the media definition library.

Page 27 of 37

Batch Job Description, FTP, EDS Questions If this command is used to restore a program, the copy of that program that is

currently in the system must not be running while the program is being restored. If this occurs, the running program will not be restored.

Objects saved by separate commands must also be restored by separate commands. If a single command is used, some of the objects are not restored.

If the user domain object user space (*USRSPC), user index (*USRIDX), or user queue (*USRQ) is restored to a library that is not permitted in the system value QALWUSRDMN (allow user domain objects in libraries), the object is converted to a system domain object.

Parameters

Keyword Description Choices Notes

OBJ Objects Single values: *ALLOther values (up to 300 repetitions): Generic name, name

Required, Positional 1

SAVLIB Saved library Single values: *ANYOther values (up to 300 repetitions): Generic name, name

Required, Positional 2

DEV Device Single values: *SAVF, *MEDDFNOther values (up to 4 repetitions): Name

Required, Positional 3

OBJTYPE Object types Single values: *ALLOther values (up to 73 repetitions): *ALRTBL, *BNDDIR, *CFGL, *CHTFMT, *CLD, *CLS, *CMD, *CRG, *CRQD, *CSI, *CSPMAP, *CSPTBL, *DTAARA, *DTAQ, *EDTD, *EXITRG, *FCT, *FILE, *FNTRSC, *FNTTBL, *FORMDF, *FTR, *GSS, *IGCDCT, *IGCSRT, *IGCTBL, *IMGCLG, *JOBD, *JOBQ, *JOBSCD, *JRN, *JRNRCV, *LOCALE, *MEDDFN, *MENU, *MGTCOL, *MODULE, *MSGF, *MSGQ, *NODGRP, *NODL, *OUTQ, *OVL, *PAGDFN, *PAGSEG, *PDFMAP, *PDG, *PGM, *PNLGRP, *PRDAVL, *PRDDFN, *PRDLOD, *PSFCFG, *QMFORM, *QMQRY, *QRYDFN, *RCT, *SBSD, *SCHIDX, *SPADCT, *SQLPKG, *SQLUDT, *SRVPGM, *SSND, *SVRSTG, *S36, *TBL, *TIMZON, *USRIDX, *USRQ, *USRSPC, *VLDL, *WSCST

Optional, Positional 4

VOL Volume identifier

Single values: *MOUNTED, *SAVVOLOther values (up to 75 repetitions): Character value

Optional, Positional 5

SEQNBR Sequence number

1-16777215, *SEARCH Optional, Positional 6

LABEL Label Character value, *SAVLIB Optional

ENDOPT End of media option

*REWIND, *LEAVE, *UNLOAD Optional

Page 28 of 37

Batch Job Description, FTP, EDS Questions

SAVF Save file Qualified object name Optional

Qualifier 1: Save file

Name

Qualifier 2: Library

Name, *LIBL, *CURLIB

OPTION Option *ALL, *NEW, *OLD, *FREE Optional

FILEMBR File member Values (up to 50 repetitions): Element list Optional

Element 1: File

Name, *ALL

Element 2: Member

Single values: *ALL, *NONEOther values (up to 50 repetitions): Generic name, name

MBROPT Data base member option

*MATCH, *ALL, *NEW, *OLD Optional

SAVDATE Date when saved

Date Optional

SAVTIME Time when saved

Time Optional

ALWOBJDIF

Allow object differences

Single values: *NONE, *ALLOther values (up to 4 repetitions): *AUTL, *FILELVL, *OWNER, *PGP

Optional

FRCOBJCVN

Force object conversion

Single values: *SYSVAL, *NOOther values: Element list

Optional

Element 1: Convert during restore

*YES

Element 2: Objects to convert

*RQD, *ALL

RSTLIB Restore to library

Name, *SAVLIB Optional

OUTPUT Output *NONE, *PRINT, *OUTFILE Optional

MEDDFN Media definition

Qualified object name Optional

Qualifier 1: Media definition

Name

Qualifier 2: Name, *LIBL, *CURLIB

Page 29 of 37

Batch Job Description, FTP, EDS Questions

Library

OPTFILE Optical file Path name, * Optional

RSTASPDEV

Restore to ASP device

Name, *SAVASPDEV Optional

RSTASP Restore to ASP number

1-32, *SAVASP Optional

OUTFILE File to receive output

Qualified object name Optional

Qualifier 1: File to receive output

Name

Qualifier 2: Library

Name, *LIBL, *CURLIB

OUTMBR Output member options

Element list Optional

Element 1: Member to receive output

Name, *FIRST

Element 2: Replace or add records

*REPLACE, *ADD

INFTYPE Type of output information

*OBJ, *MBR Optional

OMITLIB Libraries to omit

Single values: *NONEOther values (up to 300 repetitions): Generic name, name

Optional

OMITOBJ Objects to omit

Values (up to 300 repetitions): Element list Optional

Element 1: Object

Qualified object name

Qualifier 1: Object

Generic name, name, *NONE, *ALL

Qualifier 2: Library

Generic name, name, *ALL

Element 2: Object type

Character value, *ALL

Top

Page 30 of 37

Batch Job Description, FTP, EDS Questions

Examples

Example 1: Restoring Most Recently Saved Version

RSTOBJ OBJ (PAYROLL) SAVLIB (LIBX) DEV (TAP01) OBJTYPE (*PGM) VOL (*SAVVOL)

This command restores to LIBX the program named PAYROLL that was saved from LIBX. The tape drive named TAP01 is used to restore the most recently saved version of the program.

Example 2: Specifying Save Date and Time

RSTOBJ OBJ (PAY*) SAVLIB (LIBX) DEV (OPT01) VOL (ABCD) OPTION (*OLD) SAVDATE (102202) SAVTIME (143000) RSTLIB (LIBY)

All objects whose names start with PAY and that were saved from the library named LIBX on optical volume ABCD at 14:30:00 on 10/22/02 are restored to LIBY. Volume ABCD must be put on the optical device named OPT01. Because OPTION(*OLD) is specified, the only objects restored are those having the same object name and type both in LIBY on the system and in LIBX on the optical volume.

Example 3: Adding a New Program to the QGPL Library

RSTOBJ OBJ (NEWPROG) SAVLIB (QGPL) DEV (OPT01) OBJTYPE (*PGM) VOL (PGMS) OPTION (*NEW) ALWOBJDIF (*AUTL)

A new program named NEWPROG is added to the general purpose library, QGPL. It is restored from a volume labeled PGMS that is inserted in the optical device named OPT01. If the object was saved on a different system and was linked to an authorization list, it will be linked to the authorization list with the same name on this system.

Example 4: Printing An Output List

RSTOBJ OBJ (*ALL) SAVLIB (LIB) DEV (TAP01) OBJTYPE (*PGM) VOL (SVOL) SEQNBR (2) SAVDATE (082392) SAVTIME (143000) OUTPUT (*PRINT)

All programs that were saved from the library named LIB that exist in the saved version on the tape volume named SVOL, sequence number 2, saved at 14:30:00 on 08/23/92, are restored to the library named LIB. An output list of all objects restored as well as objects not restored is provided.

Example 5: Restoring Journal Receivers

RSTOBJ OBJ (*ALL) SAVLIB (BACKUP) DEV (*SAVF) OBJTYPE (*JRNRCV) SAVF (SAVEJ) RSTASP (3)

Page 31 of 37

Batch Job Description, FTP, EDS QuestionsAll journal receivers that were saved from the library named BACKUP into the save file named SAVEJ are restored to the library named BACKUP. The journal receivers are restored to basic user ASP 3 (unless they already exist in the library named BACKUP and are in a different ASP or ASP 3 contains a library).

Error messages

*ESCAPE Messages

CPF370C Not authorized to ALWOBJDIF parameter.

CPF3705 &2 &1 in &3 not journaled.

CPF3706 &2 &1 not restored to library &3.

CPF3707 Save file &1 in &2 contains no data.

CPF3709 Tape devices do not support same densities.

CPF3727 Duplicate device &1 specified on device name list.

CPF3728 Device &1 specified with other devices.

CPF3730 Not authorized to &2 &1 in library &3.

CPF3731 Cannot use &2 &1 in library &3.

CPF3733 &2 &1 in &3 previously damaged.

CPF3738 Device &1 used for save or restore is damaged.

CPF3739 Database file &1 member in &3 damaged.

CPF374C No objects restored to ASP &2.

CPF3743 File cannot be restored, displayed, or listed.

CPF3748 Object information for library &1 damaged.

CPF3767 Device &1 not found.

CPF3768 Device &1 not valid for command.

CPF3769 File found on media not save/restore file.

CPF3770 No objects saved or restored for library &1.

CPF3773 &1 objects restored. &2 not restored to &4.

CPF3780 Specified file for library &1 not found.

CPF3781 Library &1 not found.

CPF3782 File &1 in &2 not a save file.

Page 32 of 37

Batch Job Description, FTP, EDS QuestionsCPF3783

Cannot determine VOL(*SAVVOL) location. No objects restored. CPF3784

Restore device specified in the DEV parameter does not match VOL(*SAVVOL) device.

CPF3791 While processing &2 &1 in &3, encountered end of file &4.

CPF3793 Machine storage limit reached.

CPF3794 Save or restore operation ended unsuccessfully.

CPF3796 Storage limit exceeded for user profile &4.

CPF37A5 RSTASP &1 is not online.

CPF3805 Objects from save file &1 in &2 not restored.

CPF3807 Data decompression error for save file &1 in &2.

CPF3812 Save file &1 in &2 in use.

CPF384F &2 &1 not restored to library &3.

CPF3867 Contents of FILEMBR parameter not correct.

CPF3868 FILEMBR specified but OBJTYPE must be *ALL or *FILE.

CPF3871 No objects saved or restored; &3 objects not included.

CPF3872 Not all objects restored from library &3 to library &4.

CPF38A2 ASP device &1 not correct.

CPF38A6 Only one library allowed with specified parameters.

CPF5729 Not able to allocate object &1.

CPF9809 Library &1 cannot be accessed.

CPF9812 File &1 in library &2 not found.

CPF9814 Device &1 not found.

CPF9820 Not authorized to use library &1.

CPF9822 Not authorized to file &1 in library &2.

CPF9825 Not authorized to device &1.

CPF9829 Auxiliary storage pool &1 not found.

CPFB8ED Device description &1 not correct for operation.

OPT1498 Volume name list exhausted on device &1.

Page 33 of 37

Batch Job Description, FTP, EDS QuestionsOPT1502

Attempted to process past the end of a multi-volume set. OPT1605

Media or device error occurred.

FTP

You can set up your iSeries(TM) server to send, receive, and share files across networks by using the file transfer protocol (FTP). You can also rename, add, and delete files. Before you set up your system to transfer files, you must have TCP/IP configured and started on your system.

Transfer a file from a remote host

FTP as batch job

In addition to running the FTP client interactively, you can run the FTP client in an unattended mode.

Batch FTP: A simple example

The following is a simple example of a batch file transfer that involves the successful transfer of one file from a remote system.

The components are as follows:

A CL program An input file of FTP commands An output file of FTP messages

The CL Program

************************************************************ ITSOLIB1/QCLSRC BATCHFTP: ---------------------- PGM OVRDBF FILE (INPUT) TOFILE (ITSOLIB1/QCLSRC) MBR (FTPCMDS) OVRDBF FILE (OUTPUT) TOFILE (ITSOLIB1/QCLSRC) MBR (OUT) FTP RMTSYS (SYSxxx) ENDPGM ************************************************************ Note:

To make this sample work when written with ILECL, you must add OVRSCOPE (*CALLLVL) to the OVRDBF commands.

The BATCHFTP program overrides the INPUT parameter to the source physical file ITSOLIB1/QCLSRC MBR (FTPCMDS). The output is sent to MBR (OUT).

The Input Commands File

************************************************************ ITSOLIB1/QCLSRC FTPCMDS:

Page 34 of 37

Batch Job Description, FTP, EDS Questions --------------------- ITSO ITSO CD ITSOLIB1 SYSCMD CHGCURLIB ITSOLIB2 GET QCLSRC.BATCHFTP QCLSRC.BATCHFTP (REPLACE QUIT ************************************************************

The FTP subcommands required are shown in the FTPCMDS file.

The Output Messages File

************************************************************ FTP Output Redirected to a File FTP Input from Overridden File Connecting to host name SYSxxx at address x.xxx.xx.xxx using port 21. 220-QTCP at SYSxxx.sysnam123.ibm.com. 220 Connection will close if idle more than 5 minutes. Enter login ID (itso): > ITSO ITSO 331 Enter password. 230 ITSO logged on. OS/400 is the remote operating system. The TCP/IP version is "V3R1M0". 250 Now using naming format "0". 257 "QGPL" is current library. Enter an FTP subcommand. > CD ITSOLIB1 Enter an FTP subcommand. 250 Current library changed to ITSOLIB1. > SYSCMD CHGCURLIB ITSOLIB2 Enter an FTP subcommand. > GET QCLSRC.BATCHFTP QCLSRC.BATCHFTP (REPLACE 200 PORT subcommand request successful. 150 Retrieving member BATCHFTP in file QCLSRC in library ITSOLIB1. 250 File transfer completed successfully. 147 bytes transferred in 0.487 seconds. Transfer rate 0.302 KB/sec. Enter an FTP subcommand. > QUIT 221 QUIT subcommand received. ************************************************************

The output file is shown. It is a straightforward matter to write a program to process this file and display an error message on QSYSOPR if there are any error messages. FTP error messages have numbers that start with a 4 or 5.

Interactive FTP

1. Start your FTP client session. For this scenario: In the iSeries character-based interface, type STRTCPFTP and press Enter.

2. Specify the name of the remote system to which you want to send the file. For this scenario: theirco.com

Page 35 of 37

Batch Job Description, FTP, EDS Questions3. Tell the remote system your user name for the remote server.

For this scenario: 4. Enter login ID (yourid):

===>yourid5. Tell the remote system your password for the remote server.

For this scenario: 6. Enter password:

===>yourpassword

7. Locate the directory on the TheirCo server from which you want to transfer the file. For this scenario: ===>cd /qibm/userdata/os400/dirserv/usrtools/windows

8. Navigate to the directory on the local server to which you want to transfer the file. For this scenario: ===>lcd /qibm/userdata/os400/dirserv/usrtools/windows

9. Specify file type, ASCII or BINARY. Default file type is ASCII. For a .jar file, you must switch the file transfer type to binary. For this scenario: ===> binary

10. Request a file transfer from the remote server system to the client system. For this scenario: ===> get example.jar

11. When finished, Exit from FTP. For this scenario: ===> QUIT

1) What happens if u do a RUNQRY on Source PF?2) PF1 is having 2 LF’s LF1 & LF2, LF2 is having unique keyword associated with

it, and if u are trying to insert a duplicate record into a PF? What happens and what is the error which u get?

3) PF1 is having 3 LF’s and LF1 is having 5 key fields and LF2 is having 4 key fields and LF3 is having 3 key fields, which will u compile first and why?

4) I should design a PF in which we should be able to insert records into a PF but we should not be able to modify any records? How can we achieve that?

5) If I change any field in a PF, then is it necessary to compile all the LF’s that are built using this PF?

6) A PF is not containing any records in it, but when we do a runqry on that PF, it says member full, Then how will u handle this scenario? I mean what will u do so that u store data in that PF?

7) In CL, when I encounter any error I need to display the Message ID of that error case, like cpf9801 ? How to display that particular message ID and description through CL?

8) How will get the record count of any PF in CL?

9) How will get the record count of any PF in RPG with out using READ opcode?

Page 36 of 37

Batch Job Description, FTP, EDS Questions10) In Array’s the no. of elements, entry length of array are given during

declaration, If I need to get dynamically at run time how to achieve it?

11)How can u modify a particular field of a PF through RPG?

Solutions:-

RTVBRKCTL - FILELIB(10), SRCLIB(10), TESTSYS(8)

RTVNETA - SYSNAME (8)

STRTCPFTP - RMTSYS('intnetadr intnetadr(143.98.100.44)')

RTVMBRD FILE(PF1) MBR(&JAN2005) NBRCURRCD(&RECCNT)

If cond(&reccnt *eq 0) then(goto cmdlbl(endpgm))

if cond(&system *eq &testsys) then(FTP RMTSYS(dublin2))

else cmd(FTP RMTSYS(LASVEGAS))

RCVMSG MSGDTA(&MSGDTA) MSGID(&MSGID) MSGF(&MSGF) +

MSGFLIB(&MSGFLIB)

RTVSYSVAL SYSVAL(QDATE) RTNVAR(&DATE)

CVTDAT DATE(&DATE) TOVAR(&YMD) FROMFMT(*SYSVAL) +

TOFMT(*YMD) TOSEP(*NONE)

RTVJOBA JOB(&WSID) USER(&USER) TYPE(&TYPE)

bypass the prompt screen if batch

FQSYSPRT O F 198 PRINTER PRTCTL(LINE:*compat)

F OFLIND(*INOF)

F USROPN

Page 37 of 37