chgcurlib

12
COMMANDS & OTHER TOPICS CHGCURLIB (Change Current Library) Command Purpose The Change Current Library (CHGCURLIB) command replaces the current library entry of the library list. Note : If the current library entry of the library list is changed from a menu or program that has a current library associated with it, then the current library changes are only in effect during the call level of the menu or program from which it was changed. Required Parameter CURLIB Specifies the library that replaces the current library entry in the job's library list. *CRTDFT: No library is the current entry of the library list. If objects are created into the current library, the QGPL library is used as the default. library-name: Specify the name of the library that replaces the current library entry in the job's library list. Note : QTEMP cannot be specified for this parameter. Example for CHGCURLIB NK ELURU Page 1

Upload: nirishkumar

Post on 11-Jan-2016

219 views

Category:

Documents


1 download

DESCRIPTION

ALL ABOUT CURRENT LIBRARAY

TRANSCRIPT

Page 1: CHGCURLIB

COMMANDS & OTHER TOPICS

CHGCURLIB (Change Current Library) Command

Purpose

The Change Current Library (CHGCURLIB) command replaces the current library entry of the

library list.

Note: If the current library entry of the library list is changed from a menu or program that has a

current library associated with it, then the current library changes are only in effect during

the call level of the menu or program from which it was changed.

Required Parameter

CURLIB

Specifies the library that replaces the current library entry in the job's library list.

*CRTDFT: No library is the current entry of the library list. If objects are created into

the current library, the QGPL library is used as the default.

library-name: Specify the name of the library that replaces the current library entry in the

job's library list.

Note: QTEMP cannot be specified for this parameter.

Example for CHGCURLIB

CHGCURLIB CURLIB(ULIB10)

This command changes the current library entry of the current job's library list to contain library

ULIB10.

NK ELURU Page 1

Page 2: CHGCURLIB

COMMANDS & OTHER TOPICS

DSPLIB (Display Library) Command Description

Purpose

The Display Library (DSPLIB) command displays the contents of one or more specified

libraries; that is, it displays a list of the names and types of all objects contained in each library,

regardless of the authorization on each object. The command can also be used to display a list of

libraries from which individual libraries may be selected for a display of their objects. From the

display of a library's contents, options can be specified to request displays that show more

specific information about the objects in the library. If more than one library is to be displayed,

they are displayed one at a time. The display lists the name and type of each library and the

number of objects in the library.

DSPLIBL (Display Library List) Command Description

Purpose

The Display Library List (DSPLIBL) command displays the system portion of the library list, the

current library entry of the job's library list, product libraries, and the user portion of the library

list.

Determining which source file member was used to create an object

When an object is created from source, the information about the source file, library, and

member is held in the object. The date/time that the source member was last changed before

object creation is also saved in the object.

The information in the object can be displayed with the Display Object Description

(DSPOBJD) command and specifying DETAIL(*SERVICE).

NK ELURU Page 2

Page 3: CHGCURLIB

COMMANDS & OTHER TOPICS

This information can help you in determining which source member was used and if the existing

source member was changed since the object was created.

You can also ensure that the source used to create an object is the same as the source that is

currently in the source member using the following commands:

The Display File Description (DSPFD) command using TYPE(*MBR). This display

shows both date/times for the source member. The Last source update date/time value

should be used to compare to the Source file date/time value displayed from the

DSPOBJD command.

The Display Object Description (DSPOBJD) command using DETAIL(*SERVICE).

This display shows the date/time of the source member used to create the object.

Note: If you are using the data written to output files to determine if the source and object dates

are the same, then you can compare the ODSRCD (source date) and ODSRCT(source time)

fields from the output file of the DSPOBJD DETAIL(*SERVICE) command to

the MBUPDD (member update date) and MBUPDT (member update time) fields from the

output file of the DSPFD TYPE(*MBR) command.

CRTDUPOBJ (Create Duplicate Object) Command Description

Purpose

The Create Duplicate Object (CRTDUPOBJ) command copies a single object or a group of

objects. It does not create an exact duplicate of files. The newly created object must be

renamed if it is stored in the same library as the original object. If it is stored in a library

other than the one that contains the original object, it can retain the name of the original

object. The user can specify a generic object name to copy a group of related objects, and

NK ELURU Page 3

Page 4: CHGCURLIB

COMMANDS & OTHER TOPICS

the library in which the newly created objects are stored. The user can also specify whether

data in physical files or save files is copied. The duplicate object is authorized the same as

the original object. The user who issues the command owns the duplicate object.

For files, the duplicate object shares the format of the original file. When a logical file is

copied into another library, two cases determine the basing for the file. First, if both the

logical file and its based-on physical file are originally in the same library, a duplicate of

the physical file must be created in the new library before a duplicate of the logical file is

created. After these two duplicates are created, the new logical file is based on the new

physical file.

Second, if the logical file and its based-on physical file are originally in different libraries,

it is not necessary to duplicate the physical file before duplicating the logical file. In this

case, the duplicated logical file is based on the same physical file as was the original

logical file. Unlike the first case, even if the physical file is copied into the new library

before the logical file is copied, the duplicated logical file is based on the original physical

file, not on the duplicated physical file.

When duplicating a file using the CRTDUPOBJ command, the format of the FROM file is

shared with the TO (newly created) file. When the maximum number (approximately 32K)

for sharing a file's format has been reached, the newly created file will create a new format

instead of sharing the FROM file's format.

Note: All of the files that share the same format will be considered related and will be

grouped together in the same save list when a save operation is performed.

DSPFD (Display File Description) Command Description

NK ELURU Page 4

Page 5: CHGCURLIB

COMMANDS & OTHER TOPICS

Purpose

The Display File Description (DSPFD) command shows one or more types of information

retrieved from the file descriptions of one or more database and/or device files. The information

is provided for each file that has the specified name and that is found in the libraries named in

the specified library qualifier to which the user has access. The information can be shown,

printed, or directed to a database output file (OUTFILE).

DSPFFD (Display File Field Description) Command Description

Purpose

The Display File Field Description (DSPFFD) command shows, prints, or places in a database

file field-level information for one or more files in a specific library or all the libraries to which

the user has access.

If the information is put in a database file, the database file will have a record format named

QWHDRFFD. The fields in record format QWHDRFFD are the same as the fields in the IBM-

supplied format QWHDRFFD in file QADSPFFD in the library QSYS. The following

information is contained in the database file:

For each file specified in the command, the database record contains:

o The name of the file, the name of the library containing the file, the file type, and

file member

o The file creation date and the number of record formats in the file

o The name of the record format used by the file, the format level identifier, the

format text description, the format record length, and the number of fields in the

format

o The information retrieval date and time

For each field in the record format, the record also contains the following, if applicable:

o The field name and external field name

o The type and length of the field

NK ELURU Page 5

Page 6: CHGCURLIB

COMMANDS & OTHER TOPICS

o For fields referencing other fields, the name of the referenced file, record format,

and field; if any attributes of the referenced field were changed, the attribute type

is given

o The edit code, edit word, and column headings associated with the field

o A signal of whether validity checking is performed on the field

o The validity check message identifier, the message file, and the library

o The use of the field

To create an OUTFILE, the user must have object operational authority to the Create Physical

File (CRTPF) command and add authority to the library. To use an existing OUTFILE, the user

must have object operational and add authority to the file. The user must also have object

management and delete authority if *REPLACE is specified on the OUTMBR parameter.

Restrictions:

1. Before users can display each file specified, they must have object operational authority

for the file.

2. Also, of the libraries specified by the library qualifier, only the libraries for which the

user has read authority are searched.

EDTOBJAUT (Edit Object Authority) Command Description

Purpose

The Edit Object Authority (EDTOBJAUT) command displays the list of authorized users of an

object and their associated authorities. If you own the object or have *ALLOBJ special authority,

you can add, change, or remove authority for the object. If you have object management

authority for the object, you can remove your specific authorities or grant or remove them for

other users.

The following are displayed for the specified object:

NK ELURU Page 6

Page 7: CHGCURLIB

COMMANDS & OTHER TOPICS

the object name

the name of the library containing the object

the name of the object's owner, the object's type, and a list of all the users who are

authorized to use the object

the authorities that each user has for the object

The authorization list name if the object is secured by an authorization list.

If an object does not have an owner name associated with it, no authorities for the object are

shown.

Restrictions:

1. The user must have object management authority to the object to use this command.

2. If the object is a file, the user must have object operational and object management

authorities.

GRTOBJAUT (Grant Object Authority) Command Description

Purpose

The Grant Object Authority (GRTOBJAUT) command is used by one user to grant specific

authority for the object named in this command to another user or group of users.

Authority can be given to:

Named users

Users (*PUBLIC) who do not have authority specifically given to them either for the

object or for the authorization list

Users of the referenced object (specified in the REFOBJ parameter)

Users on an established authorization list

NK ELURU Page 7

Page 8: CHGCURLIB

COMMANDS & OTHER TOPICS

If AUT(*AUTL) is specified, the PUBLIC authority for the object comes from the PUBLIC

authority of the authorization list securing the object. The AUTL parameter is used to secure an

object with an authorization list. User profiles cannot be secured by an authorization list

(*AUTL).This command can be used by an object's owner or by a user with object management

authority for the specified object. A user with object management authority can grant to other

users any authority that user has, except object management authority. Only the owner of the

object, or someone with all object special authority (*ALLOBJ), can grant object management

authority to a user. A user with *ALL authority can assign a new authorization list.

When granting authority to users, the REPLACE parameter indicates whether the authorities you

specify replace the user's existing authorities. The default value of REPLACE (*NO) gives the

authority that you specify, but it does not remove any authority that is greater than you specified,

unless you are granting *EXCLUDE authority. REPLACE(*YES) removes the user's current

authorities, then grants the authority that you specify.

When granting authority with a reference object, this command gives the authority that you

specify, but it does not remove any authority that is greater than you specified, unless you are

granting *EXCLUDE authority.

Restrictions:

1. This command must get an exclusive lock on a database file before read or object

operational authority can be given to a user.

2. If a user requests authority for another specified user to a device currently in use by

another authorized user, authority to the device is not given.

3. Object type *AUTL cannot be specified.

4. AUT(*AUTL) is valid only with USER(*PUBLIC).

5. A user must either be the owner of the object or have *ALL authority to use the AUTL

parameter.

6. The user must have object management authority to the object.

7. If the object is a file, the user must have object operational and object management

authorities.

NK ELURU Page 8

Page 9: CHGCURLIB

COMMANDS & OTHER TOPICS

8. For display stations or for work station message queues associated with the display

station, if this command is not entered at the device for which authorities are being

granted, it should be preceded by the Allocate Object (ALCOBJ) command and followed

by the Deallocate Object (DLCOBJ) command.

NK ELURU Page 9