System API Reference
System API Reference
SC41-5801-03
AS/400e IBM
System API Reference
Version 4
SC41-5801-03
Note
Before using this information and the product it supports, be sure to read the information in Appendix D, “Notices” on page D-1.
This edition applies to Version 4 Release 4 Modification 0, of IBM Operating System/400 (Program 5769-SS1) and to all subsequent releases
and modifications until otherwise indicated in new editions. This edition applies only to reduced instruction set computer (RISC) systems.
Copyright International Business Machines Corporation 1998, 1999. All rights reserved.
US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
Contents
About System API Reference (SC41-5801) . . . . xxvii Installing Operations Navigator . . . . . . . . . . xxviii
Who Should Read This Book . . . . . . . . . . . . . xxvii Prerequisite and Related Information . . . . . . . . . xxviii
Conventions and Terminology Used in This Book . . xxvii How to send your comments . . . . . . . . . . . . . xxviii
OS/400 Terms and Special Values . . . . . . . . xxvii
AS/400 Operations Navigator . . . . . . . . . . . . xxvii Summary of Changes to System API Reference . . xxxi
Contents v
ldap_open()—Perform an LDAP Open Operation . . 18-26 ldap_url_search_s()—Perform an LDAP URL Search
ldap_perror()—Print LDAP Error Information . . . . . 18-27 Operation (Synchronous) . . . . . . . . . . . . . . 18-42
ldap_result()—Retrieve Result of an Asynchronous ldap_url_search_st()—Perform an LDAP URL Search
LDAP Operation . . . . . . . . . . . . . . . . . . . 18-27 Operation (Timed Synchronous) . . . . . . . . . . 18-43
ldap_result2error()—Retrieve LDAP Error Information 18-29 ldap_value_free()—Free Memory Allocated by
ldap_search()—Perform an LDAP Search Operation 18-29 ldap_get_values() . . . . . . . . . . . . . . . . . . 18-44
ldap_search_s()—Perform an LDAP Search Operation ldap_value_free_len()—Free Memory Allocated by
(Synchronous) . . . . . . . . . . . . . . . . . . . . 18-30 ldap_get_values_len() . . . . . . . . . . . . . . . . 18-45
ldap_search_st()—Perform an LDAP Search LDAP Client API Error Conditions . . . . . . . . . . 18-45
Operation (Timed Synchronous) . . . . . . . . . . 18-31
ldap_set_option()—Set LDAP Options . . . . . . . . 18-32 Chapter 19. Directory Services Configuration APIs 19-1
ldap_set_rebind_proc()—Set Rebind Procedure . . . 18-34 Directory Services Configuration APIs—Introduction . 19-1
ldap_simple_bind()—Perform a Simple LDAP Bind Change Directory Server Attributes (QgldChgDirSvrA)
Request . . . . . . . . . . . . . . . . . . . . . . . 18-34 API . . . . . . . . . . . . . . . . . . . . . . . . . 19-1
ldap_simple_bind_s()—Perform a Simple LDAP Bind Configure Directory Server (QgldCfgDirSvr) API . . . 19-7
Request (Synchronous) . . . . . . . . . . . . . . . 18-35 Export LDIF File (QgldExportLdif) API . . . . . . . . 19-9
ldap_ssl_start()—Start a Secure LDAP Connection . 18-36 Import LDIF File (QgldImportLdif) API . . . . . . . . 19-10
ldap_unbind()—Perform an LDAP Unbind Request . 18-39 List Directory Server Attributes (QgldLstDirSvrA) API 19-12
ldap_unbind_s()—Perform an LDAP Unbind Request | Publish Directory Object (QgldPubDirObj) API . . . . 19-14
(Synchronous) . . . . . . . . . . . . . . . . . . . . 18-40 Retrieve Directory Server Attributes (QgldRtvDirSvrA)
ldap_url_parse()—Parse an LDAP URL . . . . . . . 18-40 API . . . . . . . . . . . . . . . . . . . . . . . . . 19-17
ldap_url_search()—Perform an LDAP URL Search Synchronize System Distribution Directory to LDAP
Operation . . . . . . . . . . . . . . . . . . . . . . 18-41 (QGLDSSDD) API . . . . . . . . . . . . . . . . . . 19-20
Contents vii
Start New Scroller Page (QsnSclFF) API . . . . . . 32-6 Performance Considerations . . . . . . . . . . . . . 32-8
Write Characters to Scroller (QsnWrtSclChr) API . . 32-7 Create Session and Read Data—Example . . . . . . 32-9
Write Line to Scroller (QsnWrtSclLin) API . . . . . . 32-8
Contents ix
Journal and Commit Exit Programs—Introduction . . 47-1 Remove Remote Journal (QjoRemoveRemoteJournal)
Journaling . . . . . . . . . . . . . . . . . . . . . . . 47-2 API . . . . . . . . . . . . . . . . . . . . . . . . . 47-23
Commitment Control . . . . . . . . . . . . . . . . . 47-3 Retrieve Commitment Information (QTNRCMTI) API 47-24
Add Commitment Resource (QTNADDCR) API . . . 47-5 | Retrieve Journal Entries (QjoRetrieveJournalEntries)
Add Remote Journal (QjoAddRemoteJournal) API . . 47-10 | API . . . . . . . . . . . . . . . . . . . . . . . . . 47-27
Change Commitment Options (QTNCHGCO) API . . 47-13 Retrieve Journal Identifier Information (QJORJIDI) API 47-39
Change Journal State (QjoChangeJournalState) API 47-16 Retrieve Journal Information
| Delete Pointer Handle (QjoDeletePointerHandle) API 47-21 (QjoRetrieveJournalInformation) API . . . . . . . . 47-41
Materialize Journal Port Attributes Retrieve Journal Receiver Information
(QusMaterializeJournalPortAttr) API . . . . . . . . 47-21 (QjoRtvJrnReceiverInformation) API . . . . . . . . 47-49
Materialize Journal Space Attributes Rollback Required (QTNRBRQD) API . . . . . . . . 47-54
(QusMaterializeJournalSpaceAttr) API . . . . . . . 47-22 Send Journal Entry (QJOSJRNE) API . . . . . . . . 47-54
Remove Commitment Resource (QTNRMVCR) API . 47-22 Commitment Control Exit Program . . . . . . . . . . 47-57
Delete Journal Receiver Exit Program . . . . . . . . 47-61
Contents xi
Read SNADS File Server Object (QZDRDFSO) API . 57-5 Revoke SNADS File Server Object Access ID
Retrieve SNADS File Server Object Access ID (QZDRVKID) API . . . . . . . . . . . . . . . . . . 57-9
(QZDRTVID) API . . . . . . . . . . . . . . . . . . 57-8 Write to SNADS File Server Object (QZDWTFSO) API 57-9
Contents xiii
Parse Certificate (QSYPARSC, QsyParseCertificate) Change Function Usage Information (QSYCHFUI,
API . . . . . . . . . . . . . . . . . . . . . . . . . 70-18 QsyChangeFunctionUsageInfo) API . . . . . . . . 72-1
| Register Application for Certificate Use (QSYRGAP, Check User Function Usage (QSYCKUFU,
| QsyRegisterAppForCertUse) API . . . . . . . . . . 70-18 QsyCheckUserFunctionUsage) API . . . . . . . . . 72-2
Remove User Certificate (QSYRMVUC, Deregister Function (QSYDRGFN,
QsyRemoveUserCertificate) API . . . . . . . . . . 70-21 QsyDeregisterFunction) API . . . . . . . . . . . . 72-3
Remove Validation List Certificate (QSYRMVVC, Register Function (QSYRGFN, QsyRegisterFunction)
QsyRemoveVldlCertificate) API . . . . . . . . . . . 70-22 API . . . . . . . . . . . . . . . . . . . . . . . . . 72-4
| Deregister Application for Certificate Use Exit Retrieve Function Information (QSYRTVFI,
| Program . . . . . . . . . . . . . . . . . . . . . . . 70-23 QsyRetrieveFunctionInformation) API . . . . . . . . 72-7
| Update Certificate Usage Exit Program . . . . . . . 70-24 Retrieve Function Usage Information (QSYRTFUI,
QsyRetrieveFunctionUsageInfo) API . . . . . . . . 72-11
Chapter 71. Network Security APIs . . . . . . . . 71-1 Retrieve User Function Information (QSYRTUFI,
Network Security APIs—Introduction . . . . . . . . . 71-1 QsyRetrieveUserFunctionInfo) API . . . . . . . . . 72-13
Add NetWare Authentication Entry (QfpzAddNtwAutE)
API . . . . . . . . . . . . . . . . . . . . . . . . . 71-1 Chapter 73. Validation List APIs . . . . . . . . . . 73-1
Add Server Authentication Entry (QsyAddServerEntry) Validation List APIs—Introduction . . . . . . . . . . 73-1
API . . . . . . . . . . . . . . . . . . . . . . . . . 71-4 Add Validation List Entry (QSYADVLE) API . . . . . 73-1
Change NetWare Authentication Entry Change Validation List Entry (QSYCHVLE) API . . . 73-3
(QfpzChgNtwAutE) API . . . . . . . . . . . . . . . 71-4 Find Validation List Entry (QSYFDVLE) API . . . . . 73-6
Change Server Authentication Entry Open List of Validation List Entries (QSYOLVLE) API 73-8
(QsyChangeServerEntry) API . . . . . . . . . . . . 71-7 QsyAddValidationLstEntry()—Add Validation List Entry
End NetWare Connection (QfpzEndNtwCnn) API . . 71-8 API . . . . . . . . . . . . . . . . . . . . . . . . . 73-11
List NetWare Authentication Entries (QfpzListNtwAutE) QsyChangeValidationLstEntry()—Change Validation
API . . . . . . . . . . . . . . . . . . . . . . . . . 71-9 List Entry API . . . . . . . . . . . . . . . . . . . . 73-13
Remove NetWare Authentication Entry QsyFindFirstValidationLstEntry()—Find First Validation
(QfpzRmvNtwAutE) API . . . . . . . . . . . . . . . 71-12 List Entry API . . . . . . . . . . . . . . . . . . . . 73-16
Remove Server Authentication Entry QsyFindNextValidationLstEntry()—Find Next
(QsyRemoveServerEntry) API . . . . . . . . . . . 71-13 Validation List Entry API . . . . . . . . . . . . . . 73-18
Retrieve Server Authentication Entries (QSYRTVSE, QsyFindValidationLstEntry()—Find Validation List
QsyRetrieveServerEntries) API . . . . . . . . . . . 71-14 Entry API . . . . . . . . . . . . . . . . . . . . . . 73-20
Start NetWare Connection (QfpzStrNtwCnn) API . . 71-16 QsyFindValidationLstEntryAttrs()—Find Validation List
Verify NetWare Authentication Entry Entry Attributes API . . . . . . . . . . . . . . . . . 73-22
(QfpzVfyNtwAutE) API . . . . . . . . . . . . . . . 71-19 QsyRemoveValidationLstEntry()—Remove Validation
List Entry API . . . . . . . . . . . . . . . . . . . . 73-25
Chapter 72. User Function Registration APIs . . 72-1 QsyVerifyValidationLstEntry()—Verify Validation List
User Function Registration APIs—Introduction . . . . 72-1 Entry API . . . . . . . . . . . . . . . . . . . . . . 73-26
Remove Validation List Entry (QSYRMVLE) API . . 73-27
Contents xv
msgget()–Get Message Queue . . . . . . . . . . . . 78-12 sigfillset()—Initialize and Fill Signal Set . . . . . . . 80-23
msgrcv()–Receive Message Operation . . . . . . . . 78-14 sigismember()—Test for Signal in Signal Set . . . . 80-24
msgsnd()–Send Message Operation . . . . . . . . . 78-16 siglongjmp()—Perform Nonlocal Goto with Signal
Open List of Interprocess Communication Objects Handling . . . . . . . . . . . . . . . . . . . . . . . 80-25
(QP0ZOLIP) API . . . . . . . . . . . . . . . . . . 78-18 sigpending()—Examine Pending Signals . . . . . . . 80-27
Open List of Semaphores (QP0ZOLSM) API . . . . 78-24 sigprocmask()—Examine and Change Blocked
Retrieve an Interprocess Communication Object Signals . . . . . . . . . . . . . . . . . . . . . . . 80-28
(QP0ZRIPC) API . . . . . . . . . . . . . . . . . . 78-26 sigsetjmp()—Set Jump Point for Nonlocal Goto . . . 80-30
| sem_close()–Close Named Semaphore . . . . . . . 78-31 sigsuspend()—Wait for Signal . . . . . . . . . . . . 80-31
| sem_destroy()–Destroy Unnamed Semaphore . . . . 78-32 sigtimedwait()—Synchronously Accept a Signal for
| sem_getvalue()–Get Semaphore Value . . . . . . . 78-33 Interval of Time . . . . . . . . . . . . . . . . . . . 80-33
| sem_init()–Initialize Unnamed Semaphore . . . . . . 78-34 sigwait()—Synchronously Accept a Signal . . . . . . 80-35
| sem_init_np()–Initialize Unnamed Semaphore with sigwaitinfo()—Synchronously Accept a Signal and
| Maximum Value . . . . . . . . . . . . . . . . . . . 78-35 Signal Data . . . . . . . . . . . . . . . . . . . . . 80-36
| sem_open()–Open Named Semaphore . . . . . . . 78-36 sleep()—Suspend Processing for Interval of Time . . 80-38
| sem_open_np()–Open Named Semaphore with usleep()—Suspend Processing for Interval of Time . 80-39
| Maximum Value . . . . . . . . . . . . . . . . . . . 78-38
| sem_post()–Post to Semaphore . . . . . . . . . . . 78-40 Chapter 81. Simple Network Management Protocol
| sem_post_np()–Post Value to Semaphore . . . . . . 78-41 (SNMP) Subagent APIs . . . . . . . . . . . . . . 81-1
| sem_trywait()–Try to Decrement Semaphore . . . . 78-42 Simple Network Management Protocol (SNMP)
| sem_unlink()–Unlink Named Semaphore . . . . . . . 78-43 APIs—Introduction . . . . . . . . . . . . . . . . . 81-1
| sem_wait()–Wait for Semaphore . . . . . . . . . . . 78-44 SNMP Subagent APIs—Introduction . . . . . . . . . 81-1
| sem_wait_np()–Wait for Semaphore with Timeout . . 78-45 connectSNMP()—Establish Connection with SNMP
semctl()–Perform Semaphore Control Operations . . 78-46 Agent . . . . . . . . . . . . . . . . . . . . . . . . 81-3
semget()–Get Semaphore Set with Key . . . . . . . 78-49 debugDPI()—Set DPI Packet Trace . . . . . . . . . 81-4
semop()–Perform Semaphore Operations on disconnectSNMP()—End Connection with SNMP Agent 81-5
Semaphore Set . . . . . . . . . . . . . . . . . . . 78-51 DPI_PACKET_LEN()—Get Length of DPI Packet . . 81-6
shmat()–Attach Shared Memory Segment to Current fDPIparse()—Free Storage from DPI Packet Parse . 81-7
Process . . . . . . . . . . . . . . . . . . . . . . . 78-53 fDPIset()—Free Storage from DPI Set Packet . . . . 81-7
shmctl()–Perform Shared Memory Control Operations 78-54 mkDPIAreYouThere()—Make a DPI AreYouThere
shmdt()–Detach Shared Memory Segment from Packet . . . . . . . . . . . . . . . . . . . . . . . . 81-8
Calling Process . . . . . . . . . . . . . . . . . . . 78-56 mkDPIclose()—Make a DPI Close Packet . . . . . . 81-8
shmget()–Get ID of Shared Memory Segment with mkDPIopen()—Make a DPI Open Packet . . . . . . 81-9
Key . . . . . . . . . . . . . . . . . . . . . . . . . 78-57 mkDPIregister()—Make a DPI Register Packet . . . 81-10
mkDPIresponse()—Make a DPI Response Packet . 81-12
Chapter 79. Problem Determination APIs . . . . . 79-1 mkDPIset()—Make a DPI Set Packet . . . . . . . . 81-13
Problem Determination APIs—Introduction . . . . . . 79-1 mkDPItrap()—Make a DPI Trap Packet . . . . . . . 81-14
Qp0zDump()—Dump Formatted Storage Trace Data 79-1 mkDPIunregister()—Make a DPI Unregister Packet . 81-15
Qp0zDumpStack()—Dump Formatted Stack Trace Data 79-3 pDPIpacket()—Parse a DPI Packet . . . . . . . . . 81-16
Qp0zDumpTargetStack()—Dump Formatted Stack receiveDPIpacket()—Receive a DPI Packet from the
Trace Data of the Target Thread . . . . . . . . . . 79-5 SNMP Agent . . . . . . . . . . . . . . . . . . . . 81-16
Qp0zLprintf()—Print Formatted Job Log Data . . . . 79-7 sendDPIpacket()—Send a DPI Packet to the SNMP
Qp0zUprintf()—Print Formatted User Trace Data . . 79-9 Agent . . . . . . . . . . . . . . . . . . . . . . . . 81-17
waitDPIpacket()—Wait for a DPI Packet . . . . . . . 81-18
Chapter 80. Signal APIs . . . . . . . . . . . . . . 80-1
Signal Concepts . . . . . . . . . . . . . . . . . . . 80-1 Chapter 82. Simple Network Management Protocol
OS/400 Signal Management . . . . . . . . . . . . . 80-1 (SNMP) Manager APIs . . . . . . . . . . . . . . . 82-1
Differences from Signals on UNIX Systems . . . . . 80-3 Simple Network Management Protocol (SNMP)
Signal APIs—Summary . . . . . . . . . . . . . . . . 80-4 Manager APIs—Introduction . . . . . . . . . . . . 82-1
alarm()—Set Schedule for Alarm Signal . . . . . . . 80-4 snmpGet()—Retrieve MIB Objects . . . . . . . . . . 82-1
getitimer()—Get Value for Interval Timer . . . . . . . 80-5 snmpGetnext()—Retrieve Next MIB Object . . . . . 82-3
kill()—Send Signal to Process or Group of Processes 80-7 snmpSet()—Set MIB Objects . . . . . . . . . . . . . 82-6
pause()—Suspend Process Until Signal Received . . 80-9 SNMP Trap Support . . . . . . . . . . . . . . . . . 82-8
Qp0sDisableSignals()—Disable Process for Signals . 80-10 Using SNMP Manager APIs—Example . . . . . . . 82-10
Qp0sEnableSignals()—Enable Process for Signals . 80-12
setitimer()—Set Value for Interval Timer . . . . . . . 80-13 Chapter 83. Sockets APIs . . . . . . . . . . . . . 83-1
sigaction()—Examine and Change Signal Action . . 80-15 Sockets APIs—Introduction . . . . . . . . . . . . . . 83-1
sigaddset()—Add Signal to Signal Set . . . . . . . . 80-20 Sockets System Functions—Summary . . . . . . . . 83-1
sigdelset()—Delete Signal from Signal Set . . . . . . 80-21 accept()—Wait for Connection Request and Make
sigemptyset()—Initialize and Empty Signal Set . . . 80-22 Connection . . . . . . . . . . . . . . . . . . . . . 83-1
Contents xvii
ns_addr()—Translate Network Services Address to getpid()—Get Process ID . . . . . . . . . . . . . . . 86-3
12-byte Address . . . . . . . . . . . . . . . . . . 83-120 getppid()—Get Process ID of Parent Process . . . . 86-3
ns_ntoa()—Translate Network Services Address pipe()—Create Interprocess Channel . . . . . . . . . 86-4
from 12-byte Address . . . . . . . . . . . . . . . 83-121 Qp0wChkChld()—Check Status for Child Processes 86-5
ns_ntoa_r() — Translate Network Services Address Qp0wChkPgrp()—Check Status for Process Group . 86-6
from 12-byte Address . . . . . . . . . . . . . . . 83-121 Qp0wChkPid()—Check Status for Process ID . . . . 86-8
ntohl()—Convert Long Integer to Host Byte Order . 83-122 Qp0wGetJobID()—Get Qualified Job Name and ID for
ntohs()—Convert Short Integer to Host Byte Order 83-122 Process ID . . . . . . . . . . . . . . . . . . . . . 86-9
_putlong()—Put Long Byte Quantities . . . . . . . 83-123 Qp0wGetPgrp()—Get Process Group ID . . . . . . . 86-10
_putshort()—Put Short Byte Quantities . . . . . . . 83-123 Qp0wGetPid()—Get Process ID . . . . . . . . . . . 86-11
res_close()—Close Socket and Reset _res Structure 83-124 Qp0wGetPidNoInit()—Get Process ID without
res_init()—Initialize _res Structure . . . . . . . . . 83-124 Initializing for Signals . . . . . . . . . . . . . . . . 86-11
res_mkquery()—Place Domain Query in Buffer . . 83-125 Qp0wGetPPid()—Get Process ID of Parent Process 86-12
res_query()—Send Domain Query . . . . . . . . . 83-126 Qp0zEndTerminal()—End a Generic Terminal . . . . 86-12
res_search()—Search for Domain Name . . . . . . 83-127 Qp0zGetTerminalPid()—Get Process ID for a Generic
res_send()—Send Buffered Domain Query . . . . 83-128 Terminal . . . . . . . . . . . . . . . . . . . . . . . 86-13
res_xlate()—Translate DNS Packets . . . . . . . . 83-129 Qp0zIsATerminal()—Determine Whether Descriptor Is
sethostent()—Open Host Database . . . . . . . . 83-130 Connected to a Generic Terminal . . . . . . . . . . 86-14
sethostent_r()—Open Host Database . . . . . . . 83-131 Qp0zRunTerminal()—Run a Generic Terminal . . . . 86-14
setnetent()—Open Network Database . . . . . . . 83-132 Qp0zStartTerminal()—Start a Generic Terminal . . . 86-16
setnetent_r()—Open Network Database . . . . . . 83-132 Qp0zSystem()—Run a CL Command . . . . . . . . 86-18
setprotoent()—Open Protocol Database . . . . . . 83-133 setpgid()—Set Process Group ID for Job Control . . 86-19
setprotoent_r()—Open Protocol Database . . . . . 83-133 spawn()—Spawn Process . . . . . . . . . . . . . . 86-19
setservent()—Open Service Database . . . . . . . 83-134 spawnp()—Spawn Process with Path . . . . . . . . 86-26
setservent_r()—Open Service Database . . . . . . 83-134 wait()—Wait for Child Process to End . . . . . . . . 86-33
Debugging IP over SNA Configurations . . . . . . 83-135 waitpid()—Wait for Specific Child Process . . . . . . 86-35
About Shell Scripts . . . . . . . . . . . . . . . . . . 86-36
Chapter 84. Secure Sockets Layer (SSL) APIs . . 84-1
Secure Sockets Layer (SSL) APIs—Introduction . . . 84-1 Chapter 87. XA APIs . . . . . . . . . . . . . . . . 87-1
SSL_Create()—Enable SSL Support for the Specified XA APIs—Introduction . . . . . . . . . . . . . . . . 87-1
Socket Descriptor . . . . . . . . . . . . . . . . . . 84-2 Restrictions . . . . . . . . . . . . . . . . . . . . . . 87-2
SSL_Destroy()—End SSL Support for the Specified db2xa_close()—Close an XA Resource Manager . . 87-2
SSL Session . . . . . . . . . . . . . . . . . . . . 84-3 db2xa_commit()—Commit an XA Transaction Branch 87-3
SSL_Handshake()—Initiate the SSL Handshake db2xa_complete()—Test Completion of Asynchronous
Protocol . . . . . . . . . . . . . . . . . . . . . . . 84-5 XA Request . . . . . . . . . . . . . . . . . . . . . 87-5
SSL_Init()—Initialize the Current Job for SSL . . . . 84-7 db2xa_end()—End Work on an XA Transaction Branch 87-5
| SSL_Init_Application()—Initialize the Current Job for db2xa_forget()—Forget an XA Transaction Branch . 87-7
| SSL Processing Based on the Application Identifier 84-9 db2xa_open()—Open an XA Resource Manager . . 87-8
SSL_Read()—Receive Data from an SSL-Enabled db2xa_prepare()—Prepare to Commit an XA
Socket Descriptor . . . . . . . . . . . . . . . . . . 84-11 Transaction Branch . . . . . . . . . . . . . . . . . 87-10
SSL_Write()—Write Data to an SSL-Enabled Socket db2xa_recover()—Recover XA Transactions . . . . . 87-11
Descriptor . . . . . . . . . . . . . . . . . . . . . . 84-13 db2xa_rollback()—Roll Back an XA Transaction . . . 87-12
db2xa_start()—Start an XA Transaction . . . . . . . 87-13
Chapter 85. Software Clock APIs . . . . . . . . . 85-1 ax_reg()—Exit Program to Dynamically Register an
Software Clock APIs—Introduction . . . . . . . . . . 85-1 XA Resource Manager . . . . . . . . . . . . . . . 87-14
adjtime()–Adjust Software Clock . . . . . . . . . . . 85-1 ax_unreg()—Exit Program to Dynamically Unregister
gettimeofday()–Get Current Software Clock Time . . 85-2 an XA Resource Manager . . . . . . . . . . . . . 87-15
settimeofday()–Set Current Software Clock Time . . 85-3
Chapter 88. Header Files for UNIX-Type Functions 88-1
Chapter 86. Process-Related APIs . . . . . . . . 86-1
Process-Related APIs—Introduction . . . . . . . . . 86-1 | Chapter 89. Errno Values for UNIX-Type Functions 89-1
getopt()—Get Flag Letters from Argument Vector . . 86-1 | Errno Values for UNIX-Type Functions—Introduction 89-1
getpgrp()—Get Process Group ID . . . . . . . . . . 86-2
Contents xix
Diagnostic Reporting . . . . . . . . . . . . . . . . . A-24 Creating a Program Temporary Fix Exit Program . . A-84
Listing Directories . . . . . . . . . . . . . . . . . . . A-27
Listing Subdirectories . . . . . . . . . . . . . . . . . A-30 Appendix B. Authority for Call Level Interfaces . . B-1
| Saving to Multiple Devices . . . . . . . . . . . . . . A-32
Scanning String Patterns . . . . . . . . . . . . . . . A-32 Appendix C. Application Programming Interfaces
Using COBOL Program to Call APIs . . . . . . . . . A-34 by Release . . . . . . . . . . . . . . . . . . . . . . C-1
Using the User-Defined Communications Programs for OS/400 APIs by Release . . . . . . . . . . . . . . . . C-1
File Transfer . . . . . . . . . . . . . . . . . . . . . A-35 APIs Described in Other Manuals . . . . . . . . . . C-38
| Using the Control Device (QTACTLDV) API . . . . . A-49
Using a Data Queue . . . . . . . . . . . . . . . . . A-50 Appendix D. Notices . . . . . . . . . . . . . . . . . D-1
Using Environment Variables . . . . . . . . . . . . . A-52 Programming Interface Information . . . . . . . . . . . D-2
| Saving and Restoring System-Level Environment Trademarks . . . . . . . . . . . . . . . . . . . . . . . D-2
| Variables . . . . . . . . . . . . . . . . . . . . . . A-53
Using the Generic Terminal APIs . . . . . . . . . . A-55 Bibliography . . . . . . . . . . . . . . . . . . . . . . X-1
Using Profile Handles . . . . . . . . . . . . . . . . . A-56 General-Purpose Books . . . . . . . . . . . . . . . . X-1
Using Registration Facility APIs . . . . . . . . . . . A-57 OS/400 API Books . . . . . . . . . . . . . . . . . . . X-2
Using Semaphores and Shared Memory . . . . . . . A-58 Programming Language Books . . . . . . . . . . . . . X-2
Using SNA/Management Services Transport APIs . . A-60 Communications Books . . . . . . . . . . . . . . . . . X-3
Using Source Debugger APIs . . . . . . . . . . . . A-65 CDRA Book . . . . . . . . . . . . . . . . . . . . . . . X-4
Using the Spawn Process and Wait for Child Process DLS File System Books . . . . . . . . . . . . . . . . X-4
APIs . . . . . . . . . . . . . . . . . . . . . . . . . A-79
Working with Stream Files . . . . . . . . . . . . . . A-83 Index . . . . . . . . . . . . . . . . . . . . . . . . . . X-5
Using the Operational Assistant Exit Program for
Operational Assistant Backup . . . . . . . . . . . . A-84
Contents xxi
12-36. Format of an Element in the Output Buffer 14-1. Translations for Output Operations . . . . 14-1
Descriptor . . . . . . . . . . . . . . . . . 12-31 14-2. Translations for Input Operations . . . . . 14-1
12-37. X.25 SVC and PVC Output Operations . . 12-31 14-3. Valid Parameter Combinations . . . . . . . 14-4
12-38. Format of an Element in the Output Buffer 17-1. Receiver Variable Header Section . . . . . 17-15
Descriptor . . . . . . . . . . . . . . . . . 12-32 17-2. Module Variable Header Section . . . . . 17-15
12-39. Format of Data for X'B000' Operation 17-3. Scalar Variable Section . . . . . . . . . . 17-15
(Initiate an SVC Call) . . . . . . . . . . . 12-33 17-4. Array Definition Variable Section . . . . . 17-16
12-40. Format of Data for X'B000' Operation (Open 17-5. Block Definition Variable Section . . . . . 17-16
a PVC Connection) . . . . . . . . . . . . 12-35 17-6. Receiver Variable Structure . . . . . . . . 17-50
12-41. Format of Data for X'B100' Operation . . . 12-37 17-7. Variations in Receiver Variable Structure . 17-51
12-42. Format of Data for X'B400' Operation . . . 12-37 17-8. Program for Break Example . . . . . . . . 17-56
12-43. Return and Reason Codes for LAN 17-9. Program for Scalar Evaluate Example . . . 17-56
Operation X'0000' . . . . . . . . . . . . . 12-40 17-10. RPG Programming Language Example,
12-44. Return and Reason Codes Valid for All X.25 Evaluate . . . . . . . . . . . . . . . . . . 17-57
Operations . . . . . . . . . . . . . . . . . 12-41 17-11. Program for Structure Evaluate Example . 17-57
12-45. Return and Reason Codes for X.25 17-12. Program for Step Example . . . . . . . . . 17-58
Operation X'0000' . . . . . . . . . . . . . 12-41 17-13. RPG Programming Language Example,
12-46. Return and Reason Codes for X.25 Evaluate . . . . . . . . . . . . . . . . . . 17-58
Operation X'B000' . . . . . . . . . . . . . 12-42 17-14. Program for Scalar Evaluate Example . . . 17-58
12-47. Return and Reason Codes for X.25 17-15. Presentation Formats . . . . . . . . . . . 17-62
Operation X'B100' . . . . . . . . . . . . . 12-42 18-1. LDAP Client Functions . . . . . . . . . . . 18-1
12-48. Return and Reason Codes for X.25 18-2. Authorization Required for ldap_ssl_start() 18-37
Operation X'B110' . . . . . . . . . . . . . 12-43 19-1. System Distribution Directory Fields Mapped
12-49. Return and Reason Codes for X.25 to LDAP Attributes . . . . . . . . . . . . . 19-22
Operation X'B400' . . . . . . . . . . . . . 12-43 21-1. AID Codes . . . . . . . . . . . . . . . . . 21-2
12-50. Return and Reason Codes for X.25 21-2. Control Character Byte 1 . . . . . . . . . . 21-2
Operation X'BF00' . . . . . . . . . . . . . 12-43 21-3. Control Character Byte 2 . . . . . . . . . . 21-3
12-51. Filter Header Data . . . . . . . . . . . . . 12-45 21-4. Screen Attributes for Non-Color Displays . 21-3
12-52. Filter Types X'00' and X'01' . . . . . . . . 12-45 21-5. Screen Attributes for Color Displays . . . . 21-4
12-53. Filter Types X'02', X'03', and X'04' . . . . . 12-46 22-1. Window Area . . . . . . . . . . . . . . . . 22-23
12-54. Filter Type X'08' . . . . . . . . . . . . . . 12-47 25-1. Field Format Words . . . . . . . . . . . . 25-14
12-55. Return and Reason Codes for the 25-2. Field Control Words . . . . . . . . . . . . 25-17
QOLSETF API . . . . . . . . . . . . . . . 12-48 25-3. Program to Roll Text on Screen . . . . . . 25-27
12-56. Return and Reason Codes for the 25-4. Screen Output from Roll Text Program . . 25-27
QOLTIMER API . . . . . . . . . . . . . . 12-51 25-5. Program Using the Query 5250
13-1. User Space to Set a Filter to Route Incoming (QsnQry5250) API . . . . . . . . . . . . . 25-27
X.25 Calls . . . . . . . . . . . . . . . . . 13-2 25-6. Screen Output from QsnQry5250 API
13-2. User Space to Send an SVC Call . . . . . 13-3 Program . . . . . . . . . . . . . . . . . . 25-27
13-3. User Space Containing an Incoming X.25 25-7. Program Using Read Modified Fields
Call . . . . . . . . . . . . . . . . . . . . . 13-4 (QsnReadMDT) API . . . . . . . . . . . . 25-28
13-4. User Space to Accept an Incoming X.25 Call 13-5 25-8. Display Screen before Input Operation . . 25-28
13-5. User Space (Buffer) to Send Three Data 25-9. Display Screen after Input Operation . . . 25-28
Units . . . . . . . . . . . . . . . . . . . . 13-6 25-10. Program Using Read QsnWrtSFMaj and
13-6. User Space (Descriptor Element) to Describe QsnWrtSFMin APIs . . . . . . . . . . . . 25-29
the Three Data Units . . . . . . . . . . . . 13-6 26-1. DSM Window Layout . . . . . . . . . . . . 26-2
13-7. User Space (Buffer) Containing the Three 26-2. DSM Window with No Border . . . . . . . 26-2
Data Units . . . . . . . . . . . . . . . . . 13-7 26-3. DSM Window with No Border Attributes . . 26-2
13-8. User Space (Descriptor Element) Describing 26-4. DSM Window with No Leading Window
the Three Data Units . . . . . . . . . . . . 13-8 Attribute . . . . . . . . . . . . . . . . . . 26-2
13-9. User Space to Send an SVC Clear . . . . 13-8 29-1. Creating and Manipulating Windows . . . . 29-4
13-10. Error Codes Received While Sending Data 29-2. Display Screen . . . . . . . . . . . . . . . 29-5
over LAN . . . . . . . . . . . . . . . . . . 13-9 30-1. Session Attributes . . . . . . . . . . . . . 30-1
13-11. Error Codes Reported on X'B001', X'B301', 30-2. EBCDIC Display Control Characters . . . . 30-3
and X'B400' Operations . . . . . . . . . . 13-9 32-1. Program for Creating a Session and Reading
13-12. Error Codes Reported on the X'B101' Data . . . . . . . . . . . . . . . . . . . . 32-9
Operation . . . . . . . . . . . . . . . . . . 13-10 32-2. Screen Output from Create Session
13-13. Error Codes Reported on the X'BF01' Program . . . . . . . . . . . . . . . . . . 32-10
Operation . . . . . . . . . . . . . . . . . . 13-11 | 34-1. QDBQH_T Format . . . . . . . . . . . . . 34-42
13-14. Error Codes Resulting from a X'0000' 34-2. Qdb_Qddfmt_t Format . . . . . . . . . . . 34-66
Operation . . . . . . . . . . . . . . . . . . 13-11 | 34-3. FILD0100 Format . . . . . . . . . . . . . 34-75
Figures xxiii
63-3. Formats SPFR0100 and SPFR0200 . . . . 63-31 77-35. Checkout Format . . . . . . . . . . . . . 77-114
63-4. Format SPFR0300 . . . . . . . . . . . . . 63-32 77-36. General Authority Format . . . . . . . . 77-115
63-5. Spooled File Identifying Fields . . . . . . . 63-52 77-37. Data and Object Authority Format . . . . 77-115
76-1. Environment Variable Functions . . . . . . 76-1 | 77-38. Qp0l_Usage_t . . . . . . . . . . . . . . 77-117
77-1. Integrated File System Functions . . . . . 77-1 | 77-39. Qp0l_Journal_Info_t . . . . . . . . . . . 77-118
77-2. Other Functions that Operate on Files . . . 77-2 77-40. Buffer Pointer . . . . . . . . . . . . . . 77-119
77-3. Authorization Required for access() . . . . 77-3 77-41. Authorization Required for . . . . . . . 77-119
77-4. Authorization Required for chdir() . . . . . 77-6 77-42. Authorization Required for
77-5. Authorization Required for chmod() Qp0lGetPathFromFileID() . . . . . . . . 77-124
(excluding QDLS) . . . . . . . . . . . . . 77-9 77-43. Object Types Array Pointer . . . . . . . 77-127
77-6. Authorization Required for chmod() in the 77-44. IN_EXclusion Pointer. This points to a list
QDLS File System . . . . . . . . . . . . . 77-9 of path names to either include or exclude
77-7. Authorization Required for chown() from a search. . . . . . . . . . . . . . . 77-127
(excluding QSYS.LIB and QDLS) . . . . . 77-12 77-45. User Function Pointer. This points to the
77-8. Authorization Required for chown() in the user exit program. The exit program can
QSYS.LIB File System . . . . . . . . . . . 77-12 be a procedure or a program. . . . . . . 77-128
77-9. Authorization Required for chown() in the 77-46. Authorization Required for . . . . . . . 77-129
QDLS File System . . . . . . . . . . . . . 77-12 | 77-47. Directory Structure A . . . . . . . . . . . 77-132
| 77-10. Authorization Required for chown() in the | 77-48. Directory Structure B . . . . . . . . . . . 77-132
| QOPT File System . . . . . . . . . . . . . 77-12 77-49. Scenario 1 API Input . . . . . . . . . . . 77-133
77-11. Authorization Required for creat() (excluding 77-50. Results of a call . . . . . . . . . . . . . 77-133
QSYS.LIB and QDLS) . . . . . . . . . . . 77-20 77-51. Scenario 2 API Input . . . . . . . . . . . 77-133
77-12. Authorization Required for creat() in the 77-52. Results of a call . . . . . . . . . . . . . 77-133
QSYS.LIB File System . . . . . . . . . . . 77-20 77-53. Scenario 3 API Input . . . . . . . . . . . 77-134
77-13. Authorization Required for creat() in the 77-54. Results of a call . . . . . . . . . . . . . 77-134
QDLS File System . . . . . . . . . . . . . 77-20 77-55. Scenario 4 API Input . . . . . . . . . . . 77-134
77-14. Authorization Required for fchmod() 77-56. Results of a call . . . . . . . . . . . . . 77-134
(excluding QDLS) . . . . . . . . . . . . . 77-32 77-57. Authorization Required for
77-15. Authorization Required for fchmod() in the Qp0lRenameKeep() (excluding QSYS.LIB,
QDLS File System . . . . . . . . . . . . . 77-33 QDLS, and QOPT) . . . . . . . . . . . . 77-136
77-16. Authorization Required for fchown() 77-58. Authorization Required for
(excluding QSYS.LIB and QDLS) . . . . . 77-36 Qp0lRenameKeep() in the QSYS.LIB File
77-17. Authorization Required for fchown() in the System . . . . . . . . . . . . . . . . . . 77-136
QSYS.LIB File System . . . . . . . . . . . 77-36 77-59. Authorization Required for
77-18. Authorization Required for fchown() in the Qp0lRenameKeep() in the QDLS File
QDLS File System . . . . . . . . . . . . . 77-36 System . . . . . . . . . . . . . . . . . . 77-136
| 77-19. Authorization Required for fchown() in the | 77-60. Authorization Required for
| QOPT File System . . . . . . . . . . . . . 77-36 | Qp0lRenameKeep() in the QOPT File
77-20. Authorization Required for fstatvfs() . . . . 77-52 | System . . . . . . . . . . . . . . . . . . 77-137
77-21. Authorization Required for getcwd() . . . . 77-60 77-61. Authorization Required for
77-22. Authorization Required for link() . . . . . . 77-77 Qp0lRenameUnlink() (excluding QSYS.LIB,
77-23. Authorization Required for lstat() . . . . . 77-83 QDLS, and QOPT) . . . . . . . . . . . . 77-141
77-24. Authorization Required for mkdir() 77-62. Authorization Required for
(excluding QSYS.LIB and QDLS) . . . . . 77-87 Qp0lRenameUnlink() in the QSYS.LIB File
77-25. Authorization Required for mkdir() in the System . . . . . . . . . . . . . . . . . . 77-141
QSYS.LIB File System . . . . . . . . . . . 77-87 77-63. Authorization Required for
77-26. Authorization Required for mkdir() in the Qp0lRenameUnlink() in the QDLS File
QDLS File System . . . . . . . . . . . . . 77-87 System . . . . . . . . . . . . . . . . . . 77-141
77-27. File Sharing Conflicts . . . . . . . . . . . 77-93 77-64. Authorization Required for
77-28. Authorization Required for open() (excluding Qp0lRenameUnlink() in the QOPT File
QSYS.LIB and QDLS) . . . . . . . . . . . 77-94 System . . . . . . . . . . . . . . . . . . 77-141
77-29. Authorization Required for open() in the | 77-65. Buffer Pointer . . . . . . . . . . . . . . 77-145
QSYS.LIB File System . . . . . . . . . . . 77-94 | 77-66. Authorization Required for Qp0lSetAttr()
77-30. Authorization Required for open() in the | (excluding QSYS.LIB) . . . . . . . . . . 77-146
QDLS File System . . . . . . . . . . . . . 77-95 | 77-67. Authorization Required for Qp0lSetAttr()
77-31. Authorization Required for opendir() . . . 77-100 | (QSYS.LIB) . . . . . . . . . . . . . . . . 77-146
77-32. Authorization Required for pathconf() . . 77-105 77-68. Authorization Required for readlink() . . 77-162
77-33. Authorization Required for the 77-69. Authorization Required for rmdir()
Qp0lCvtPathToQSYSObjName() API . . 77-110 (excluding QSYS.LIB and QDLS) . . . . 77-173
77-34. Attribute array pointer . . . . . . . . . . 77-114
Figures xxv
xxvi AS/400 System API Reference V4R4
About System API Reference (SC41-5801)
This book describes the OS/400 application programming Program (*PGM). A sequence of instructions that a com-
interfaces (APIs). Some APIs provide the same functions as puter can interpret and run. A program can contain one or
control language (CL) commands and output file support. more modules.
Some APIs provide functions that CL commands do not.
Most APIs work more quickly and use less system overhead Service program (*SRVPGM). An object that packages
than the CL commands. externally supported callable routines into a separate object.
The System API Reference manual is broken into softcopy User index (*USRIDX). An object that provides a specific
“booklets,” which are usually referred to as books. Each of order for byte data according to the value of the data.
these books corresponds to a specific “part” in the printed
User queue (*USRQ). An object consisting of a list of mes-
manual. For example, System API Reference: Message
sages that communicate information to other application pro-
Handling APIs is a separate book in the softcopy version and
grams. Only programming languages that can use machine
is simply a part in the printed version. The System API Ref-
interface (MI) instructions can access *USRQ objects.
erence is the title of the printed version but is the introductory
book for the softcopy version. User space (*USRSPC). An object consisting of a collection
of bytes used for storing any user-defined information.
Who Should Read This Book These special values refer to OS/400 libraries and can often
be used in API calls in place of specific library names:
This book is intended for experienced application program-
mers who are developing system-level and other OS/400 *ALL. All libraries, including QSYS, that the user owns or to
applications. It provides reference information only; it is which the user has read authority.
neither an introduction to the OS/400 licensed program nor a
guide to writing OS/400 applications. *ALLUSR. All user-defined libraries to which the user has
read authority. *ALLUSR includes libraries that have names
starting with the letter Q and that also contain user data:
QDSNX, QGPL, QGPL38, QRCL, QPRFDATA, QS36F,
Conventions and Terminology Used in QUSER38, QUSRSYS, and QUSRVxRxMx. *ALLUSR
This Book excludes System/36 libraries that have names starting with
the symbol # and that do not contain user data: #CGULIB,
The descriptions of the APIs are organized in the parts (or
#COBLIB, #DFULIB, #DSULIB, #RPGLIB, #SDALIB, and
booklets) in alphabetical order as follows:
#SEULIB. For more information about QUSRVxRxMx
By the spelled-out name for the original program model libraries or the *ALLUSR special value, see the topic about
(OPM), the Integrated Language Environment (ILE), and saving libraries in the Backup and Recovery book.
the ILE CEE APIs
*CURLIB. The job's current library. If no current library is
By the function name for the UNIX-type APIs
specified for the job, the QGPL library is used.
OS/400 Terms and Special Values *LIBL. The user and system portions of the job's library list.
Before using the OS/400 APIs, you should be familiar with *USRLIBL. The user portion of the job's library list.
several terms and special values (not all APIs use every
concept). These terms refer to OS/400 objects, and the
system-recognized identifiers are shown in parentheses: AS/400 Operations Navigator
Binding directory (*BNDDIR) An AS/400 object that con- AS/400 Operations Navigator is a powerful graphical inter-
tains a list of names of modules and service programs. face for Windows clients. With AS/400 Operations Navigator,
you can manage and administer your AS/400 systems from
Data queue (*DTAQ). An object that is used to communi- your Windows desktop.
cate and store data used by several programs in a job or
between jobs. You can use Operations Navigator to manage communica-
tions, printing, database, security, and other system oper-
Module (*MODULE). An AS/400 object that is made up of ations. Operations Navigator includes Management Central
the output of the compiler. for managing multiple AS/400 systems centrally.
Compatibility with Future Releases Part 2, “Backup and Recovery APIs.” These APIs list the
contents of a save file and save a list of objects. This part
In future releases, IBM intends that one of the following will also contains exit programs for storage extension and tape
be true: management.
If additional input or output parameters are provided for
| Part 3, “Client Management Support APIs.” This part has
any of the APIs, the new parameters will be placed after
| moved to the AS/400 Information Center.
the current parameters and will be optional parameters.
The existing APIs will continue to work without any These APIs allow you to add and remove clients to and from
changes. the AS/400, update client information, and refresh client infor-
If an additional data structure is provided, a new format mation on the AS/400 with the information stored at the
(layout of that data structure) will be created. client. The exit programs notify you when these API func-
tions have been completed. A Lotus Notes exit program pro-
New information may be added to the end of an existing
vides the capability of processing an SQL table of all
format.
changes that occurred in the Notes database that is being
It is IBM's intention that the APIs will continue to work as shadowed from DB2 UDB for AS/400.
they originally worked and any existing applications that use
| Part 4, “Cluster APIs.” These APIs define an AS/400
the APIs will continue to work without changes. However,
| cluster of one or more systems, called nodes, manage the
significant architectural changes may necessitate incompat-
| membership and status of nodes in the cluster, specify the
ible changes.
| location of replicated objects, data, and applications within
To ensure better compatibility with future releases, you | the cluster, and provide for automatic recovery from failures
should retrieve and use all of the following when you work | within the cluster.
with user spaces generated by list APIs:
Part 5, “Communications APIs.” This part provides the
Offset values to the list data section information needed to write user-defined communications
Size of the list data section applications, programming examples, and debugging infor-
mation. This part includes the data stream translation APIs,
Number of list entries which allow a user-written application program that creates
Size of each entry 3270 data streams to run on an AS/400 system using 5250
data streams. This part also includes the OptiConnect APIs,
which can be used to move user data between two or more
Summary of OS/400 APIs AS/400 systems that are connected by an OptiConnect fiber-
optic bus.
Most OS/400 APIs are described in this book. However, a
few special-purpose APIs are described in other books; for
example, the REXX APIs. The following section outlines the
APIs described in this book.
Part 6, “Configuration APIs.” These APIs get information These APIs create, manipulate, and delete user spaces, user
about the configuration status of the system and about indi- indexes, and user queues. They send, receive, and clear
vidual configuration descriptions. entries on a data queue and retrieve data queue information.
They also change, list, rename, and retrieve information
Part 7, “Debugger APIs.” These APIs can be used to write about AS/400 objects.
debuggers for the AS/400 system.
Part 21, “Office APIs.” These APIs work with system distri-
Part 8, “Directory Services APIs.” The Lightweight Direc- bution directory data and with document handling. This part
tory Access Protocol (LDAP) client APIs can be used to also includes the OfficeVision exit programs, the AnyMail/400
access LDAP-enabled directories in a network. This part also Mail Server Framework APIs, and the SNADS File Server
includes administrative and configuration APIs for the OS/400 Object APIs.
Directory Services feature.
Part 22, “Operational Assistant APIs.” These APIs provide
Part 9, “Dynamic Screen Manager APIs.” These APIs access to the Operational Assistant functions.
provide the screen I/O interfaces for Integrated Language
Environment (ILE) high-level languages. Part 23, “Performance Collector APIs.” These APIs
describe the performance collector APIs and the performance
Part 10, “Edit Function APIs.” These APIs create and use monitor exit program.
edit masks.
Part 24, “Print APIs.” These APIs retrieve information and
Part 11, “File APIs.” These APIs retrieve information about manipulate spooled files.
files.
| Part 25, “Problem Management APIs.” This part has
| Part 12, “Hardware Resource APIs.” This part has moved | moved to the AS/400 Information Center.
| to the AS/400 Information Center.
These APIs offer you the ability to write problem manage-
These APIs allow you to work with hardware resources such ment solutions, improve serviceability, and manage your own
as searching resource entry information, retrieving resource applications.
information, and changing resource entry information.
Part 26, “Program and CL Command APIs.” These APIs
| Part 13, “Hierarchical File System APIs.” This part has create programs, retrieve program information, list and
| moved to the AS/400 Information Center. retrieve module information, activate bound programs,
resolve pointers to exports, and retrieve command informa-
These APIs let you work with directories and files in hierar- tion.
chical file systems (HFSs). This part also includes the HFS
exit programs. | Part 27, “Registration Facility APIs.” This part has moved
| to the AS/400 Information Center.
Part 14, “High-Level Language APIs.” These APIs com-
municate with compilers, and the DB2 for AS/400 SQL and These APIs provide the capability (1) to register and dereg-
COBOL/400 languages. ister exit points with the registration facility, (2) to add and
remove exit programs to and from the registration facility
Part 15, “Integrated Language Environment (ILE) CEE repository, (3) to retrieve exit point and exit program informa-
APIs.” These APIs contain the CEE and CEE4 Integrated tion, and (4) to designate the order in which exit programs
Language Environment (ILE) bindable APIs. are called.
Part 16, “Journal and Commit APIs.” This part contains | Part 28, “Remote Procedure Call APIs.” This part has
the journal and commitment control APIs, which allow you to | moved to the AS/400 Information Center.
add and remove your own commitment resources.
These APIs enable distributed applications to communicate
Part 17, “Message Handling APIs.” These APIs allow with each other by using the SUN RPC protocol. On the
applications to work with AS/400 messages. AS/400, these APIs can be used to easily separate and dis-
tribute client applications from the server.
Part 18, “National Language Support APIs.” These APIs
work with the national language support (NLS) functions, Part 29, “Security APIs.” These APIs manage system-level
such as sort and code conversion. The CDRA APIs are jobs, allowing your programs to run under different user pro-
included also. files without compromising system security. APIs are pro-
vided to retrieve security information. This part includes the
Part 19, “Network Management APIs.” These APIs handle
NetWare Authentication Entry APIs, which provide a means
alertable messages, work with problem logs, and use the
to automatically log you on to a server when you request a
SNA/Management Services Transport.
NetWare function (for example, file or print). The digital cer-
| Part 20, “Object APIs.” This part has moved to the AS/400
| Information Center.
tificate management APIs, user function registration APIs, and to build screens. This part also includes the user inter-
and validation list APIs are also contained in this part. face manager exit programs.
| Part 30, “Server Support APIs.” This part has moved to Part 34, “Virtual Terminal APIs.” These APIs provide infor-
| the AS/400 Information Center. mation needed to use the virtual terminal (VT) APIs, which
allow an AS/400 application program to interact with an
These APIs allow personal computers to access file and print AS/400 system that is performing work station input/output
resources on the AS/400 by using the networking support (I/O).
provided with their operating systems. This part also
includes the AS/400 Dynamic Host Configuration Protocol Part 35, “Work Management APIs.” These APIs perform
(DHCP) server exit programs. The user-supplied exit pro- functions that are used in a wide variety of applications.
grams can provide validation of incoming client requests and These APIs retrieve and manipulate:
notification when IP addresses are assigned or released.
Jobs
| Part 31, “Software Product APIs.” This part has moved to Subsystem storage pools
| the AS/400 Information Center.
Subsystem job queues
These APIs work with software products and program tempo- Data areas
rary fixes (PTFs) on your system.
Network attributes
Part 32, “UNIX-Type APIs.” This part contains the following System status
groups of APIs:
System values
Environment variable
Flight recorder
Integrated file system
| Part 36, “Work Station Support APIs.” This part has
Interprocess communication
| moved to the AS/400 Information Center.
Problem determination
These APIs allow you to use the type-ahead and attention
Signal
key buffering functions in your applications.
SNMP subagent
| Part 37, “Miscellaneous APIs.” This part has moved to the
SNMP manager
| AS/400 Information Center.
Sockets
These APIs remove bookmarks from a course, convert date
Secure Sockets Layer (SSL)
and time, start pass-through, and retrieve data on a target
Process related system. This part also includes APIs that process open lists.
These APIs allow you to get list entries. to find entry
XA APIs for DB2/400
numbers in lists and in message lists, to find field numbers in
| Part 33, “User Interface APIs.” This part has moved to the lists, to retrieve server job information, and to close lists.
| AS/400 Information Center.
Part 38, “Reference Information.” This part includes
These APIs handle various aspects of the user interface, several appendixes that contain programming examples, a
allowing your applications to display help, display a chart of APIs and the public authority for each, and a chart of
command line window, convert date and time formats, control OS/400 APIs by release. This part also includes a bibli-
keyboard buffering, display screens and pop-up windows, ography of related books and the index.
Figure 2-2 shows the languages available on the AS/400 Figure 2-2 (Page 1 of 2). Language Selection Considerations
system and the parameter support that they provide. For — Call Conventions
more information, see the reference manual for the specific Function Pass
programming language that you plan to use. Return Pass by by
Language1 Values2 Reference Value
BASIC X
ILE C X X X
VisualAge C++ for OS/400 X X X
Figure 2-2 (Page 2 of 2). Language Selection Considerations Figure 2-3. Include Files Shipped with the QSYSINC Library
— Call Conventions
Oper- Lan- File Name Member Name
Function Pass ating guage (Header File)
Return Pass by by Envi-
Language1 Values2 Reference Value
ronment
CL X
OPM ILE C1 H OPM API program
ILE CL X APIs name
COBOL X 3
RPG QRPGSRC OPM API program
ILE COBOL X X X name or OPM API
MI X X program name with
Pascal X
the letter E
replacing the letter
PL/I X Q for members con-
REXX X taining array defi-
RPG X nitions
ILE RPG X X X ILE QRPGLESRC OPM API program
Notes:
RPG name
1 You cannot develop Cross System Product (CSP) pro- COBOL QLBLSRC OPM API name
grams on an AS/400 system. However, you can develop
ILE QCBLLESRC OPM API program
CSP programs on a System/370 and run them on your
AS/400 system. COBOL name
2 Return values are used by the UNIX-type APIs and the ILE ILE C H Service program
Dynamic Screen Manager (DSM) APIs.
3 APIs name or API
COBOL provides a by-content phrase, but it does not have
the same semantics as ILE C pass-by-value. program name2
ILE QRPGLESRC Service program
RPG name or API
program name2
Data Types and Parameter Coding
ILE QCBLLESRC Service program
COBOL name or API
The following sections describe a variety of API coding con-
program name2
siderations, covering these topics:
UNIX ILE C ARPA Industry defined
Data structures and the QSYSINC library type
ILE C H Industry defined
Character and binary data
ILE C NET Industry defined
Passing parameters
ILE C NETINET Industry defined
Input and output parameters ILE C NETNS Industry defined
Offset values and lengths ILE C SYS Industry defined
Displacement versus offset considerations for structures Notes:
Optional parameters 1 CEE ILE APIs are included in this part of the
table.
Omitted parameters 2 The API can be either bindable when you use the
service program name or callable when you use
the API program name.
Data Structures and the QSYSINC Library
The QSYSINC (system include) library provides all source Besides the includes for specific APIs, other includes existing
includes shipped with the AS/400 system for OS/400 APIs. in the QSYSINC library follow:
This optionally installed library is fully supported, which QLIEPT and QUSEPT
means you can write APARs if you find errors in the Allow C-language application programs to call
includes. OPM APIs directly through the system entry
point table
You can install this library by using the GO LICPGM func-
QUSGEN Defines the generic header for list APIs
tions of OS/400. Select the Install Licensed Programs option
QUSEC Contains the structures for the error code
on the Work with Licensed Programs display and the OS/400
parameter
Openness Includes option on the Install Licensed Programs
Qxx Provides common structures that are used by
display.
multiple APIs (where the xx is the component
The naming conventions for the includes are the same as identifier, for example, QMH, QSY, and so
either the OPM API or the ILE service program name. If forth)
both exist, the include has both names.
The include files that are shipped with the system define only ILE C) to ensure that these conventions are followed. Refer
the fixed portions of the formats. You must define the to the appropriate language documentation for instructions.
varying-length fields. The QSYSINC include files are read- The parameter passing convention of pass-by-reference can
only files. If you use a structure that contains one or more be used in all programming languages. Some of the
varying-length fields, you need to copy the include file to your UNIX-type APIs require pass-by-value parameter passing.
library and edit your copy. Uncomment the varying-length VisualAge C++ for OS/400 also supports pass-by-value
fields in your copy of the include file, and specify the actual parameter passing.
lengths you want.
Exit programs only have an include if the exit program con- Input and Output Parameters
tains a structure. The QSYSINC member name of these
API parameters can be used for input or output. Some
includes is provided in the parameter box for the applicable
parameters contain both input and output fields; these are
exit programs.
identified as input/output (I/O) parameters in the API param-
For development of client-based applications, integrated-file- eter tables.
system symbolic links to QSYSINC openness includes are
Input parameters and fields are not changed by the API.
also provided in the /QIBM/include path.
They have the same value on the return from the API call as
they do before the API call. In contrast, output parameters
Character Data and fields are changed. Any information that an API caller
(either an application program or an interactive entry on the
In the API parameter tables in this book, CHAR(*) represents display) places in an output parameter or output field before
character data that has: the call will be lost on the return from the call.
A type that is not known, such as character, binary, and
so on Offset Values and Lengths
A length that might not be known or is based on another
value (for example, a length you specify) When you are using an API that generates a list into a user
space, you should use the offset values and lengths returned
by the API in the generic user space header to step through
Binary Data the list instead of specifying what the current version of the
API returns. This is because:
In the API parameter tables in this book, BINARY(2) and
BINARY(4) represent numeric data. These parameters must The offset values to the different sections of the user
be signed, 2- or 4-byte numeric values with a precision of 15 space may change in future releases.
(halfword) or 31 (fullword) bits and one high-order bit for the The length of the entries in the list data section of the
sign. Numeric parameters that must be unsigned 4-byte user space may change in future releases.
numeric values are explicitly defined as
BINARY(4) UNSIGNED. As long as your HLL application program uses the offset
values and lengths returned in the generic header of the user
When you develop applications that use binary values, be space, your program will run in future releases of the OS/400
aware that some high-level languages allow the definition of licensed program.
binary variables by using precision and not length. For
Note: While your application program should use the length
example, an RPG definition of binary length 4 specifies a
returned in the generic header to address subsequent list
precision of 4 digits, which can be stored in a 2-byte binary
entries, your application program should only retrieve as
field. For API BINARY(4) fields, RPG developers should use
many bytes as the application program has allocated storage
one of the following:
for.
Positional notation
A length of 5 to 9 in order to allocate a 4-byte binary Offset versus Displacement
field
Considerations for Structures
A length of 10 in order to allocate a 4-byte integer field
You will find the terms offset and or displacement in some of
the AS/400 APIs. For example, the Retrieve Data Queue
Passing Parameters Message (QMHRDQM) API uses offset; the List Objects
(QUSLOBJ) API uses displacement.
When you call an API, the protocol for passing parameters is
to typically pass a space pointer that points to the information An offset is the distance from the beginning of an object
being passed. (This is also referred to as pass-by- (user spaces and receiver variables) to the beginning of a
reference.) This is the convention used by the control lan- particular field. However, a displacement is the distance
guage (CL), RPG, and COBOL compilers. Care must be from the beginning of a specific record, block, or structure to
used in those languages that support pass-by-value (such as the beginning of a particular field.
Optional Parameters All offset values are from the beginning of the user space.
The offset values for the Dump Object (DMPOBJ) and Dump
Some of the APIs have optional parameters; the optional System Object (DMPSYSOBJ) commands also start at the
parameters form a group. You must either include or beginning of the user space. To get the correct starting posi-
exclude the entire group. You cannot use just one of these tion for the Change User Space (QUSCHGUS) and Retrieve
parameters by itself. In addition, you must include all pre- User Space (QUSRTVUS) APIs, add one to the offset value.
ceding parameters.
You may call the API in two ways: either with the optional Common Data Structure Formats
parameters or without the optional parameters. The following tables show the generic user space layout.
Format 0100 shows the format for an original program model
(OPM) layout. Format 0300 shows the format for an Inte-
Omitted Parameters grated Language Environment (ILE) model layout. The fields
are described in detail after the table.
The Integrated Language Environment (ILE) APIs may have
parameters that can be omitted. When these parameters are Generic Header Format 0100
omitted, you must pass a null pointer.
Offset
Dec Hex Type Field
User Space Format for List APIs
0 0 CHAR(64) User area
To provide a consistent design and use of the user space 64 40 BINARY(4) Size of generic header
(*USRSPC) objects, the OS/400 list APIs use a common
68 44 CHAR(4) Structure's release and level
data structure. The list APIs are those APIs that generate a
list unique to that API. This includes any list API that has a 72 48 CHAR(8) Format name
user space parameter, such as the List Spooled Files and 80 50 CHAR(10) API used
List Objects APIs.
90 5A CHAR(13) Date and time created
103 67 CHAR(1) Information status
General Data Structure
104 68 BINARY(4) Size of user space used
The list APIs use the following general data structure: 108 6C BINARY(4) Offset to input parameter
section
Header
┌────────────────────────────────────┐ ┌─────────────────────────┐ 112 70 BINARY(4) Size of input parameter
+ðð│ │ │ │
│ 64─Byte User Area │ │ │ section
│ │ │ │
├────────────────────────────────────┤ ┌───5│ Input Parameter Section │ 116 74 BINARY(4) Offset to header section
+4ð│ Size of Generic Header │ │ │ │
├────────────────────────────────────┤ │ ' '
│ │ │ ' '
120 78 BINARY(4) Size of header section
│ Generic Header │ │ ├─────────────────────────┤
│ │ │ │ │ 124 7C BINARY(4) Offset to list data section
│ │ │
+6C│ Offset to Input Parameter Section ─┼────┘ 128 80 BINARY(4) Size of list data section
│ │ │ │
+7ð│ Input Parameter Section Size │ ├─────────────────────────┤
│ │ │ │
132 84 BINARY(4) Number of list entries
+74│ Offset to Header Section───────────┼────────5│ Header Section │
│ │ │ │ 136 88 BINARY(4) Size of each entry
+78│ Header Section Size │ │ │
│ │ │ │ 140 8C BINARY(4) CCSID of data in the list
+7C│ Offset to List Data Section────────┼────┐ │ │
│ │ │ │ │ entries
+8ð│ List Data Section Size │ │ │ │
│ │ │ ' ' 144 90 CHAR(2) Country ID
+84│ Number of List Entries │ │ ' '
│ │ │ │ │ 146 92 CHAR(3) Language ID
+88│ Size of Each Entry │ │ ├─────────────────────────┤
│ │ │ │ │
+8C│ CCSID of data in the user space │ │ 149 95 CHAR(1) Subsetted list indicator
│ │ │
+9ð│ Country ID │ │ │ │ 150 96 CHAR(42) Reserved
│ │ │ │ List Data Section │
+93│ Language ID │ │ │─────────────────────────┤
│ │ └───5│ Entry 1 │
+95│ Subsetted list indicator │ │─────────────────────────┤ Generic Header Format 0300
│ │ │ Entry 2 │
+Cð│ API entry point name │ │─────────────────────────┤
│ │ │ Entry 3 │
│ │ │ │ Offset
└────────────────────────────────────┘ ' '
' ' Dec Hex Type Field
│ │
│─────────────────────────┤ 0 0 Everything from the 0100
│ Last Entry │
│─────────────────────────┤ format
│ │
192 C0 CHAR(256) API entry point name
be valid. For examples of how to process lists, see Error Code Parameter
Appendix A, “Examples.”
Most OS/400 APIs include an error code parameter to return
error codes and exception data to the application. The error
Partial List Considerations code parameter is a variable-length structure that contains
Some APIs may be able to return more information to the the information associated with an error condition. The error
application than fits in a receiver variable or a user space. code parameter can be one of two variable-length structures,
The information returned is correct, but not complete. format ERRC0100 or format ERRC0200.
If the list information is not complete, the first item and pos- In format ERRC0100, one field in that structure is an INPUT
sibly the second item occur: field; it controls whether an exception is returned to the appli-
cation or the error code structure is filled in with the excep-
A P is returned in the information status field of the tion information. When the bytes provided field is greater
generic user space layout; refer to “General Data than or equal to 8, the rest of the error code structure is filled
Structure” on page 2-4. in with the OUTPUT exception information associated with
The API supports a continuation handle. the error. When the bytes provided INPUT field is zero, all
other fields are ignored and an exception is returned.
If an indicator of a partial list is returned, the application
should call the API again with the continuation handle in the Format ERRC0200 must be used if the API caller wants con-
list header section of the API and specify that the list begin vertible character (CCHAR) support. Format ERRC0200
with the next entry to be returned. contains two INPUT fields. The first field, called the key
Note: If this is the first time the API is attempting to return field, must contain a -1 to use CCHAR support. When the
information, the continuation handle must be set to blanks. If bytes provided field is greater than or equal to 12, the rest of
the API does not support a continuation handle, you need to the error code structure is filled in with the OUTPUT excep-
call the API again and use more restrictive values for the tion information associated with the error. When the bytes
parameters. provided INPUT field is zero, all other fields are ignored and
an exception is returned.
For information about how list APIs make use of user
spaces, see “User Spaces” in the book System API Program- For some APIs, the error code parameter is optional. If you
ming. For information about how retrieve APIs make use of do not code the optional error code parameter, the API
receiver variables and to determine whether the returned returns diagnostic and escape messages. If you do code the
information is complete, see “Receiver Variables” in the book optional error code parameter, the API returns only escape
System API Programming. messages or error codes; it never returns diagnostic mes-
sages.
Format ERRC0200
Offset
Dec Hex Use Type Field
0 0 INPUT BINARY(4) Key
Exception ID. The identifier for the message for the error
Offset
condition.
Dec Hex Use Type Field
4 4 INPUT BINARY(4) Bytes provided Key. The key value that enables the message handler error
function if CCHAR support is used. This value should be -1
8 8 OUTPUT BINARY(4) Bytes available
if CCHAR support is expected.
12 C OUTPUT CHAR(7) Exception ID
19 13 OUTPUT CHAR(1) Reserved
Length of the exception data. The length, in bytes, of the
exception data returned in the error code.
20 14 OUTPUT BINARY(4) CCSID of the
CCHAR data Offset to the exception data. The offset from the beginning
24 18 OUTPUT BINARY(4) Offset to the of the error code structure to the exception data in the error
exception data code structure.
28 1C OUTPUT BINARY(4) Length of the
exception data Reserved. A 1-byte reserved field.
8-13 The time of day, in HHMMSS (hours, minutes, Total records. The total number of records available in the
seconds) format. list.
Record length. The length of each record of information CCSID. The CCSID (coded character set ID) the path name
returned. For variable length records, this value is set to is in. The possible values follow:
zero. For variable length records, you can obtain the length 0 Use the current job default CCSID.
of individual records from the records themselves. 1–65533 A valid CCSID in this range.
Records returned. The number of records that are returned Country ID. The country ID for the path name. The pos-
in the receiver variable. This number is the smallest of the sible values follow:
following values:
X'0000' Use the current job country ID.
The number of records that will fit into the receiver vari- Country ID A valid country ID.
able.
The number of records in the list. Language ID. The language ID for the path name. The
The number of records that are requested. possible values follow:
Request handle. The handle of the request that can be X'000000' Use the current job language ID.
used for subsequent requests of information from the list. Language ID A valid language ID.
The handle is valid until the Close List (QGYCLST) API is
Length of path name. The length of the path name in
called to close the list, or until the job ends.
bytes.
Note: This field should be treated as a hexadecimal field. It
should not be converted from one CCSID to another, for Path name. Depending on the path type indicator field, this
example, EBCDIC to ASCII, because doing so could result in field contains either a pointer to a character string that con-
an unusable value. tains the path name, or a character string that contains the
path name.
Reserved. An ignored field.
The path name must be an absolute path name or a relative Path type indicator. Whether the path name contains a
path name. An absolute path name is a path name that pointer or is a character string and whether the path name
starts with the path name delimiter, usually the slash (/) char- delimiter character is 1 or 2 characters long. The possible
acter. A relative path name is a path name that does not values follow:
start with the path name delimiter. When a relative name is
0 The path name is a character string, and the
specified, the API assumes that this path name starts at the
path name delimiter character is 1 character
current directory of the process that the API is running in.
long.
The dot and dot dot (. ..) directories are valid in the path
1 The path name is a pointer, and the path
name delimiter character is 1 character long.
name. The home directory, generally represented by using
the tilde character in the first character position of the path
2 The path name is a character string, and the
path name delimiter character is 2 characters
name, is not supported.
long.
Path name delimiter character. The delimiter character 3 The path name is a pointer, and the path
used between the element names in the path name. This is name delimiter character is 2 characters long.
in the same CCSID as the path name. The most common
Reserved. A reserved field that must be set to hexadecimal
delimiter is the slash (/) character. If the delimiter is 1 char-
zeros.
acter, the first character of the 2-character field is used.
Chapter 3. Backup and Recovery APIs . . . . . . . 3-1 Required Parameter Group . . . . . . . . . . . . 3-16
Backup and Recovery APIs—Introduction . . . . . . . 3-1 Format of the Generated List . . . . . . . . . . . 3-16
Backup and Recovery Exit Programs—Introduction . . 3-1 Input Parameter Section . . . . . . . . . . . . 3-16
Change Backup Schedule (QEZCHBKS) API . . . . . 3-2 Header Section . . . . . . . . . . . . . . . . . 3-17
Authorities and Locks . . . . . . . . . . . . . . . . 3-2 SAVF0100 Format . . . . . . . . . . . . . . . 3-17
Required Parameter Group . . . . . . . . . . . . . 3-2 SAVF0200 Format . . . . . . . . . . . . . . . 3-17
CBKS0100 Format . . . . . . . . . . . . . . . . . 3-2 SAVF0300 Format . . . . . . . . . . . . . . . 3-17
Field Descriptions . . . . . . . . . . . . . . . . . . 3-2 Field Descriptions . . . . . . . . . . . . . . . 3-17
Error Messages . . . . . . . . . . . . . . . . . . . 3-4 Error Messages . . . . . . . . . . . . . . . . . . 3-19
Change Job Media Library Attributes (QTACJMA) API 3-5 Open List of Objects to be Backed Up (QEZOLBKL)
Authorities and Locks . . . . . . . . . . . . . . . . 3-5 API . . . . . . . . . . . . . . . . . . . . . . . . . 3-19
Required Parameter Group . . . . . . . . . . . . . 3-5 Authorities and Locks . . . . . . . . . . . . . . . 3-20
CJMA0100 Format . . . . . . . . . . . . . . . . . 3-5 Required Parameter Group . . . . . . . . . . . . 3-20
Field Descriptions . . . . . . . . . . . . . . . . . . 3-6 Format of Receiver Variable . . . . . . . . . . . 3-20
Error Messages . . . . . . . . . . . . . . . . . . . 3-6 OBKL0100 Format . . . . . . . . . . . . . . . 3-20
Change Object Backup List (QEZCHBKL) API . . . . . 3-7 OBKL0200 Format . . . . . . . . . . . . . . . 3-21
Authorities and Locks . . . . . . . . . . . . . . . . 3-7 OBKL0600 Format . . . . . . . . . . . . . . . 3-21
Required Parameter Group . . . . . . . . . . . . . 3-7 Field Descriptions . . . . . . . . . . . . . . . . . 3-21
Format for Variable Length Records . . . . . . . . 3-7 Format of List Information . . . . . . . . . . . . . 3-21
Field Descriptions . . . . . . . . . . . . . . . . . . 3-7 Field Descriptions . . . . . . . . . . . . . . . . . 3-21
Valid Keys . . . . . . . . . . . . . . . . . . . . . . 3-8 Error Messages . . . . . . . . . . . . . . . . . . 3-22
Field Descriptions . . . . . . . . . . . . . . . . . . 3-8 Qp0lSaveStgFree()—Save Storage Free . . . . . . . 3-22
Folder Key Format . . . . . . . . . . . . . . . . . . 3-8 Parameters . . . . . . . . . . . . . . . . . . . . 3-23
Field Descriptions . . . . . . . . . . . . . . . . . . 3-8 Authorities . . . . . . . . . . . . . . . . . . . . . 3-24
Library Key Format . . . . . . . . . . . . . . . . . 3-8 Return Value . . . . . . . . . . . . . . . . . . . 3-24
Field Descriptions . . . . . . . . . . . . . . . . . . 3-8 Error Conditions . . . . . . . . . . . . . . . . . . 3-24
Error Messages . . . . . . . . . . . . . . . . . . . 3-8 Error Messages . . . . . . . . . . . . . . . . . . 3-26
| Create Media Definition (QSRCRTMD, Usage Notes . . . . . . . . . . . . . . . . . . . . 3-26
| QsrCreateMediaDefinition) API . . . . . . . . . . . . 3-9 Related Information . . . . . . . . . . . . . . . . 3-26
| Authorities and Locks . . . . . . . . . . . . . . . . 3-9 Example . . . . . . . . . . . . . . . . . . . . . . 3-26
| Required Parameter Group . . . . . . . . . . . . . 3-9 Restore from Application (QaneRsta) API . . . . . . 3-26
| Input Data Format . . . . . . . . . . . . . . . . . 3-10 Restrictions . . . . . . . . . . . . . . . . . . . . 3-26
| Field Descriptions for Input Data . . . . . . . . . 3-10 Authorities and Locks . . . . . . . . . . . . . . . 3-27
| Device Definition Format . . . . . . . . . . . . . 3-10 Required Parameter Group . . . . . . . . . . . . 3-27
| Field Descriptions for Device Definition . . . . . . 3-11 SVRS0100 Format . . . . . . . . . . . . . . . . 3-27
| Media File Definition Format . . . . . . . . . . . 3-11 Field Descriptions . . . . . . . . . . . . . . . 3-27
| Field Descriptions for Media File Definition . . . . 3-11 SRST0100 Format . . . . . . . . . . . . . . . . . 3-28
| Error Messages . . . . . . . . . . . . . . . . . . 3-11 Field Descriptions . . . . . . . . . . . . . . . 3-28
| Delete Media Definition (QSRDLTMD, Error Messages . . . . . . . . . . . . . . . . . . 3-29
| QsrDeleteMediaDefinition) API . . . . . . . . . . . 3-12 Restore Object (QsrRestore) API . . . . . . . . . . 3-29
| Authorities and Locks . . . . . . . . . . . . . . . 3-12 Authorities and Locks . . . . . . . . . . . . . . . 3-29
| Required Parameter Group . . . . . . . . . . . . 3-12 Required Parameter Group . . . . . . . . . . . . 3-29
| Error Messages . . . . . . . . . . . . . . . . . . 3-12 User Space Format . . . . . . . . . . . . . . . . 3-30
Dump Device (QTADMPDV) API . . . . . . . . . . . 3-12 Field Descriptions . . . . . . . . . . . . . . . . . 3-30
Required Parameter . . . . . . . . . . . . . . . . 3-13 Valid Keys . . . . . . . . . . . . . . . . . . . . . 3-30
Optional Parameter Group . . . . . . . . . . . . 3-13 Field Descriptions . . . . . . . . . . . . . . . . . 3-31
Examples . . . . . . . . . . . . . . . . . . . . . 3-14 Dependencies between Keys . . . . . . . . . . . 3-36
Error Messages . . . . . . . . . . . . . . . . . . 3-14 Relationship to RST Command . . . . . . . . . . 3-37
Free Object (QTAFROBJ) API . . . . . . . . . . . . 3-14 Error Messages . . . . . . . . . . . . . . . . . . 3-37
Authorities and Locks . . . . . . . . . . . . . . . 3-14 Retrieve Backup Detail (QEZRTBKD) API . . . . . . 3-37
Required Parameter Group . . . . . . . . . . . . 3-14 Authorities and Locks . . . . . . . . . . . . . . . 3-37
TAFO0100 Format . . . . . . . . . . . . . . . . . 3-14 Required Parameter Group . . . . . . . . . . . . 3-37
Field Descriptions . . . . . . . . . . . . . . . . . 3-15 RBKD0100 Format . . . . . . . . . . . . . . . . 3-38
Error Messages . . . . . . . . . . . . . . . . . . 3-15 Field Descriptions . . . . . . . . . . . . . . . . . 3-38
List Save File (QSRLSAVF) API . . . . . . . . . . . 3-15 Error Messages . . . . . . . . . . . . . . . . . . 3-38
Authorities and Locks . . . . . . . . . . . . . . . 3-15 Retrieve Backup History (QEZRTBKH) API . . . . . 3-38
The Change Backup Schedule (QEZCHBKS) API allows the 38 23 CHAR(6) Thursday backup time
user to change the Operational Assistant backup schedules. 44 2C CHAR(1) Friday backup
45 2D CHAR(6) Friday backup time
Authorities and Locks 51 33 CHAR(1) Saturday backup
Special Authority *JOBCTL and *SAVSYS 52 34 CHAR(6) Saturday backup time
User Index Authority *CHANGE
User Index Lock *EXCL
Field Descriptions
Required Parameter Group
Friday backup. The backup type to be performed on
Input structure
Friday. Possible values follow:
INPUT; CHAR(*)
The variable that contains the backup schedule changes. 1 *DAILY
The layout of this parameter is defined by the format 2 *WEEKLY
name parameter. 3 *MONTHLY
4 *WEEKMONTH. The weekly backup options are
Length of input structure used to run the backup every week except for
INPUT; BINARY(4) the week that the monthly backup is to occur.
Length of the change request structure. A minimum The monthly backup week is determined by the
length of 58 is required for the CBKS0100 format. value that the user specifies for the Occurrence
Format name of week in month to run backup field.
INPUT; CHAR(8) 9 *SAME. No change is made to the current
The format of the input structure data. Format backup schedule for the specified day of the
CBKS0100 contains the information regarding changes week.
to the Operational Assistant backup schedule. For more blank No backup is scheduled for the specified day of
information, see “CBKS0100 Format.” the week.
Error code Friday backup time. The time that the backup should occur
I/O; CHAR(*) on Friday. Possible values follow:
The structure in which to return error information. For HHMMSS The time that the backup operation should occur
the format of the structure, see “Error Code Parameter” for the specified day of the week. A 24-hour
on page 2-6. format is used.
blank No backup operations are scheduled to be per-
formed for the specified day of the week.
*SAME No change should be made to the current Run backup using this schedule. Whether the backup
backup operations that are scheduled for the schedule should be used to run backups. Possible values
specified day of the week. follow:
HHMMSS The time that the backup operation should occur blank No backup operations are scheduled to be per-
for the specified day of the week. A 24-hour formed for the specified day of the week.
format is used. *SAME No change should be made to the current
blank No backup operations are scheduled to be per- backup operations that are scheduled for the
formed for the specified day of the week. specified day of the week.
*SAME No change should be made to the current
backup operations that are scheduled for the Wednesday backup. The backup type to be performed on
specified day of the week. Wednesday. Possible values follow:
1 *DAILY
Thursday backup. The backup type to be performed on
2 *WEEKLY
Thursday. Possible values follow:
3 *MONTHLY
1 *DAILY 4 *WEEKMONTH. The weekly backup options are
2 *WEEKLY used to run the backup every week except for
3 *MONTHLY the week that the monthly backup is to occur.
4 *WEEKMONTH. The weekly backup options are The monthly backup week is determined by the
used to run the backup every week except for value that the user specifies for the Occurrence
the week that the monthly backup is to occur. of week in month to run backup field.
The monthly backup week is determined by the 9 *SAME. No change is made to the current
value that the user specifies for the Occurrence backup schedule for the specified day of the
of week in month to run backup field. week.
9 *SAME. No change is made to the current blank No backup is scheduled for the specified day of
backup schedule for the specified day of the the week.
week.
blank No backup is scheduled for the specified day of Wednesday backup time. The time the backup should
the week. occur on Wednesday. Possible values follow:
HHMMSS The time that the backup operation should
Thursday backup time. The time the backup should occur
occur for the specified day of the week. A
on Thursday. Possible values follow:
24-hour format is used.
HHMMSS The time that the backup operation should occur blank No backup operations are scheduled to be
for the specified day of the week. A 24-hour performed for the specified day of the week.
format is used. *SAME No change should be made to the current
blank No backup operations are scheduled to be per- backup operations that are scheduled for
formed for the specified day of the week. the specified day of the week.
*SAME No change should be made to the current
backup operations that are scheduled for the
specified day of the week. Error Messages
Tuesday backup. The backup type to be performed on CPF1061 E Time not valid.
Tuesday. Possible values follow: CPF1099 E Subsystem not started because system ending.
CPF1629 E Not authorized to job schedule &1.
1 *DAILY
CPF1637 E Job schedule &1 in library &2 in use.
2 *WEEKLY
CPF1EC0 E
3 *MONTHLY
Job schedule in use by another user.
4 *WEEKMONTH. The weekly backup options are
CPF1EC3 E
used to run the backup every week except for
Not authorized to Backup Schedule.
the week that the monthly backup is to occur.
CPF1EC4 E
The monthly backup week is determined by the
Cannot display Backup Schedule.
value that the user specifies for the Occurrence
CPF1EC5 E
of week in month to run backup field.
Backup option &1 is not valid.
9 *SAME. No change is made to the current
CPF1EC6 E
backup schedule for the specified day of the
Value &1 for run backup not valid.
week.
CPF1EC8 E
blank No backup is scheduled for the specified day of
Value &1 for hours before backup not valid.
the week.
CPF1EC9 E
Tuesday backup time. The time that the backup should Value &1 for occurrence of week not valid.
occur on Tuesday. Possible values follow: CPF1E99 E Unexpected error occurred.
CPF24B4 E Severe error while addressing parameter list.
HHMMSS The time the backup operation should occur for CPF3C17 E
the specified day of the week. A 24-hour format Error occurred with input data parameter.
is used.
Error code
Authorities and Locks I/O; CHAR(*)
Job Authority *JOBCTL, if the job for which information is The structure in which to return error information. For
changed has a different user profile from that the format of the structure, see “Error Code Parameter”
of the job that calls the QTACJMA API. on page 2-6.
*JOBCTL special authority is required when
changing or replacing the resource allocation CJMA0100 Format
priority.
The following table lists the fields for the media library attri-
butes description in the CJMA0100 format. For more infor-
Required Parameter Group mation about each field, see “Field Descriptions” on
Media library attributes description page 3-6.
INPUT; CHAR(*)
The media library attributes. Either the entire list of attri-
Number of device entries. The number of entries in the Wait time for initial mount. The maximum amount of time,
device list changed for this format. There must be at least in minutes, a request will wait for the allocation of a tape
one entry defined. The maximum number of device entries resource to mount the first volume. Valid values range from
allowed is 1000. 1 through 600.
The Change Object Backup List (QEZCHBKL) API changes Number of variable length records. The number of
the backup type for a list of objects that are specified by the records. Only specific attributes can be changed. Refer to
user. “Valid Keys” on page 3-8 for more information.
Length of data. The length of the data that is used to 3 Back up monthly. Back up folder objects during the
specify the value for the given parameter. monthly backup.
4 No backup. Folder objects are not backed up at all.
Data. The data that is used to specify the value for the
given key.
Library Key Format
Valid Keys
Offset
The following table lists the valid keys for the key field area
Dec Hex Type Field
of the variable length record. For detailed descriptions of the
keys, see “Field Descriptions.” BINARY(4) Number in array
CHAR(1) Backup type
Key Type Field
Note: This field repeats for each library name.
1 CHAR(*) Library
CHAR(10) Library name
2 CHAR(*) Folder
Field Descriptions
Field Descriptions
Library name. The library name of the object to be
Folder. The backup type selected and the list of folder changed for the backup type that you specified.
objects to have their backup type changed. For the format of
this field, see “Folder Key Format.” Number in array. The number of library names of objects
to have their backup type changed. The value must be 1 or
Library. The backup type selected and the list of library greater.
objects to have their backup type changed. For the format of
this field, see “Library Key Format.” Backup type. Backup type that you selected for the library
objects. The possible values follow:
Folder Key Format 1 Back up daily. Back up library objects during the daily
backup. Backing up daily means that the library
Offset
objects are also saved on the weekly and monthly
backups.
Dec Hex Type Field 2 Back up weekly. Backup library objects during the
BINARY(4) Number in array weekly backup. Backing up weekly means that the
CHAR(1) Backup type library objects are also saved on the monthly backups.
3 Back up monthly. Back up library objects during the
Note: This field repeats for each folder name.
monthly backup.
CHAR(12) Folder name 4 No backup. Library objects are not backed up at all.
| Input data
| Create Media Definition (QSRCRTMD, | INPUT; CHAR(*)
| QsrCreateMediaDefinition) API | The variable that is to hold all the information defining
| the use of multiple tape files for a save or restore opera-
| tion. See “Input Data Format” on page 3-10 for the
| Required Parameter Group: | format of the input data.
| Length of data
| 1 Qualified media defi- Input Char(20)
| nition name | INPUT; BINARY(4)
| 2 Input data Input Char(*) | The length of the data in the input data parameter. The
| 3 Length of data Input Binary(4) | length of data parameter may be specified up to the size
| 4 Format name Input Char(8) | of the input data variable specified in the user program.
| 5 Public authority Input Char(10) | If the length of data parameter specified is larger than
| 6 Text description Input Char(50) | the allocated size of the input data variable specified in
| 7 Replace Input Char(1)
| the user program, the results are not predictable. The
| 8 Error code I/O Char(*)
| minimum length is 72 bytes.
| Service Program: QSRLIB01 | Format name
| INPUT; CHAR(8)
| Threadsafe: No
| The name of the format for input data. The valid value
| is:
| The Create Media Definition (OPM, QSRCRTMD; ILE,
| TAPE0100 Tape devices and media
| QsrCreateMediaDefinition) API creates a media definition
| specified by the user. A media definition defines the | Public authority
| devices and media to be used in parallel by a save or restore | INPUT; CHAR(10)
| operation. For more information about using a media defi-
| The authority you give to users who do not have specific
| nition, see the Backup and Recovery book.
| private or group authority to the media definition. Once
| the media definition has been created, its public
| Authorities and Locks | authority stays the same when it is moved to another
| library or restored from backup media.
| Media Definition Authority
| *OBJMGMT, *OBJEXIST, and *READ. These | If the replace parameter is used and an existing media
| authorities are required only if an existing | definition is replaced, this parameter is ignored. All
| media definition is to be replaced. | authorities are transferred from the replaced media defi-
| Library Authority | nition to the new one.
| *EXECUTE, *ADD and *READ | The valid values for this parameter are:
| Media Definition Lock
| *EXCL | *ALL The user can perform all authorized oper-
| Library Lock *SHRUPD | ations on the media definition.
| Authorization list name
| The media definition is secured by the
| Required Parameter Group | specified authorization list, and its public
| Qualified media definition name | authority is set to *AUTL. The specified
| INPUT; CHAR(20) | authorization list must exist on the system
| The media definition to be created. The first 10 charac- | when this API is issued. If the list does
| ters contain the media definition name. The second 10 | not exist, the create process fails, and an
| characters contain the name of the library in which the | error message is returned to the applica-
| media definition is located. | tion.
| *CHANGE The user has read, add, update, and
| You can use the following special value for the library | delete authority for the media definition
| name. It should be noted, however, that the library | and can read the object description.
| name that is actually used is not passed back to the | *EXCLUDE The user cannot access the media defi-
| nition in any way.
| Field Descriptions for Device Definition | Offset to next media file definition. The offset from the
| beginning of the input data to the next media file definition for
| Device name. The name of a tape device description or | the device. This value must be a multiple of 4.
| tape media library device description.
| Offset to volume identifier array. The offset from the
| Media file definitions. A description of the media files to be | beginning of the input data to the first volume identifier for
| used on this device. See “Media File Definition Format” on | the tape file. This value must be a multiple of 4.
| page 3-11 for the format of a media file definition.
| Sequence number. The tape file sequence number for the
| Number of media file definitions. The number of media | media file.
| file definitions for the device. The possible values are 1
| through 32. | The possible values are:
| 0 A save operation begins after the last
| Offset to first media file definition. The offset from the | sequence number on the starting volume. A
| beginning of the input data to the first media file definition for | restore operation searches the starting volume
| the device. This value must be a multiple of 4. | for a media file containing any of the objects
| to restore.
| Offset to next device definition. The offset from the begin-
| 1-16777215 The sequence number of the tape file.
| ning of the input data to the next device definition for the
| media definition. This value must be a multiple of 4. | Starting volume array element. The element in the volume
| identifier array containing the volume on which the save or
| Reserved. An ignored field. The value must be
| restore operation should begin. The possible values are 0
| hexadecimal zeros.
| through the number of volume identifiers specified. If the
| number of volume identifiers is 0, this value must be 0. If the
| Media File Definition Format | number of volume identifiers is greater than 0, this value
| must be greater than 0.
| Offset
| Volume identifier array. An array of volume identifiers. The
| Dec Hex Type Field | save or restore operation will use the volumes in the order
| 0 0 BINARY(4) Offset to next media file | specified, beginning with the starting volume array element.
| definition | If additional volumes are needed after the last array element
| 4 4 BINARY(4) Sequence number | is used, the save or restore operation will call the Tape Man-
| agement exit program or prompt the user to provide each
| 8 8 BINARY(4) Offset to volume identifier
| array
| additional volume. The possible value for a volume identifier
| is:
| 12 C BINARY(4) Number of volume identi-
| fiers | Volume identifier
| The identifier of a volume.
| 16 10 BINARY(4) Length of volume identifier
| 20 14 BINARY(4) Starting volume array
| element | Error Messages
| CHAR(*) Volume identifier array | CPF24B4 E Severe error while addressing parameter list.
| CPF386F E Value in input data parameter not valid.
| CPF3C17 E
| Field Descriptions for Media File Definition | Error occurred with input data parameter.
| CPF3C1D E
| Length of volume identifier. The number of bytes in each | Length specified in parameter &1 not valid.
| volume identifier. The possible values are 0 through 6. If 0 | CPF3C21 E
| is specified, the number of volume identifiers specified must | Format name &1 is not valid.
| be 0. | CPF3C29 E
| Object name &1 is not valid.
| Number of volume identifiers. The number of volume
| CPF3C3C E
| identifiers used for the tape file. The possible values are 0
| Value for parameter &1 not valid.
| through 75. If 0 is specified, the volume currently placed in
| CPF3C90 E
| the device is used. If 0 is specified for a tape media library
| Literal value cannot be changed.
| device, volume identifiers must be supplied by using the
| CPF3CF1 E
| Tape Management exit program during the save or restore
| Error code parameter not valid.
| operation.
| CPF9800 E All CPF98xx messages could be signaled. xx is
| from 01 to FF.
| CPF9999 E Function check. &1 unmonitored by &2 at state-
| ment &5, instruction &3.
1 Device name Input Char(10) Error logs that are associated with the device resource
(and each resource within a media library device).
Optional Parameter Group: Associated internal system objects.
2 Type of information Input Char(10) Media and Storage Extensions (MSE) flight recorder.
3 Problem identifier Input Char(10)
4 Error code I/O Char(*) This flight recorder traces the structures that are passed
to a tape management system registered with the regis-
Threadsafe: No tration facility and traces the response from the regis-
tered program. This flight recorder can be helpful in
developing and maintaining a tape management product.
The Dump Device (QTADMPDV) API collects information for MSE is an optional feature of OS/400.
your IBM service representative. This API should be used
immediately after a suspected device and/or tape manage- Note that this API will generate multiple spooled files and
ment system failure. If the API is not used immediately, other may get large depending upon the job logs that are being
device operations may cause the flight recorders to wrap, printed and the size of the other device information. Submit-
which could result in lost information. A problem identifier will ting the call to batch may be used if system performance is a
be created and an APAR library will be generated similar to concern. That is, if the API is called from the system console
the Save APAR Data (SAVAPARDTA) command. To save at high priority, it may degrade performance on other critical
the APAR library, use Work with Problem (WRKPRB) processing. Since many and potentially large spooled files
command. Choose the option to work with the problem and may be generated, ensure that there is enough system
then the option to save the APAR library. If an existing storage available to handle the request.
problem identifier is passed to this API, then the spooled files
generated will be logged against that problem identifier and
no new problem identifier will be generated.
Required Parameter
Device name
The Dump Device API currently supports the following device INPUT; CHAR(10)
types:
The name of the device for which debugging information
Tape (TAP) devices is being dumped.
Tape media library (TAPMLB) devices
Optical (OPT) devices Optional Parameter Group
Optical media library (OPTMLB) devices Type of information
Diskette (DKT) devices INPUT; CHAR(10)
Note: The information provided in and the number of The type of information to be dumped. Valid values are:
spooled files may change at anytime. The information pro-
*ALL All information needed by IBM will be
vided is intended for problem determination.
dumped to spooled files.
The Dump Device (QTADMPDV) API dumps the following *MSE Media and Storage Extension (MSE) flight
information into spooled files: recorder will be dumped.
The contents of the device flight recorder for the device Problem identifier
specified in the parameter that is passed to the program. INPUT; CHAR(10)
This includes OS/400 flight recorders. The problem identifier of the problem being analyzed.
QSYSARB job log. Problems with different system origins can have the
same identifier. The possible values are:
QSYSOPR message queue.
Job logs of the active jobs that have used the device as *NEW A problem identifier will be created.
indicated in the flight recorder data. problem-identifier
The 10-character problem identifier of the
The history log (QHST). problem being selected.
Device description of the device.
Error code
Communication information that is associated with the I/O; CHAR(*)
media library device. This includes the line, controller,
The structure in which to return error information. For
and device descriptions.
the format of the structure, see “Error Code Parameter”
The job log of the job that is processing this API.
The caller of this API is required to verify that the specified 30 1E CHAR(10) Object type
object has not been changed since it was last saved. 40 28 BINARY(4) Offset to path name struc-
ture
CPF3C39 E
Offset
Value for reserved field not valid.
Dec Hex Type Field CPF3C4B E
44 2C BINARY(4) Length of path name struc- Value not valid for field &1.
ture CPF3C4C E
CHAR(*) Path name structure Value not valid for field &1.
CPF3C90 E
Literal value cannot be changed.
Field Descriptions CPF3CF1 E
Error code parameter not valid.
Length of the path name structure. The length, in bytes, CPF6708 E Command ended due to error.
of the path name structure. This field must be set to zero if CPF67C2 E
the object does not have a path name structure passed. Path name structure field &7 not valid.
Valid values are 0 and 48 through 32048. CPF67C4 E
Object &1 type &2 in library &3 not freed.
Object library. The library name of the object to be freed. Object in use.
The special value is: CPF67C5 E
*PATH The path name structure contains the object Object &1 type &2 in library &3 not freed.
information. CPF9801 E Object &2 in library &3 not found.
CPF9802 E Not authorized to object &2 in &3.
Object name. The name of the object to be freed by the CPF9872 E Program or service program &1 in library &2
API. The special value is: ended. Reason code &3.
*PATH The path name structure contains the object
information.
List Save File (QSRLSAVF) API
Object type. The type of object specified to be freed by the
API. Possible values follow:
*DOC The object to be suspended is a document. Required Parameter Group:
*PATH The path name structure will contain the object
1 Qualified user space name Input Char(20)
information. 2 Format name Input Char(8)
3 Qualified save file name Input Char(20)
Offset to path name structure. The offset from the start of 4 Object name filter Input Char(10)
the structure, in bytes, to a path name structure that contains 5 Object type filter Input Char(10)
object path name and translation information. This field must 6 Continuation handle Input Char(36)
be set to zero if the object does not have a path name struc- 7 Error code I/O Char(*)
ture. Valid values are 0 and 48 through 32048.
Threadsafe: No
Path name structure. The path name structure and trans-
lation information for the suspended object. The path name
structure contains information such as CCSID, country, and The List Save File (QSRLSAVF) API lists the contents of a
language. For more information on this structure, see “Path save file.1 The generated list replaces any data that already
Name Format” on page 2-8. The path name must be in the exists in the user space; it does not add the new list to an
library file system format, for example, existing one. The generated list is not sorted.
/QSYS.LIB/QDOC.LIB/DOC1.DOC
Authorities and Locks
Reserved. An ignored field. This field must be set to
blanks. Save File Library Authority
*USE
Save File Authority
Error Messages *USE
CPF24B4 E Severe error while addressing parameter list. Save File Lock
CPF3C1D E *EXCLRD
Length specified in parameter &1 not valid. User Space Authority
CPF3C21 E *CHANGE
Format name &1 is not valid.
1 A save file is a file allocated in auxiliary storage that can be used to store saved data on disk (without requiring diskettes or tapes), to do
I/O operations from a high-level language program, or to receive objects sent through the network.
User Space Library Authority can determine if a previous call resulted in partially com-
*USE plete information by checking the information status field
User Space Lock in the generic user space header following the API call.
*EXCLRD For information about the generic header, see “User
Space Format for List APIs” on page 2-4.
Required Parameter Group If the API is not attempting to continue from a previous
call, this parameter must be set to blanks. Otherwise, a
Qualified user space name valid continuation value must be supplied. The value
INPUT; CHAR(20) may be obtained from the continuation handle returned
The user space that is to receive the created list. The field in the header section. See “Format of the Gener-
first 10 characters contain the user space name, and the ated List” for information about the header section.
second 10 characters contain the name of the library
Error code
where the user space is located. You can use these
I/O; CHAR(*)
special values for the library name:
The structure in which to return error information. For
*CURLIB The job’s current library the format of the structure, see “Error Code Parameter”
*LIBL The library list on page 2-6.
Format name
INPUT; CHAR(8) Format of the Generated List
The content and format of the information returned for
The save file list consists of:
the save file. The possible format names are:
A user area
SAVF0100 Library level
SAVF0200 Object level A generic header
SAVF0300 Member level An input parameter section
For more information, see the specified formats in the A header section
“Format of the Generated List.”
A list data section (containing one of the following) :
Qualified save file name – SAVF0100 format
INPUT; CHAR(20)
– SAVF0200 format
The save file about which to list information, and the
library in which the save file is located. The first 10 – SAVF0300 format
characters contain the save file name, and the second
For details about the user area and generic header, see
10 characters contain the library name. You can use
“User Space Format for List APIs” on page 2-4. For details
these special values for the library name:
about the remaining items, see the following sections. For
*CURLIB The job’s current library detailed descriptions of the fields in the list returned, see
*LIBL The library list “Field Descriptions” on page 3-17.
Object name filter When you retrieve list entry information from a user space,
INPUT; CHAR(10) you must use the entry size returned in the generic header.
The name of the objects to search for. This name may The size of each entry may be padded at the end. If you do
be a simple name, a generic name, or the special value not use the entry size, the result may not be valid. For
*ALL. If the name is not a valid name, an empty list will examples of how to process lists, see the DLTOLDSPLF
be returned. This field must be *ALL for the SAVF0100 example programs in Appendix A, “Examples.”
format.
Input Parameter Section
Object type filter
INPUT; CHAR(10) Offset
The type of objects to search for. You may either enter Dec Hex Type Field
a specific type or the special value *ALL. For a com- 0 0 CHAR(10) User space name specified
plete list of the available object types, see the CL Refer-
10 A CHAR(10) User space library name
ence (Abridged) manual. This field must be *ALL for the
specified
SAVF0100 format and the SAVF0300 format.
20 14 CHAR(8) Format name
Continuation handle
28 1C CHAR(10) Save file name specified
INPUT; CHAR(36)
38 26 CHAR(10) Save file library name speci-
The handle used to continue from a previous call to this fied
API that resulted in partially complete information. You
Offset Offset
Dec Hex Type Field Dec Hex Type Field
48 30 CHAR(10) Object name filter specified 60 3C CHAR(1) Data saved
58 3A CHAR(10) Object type filter specified 61 3D CHAR(10) Object owner
68 44 CHAR(36) Continuation handle speci- 71 47 CHAR(20) Document library object
fied (DLO) name
91 5B CHAR(63) Folder
Header Section 154 9A CHAR(50) Text description
Offset
SAVF0300 Format
Dec Hex Type Field
0 0 CHAR(10) User space name used Offset
10 A CHAR(10) User space library name Dec Hex Type Field
used
0 0 CHAR(10) File name
20 14 CHAR(10) Save file name used
10 A CHAR(10) Library saved
30 1E CHAR(10) Save file library name used
20 14 CHAR(10) Member name
40 28 CHAR(36) Continuation handle
30 1E CHAR(10) Extended object attribute
returned
40 28 CHAR(8) Save date and time
Data compressed. Whether the data was stored in com- Object size multiplier. The value to multiply the object size
pressed format. The possible values are: by to get the true size. The value is 1 if the object is smaller
than or equal to 999 999 999 bytes, 1024 if it is larger than
0 The data is not compressed.
999 999 999 but smaller than or equal to 4 294 967 295, and
1 The data is compressed.
4096 if larger than 4 294 967 295.
Data saved. Whether the data for this object was saved
Object type. The type of object. For a list of object types,
with the object. The possible values are:
see the CL Reference (Abridged) book.
0 The data was not saved. The object’s storage
was freed by a previous save command Object type filter specified. The type of objects to search
before this save operation. for. Only object types that match the filter are listed.
1 The data was saved. The object’s storage
was not freed by a previous save command Records. The number of records used to contain the saved
before this save operation. information in the save file.
Document library object (DLO) name. The name of the Release level. The earliest release level of the operating
document, folder, or mail object that was saved. If the object system on which the objects can be restored.
is a document or folder, the first 12 characters will contain
Reserved. An ignored field.
the DLO name. If the object is a mail object, the full 20 char-
acters will be used for the mail object name. If the save file
Save active. Whether objects in the library are allowed to
does not contain DLO information, this field will be blank.
be updated while they are being saved. The possible values
are:
Extended object attribute. Extended information about the
object type. If there is not an extended object attribute for *LIB Objects in the library are saved while in use
the object, this field will be blank. by another job. All of the objects in the library
reached a checkpoint together and were
File name. The name of the file that was saved. saved in a consistent state in relationship to
each other. All objects in the library are
Folder. The name of the folder that was saved. The folder
saved at the same time.
name is a fully qualified name. If the object is not a *FLR or
*NO Objects in the library are not saved while in
*DOC object, this field will be blank. For *DOC and *FLR
use by another job.
objects, this field will be set to the qualified name of the
*SYNCLIB Objects in the library are saved while in use
folder or to *NONE.
by another job. All of the objects and all of
the libraries in the save operation reached a
Format name. The format of the returned output.
checkpoint together. The objects and the
Library saved. The name of the library from which the libraries were saved in a consistent state in
objects are saved. relationship to each other.
*SYSDFN Objects in the library are saved while in use
Member name. The name of the file member that is saved. by another job. Objects in the library may
The member names are not in sorted order. have reached a checkpoint at different times
and may not be in a consistent state in
Members saved. The number of members saved for the relationship to each other.
file. *YES Document library objects are saved while in
use by another job. This value is valid only if
Object name. The name of the object saved. If the object
the SAVDLO command is used for the save
is a DLO object, this field will contain the system name of the
operation.
object.
Save command. The save command that is used when the
Object name filter specified. The name of the objects to
save operation is performed. The possible values are:
search for. Only objects with names that match the filter are
listed. QSYS Contents of the save file are created by the
operating system by using a function other
Object owner. The name of the object owner’s user profile. than the CL commands.
SAVCFG Saves configuration information.
Objects saved. The number of objects that are saved for SAVCHGOBJ
this library. Saves objects that changed since the date
and time specified on the referenced date
Object size. The size of the object in units of the size multi-
parameter.
plier. The true object size is equal to or smaller than the
SAVDLO Saves documents or folders located in library
object size multiplied by the object size multiplier.
QDOC.
SAVLIB Saves a copy of a library.
The Open List of Objects to be Backed Up (QEZOLBKL) API OBKL0600 Complete information format. The object
retrieves an open list of the objects that are to be backed up. type parameter may be *FLR or *LIB. For
more information, see “OBKL0600
For more information, see the "Process Open List APIs" in Format” on page 3-21.
the Information Center.
Object type
INPUT; CHAR(10)
Authorities and Locks
The type of the objects to be returned in the list. One of
User Index Authority the following object types may be used:
*USE
User Index Lock *FLR The folder information is returned. The
*SHRRD format name may be OBKL0200 or
OBKL0600.
*LIB The library information is returned. The
Required Parameter Group format name may be OBKL0100 or
Receiver variable OBKL0600.
OUTPUT; CHAR(*) Type of backup to select
The receiver variable that receives the information INPUT; CHAR(10)
requested. You can specify the size of the area to be The backup type of the objects that you request. Allow-
smaller than the format requested as long as you specify able backup types follow:
the length parameter correctly. As a result, the API
returns only the data that the area can hold. *DAILY Return information for objects that are
backed up *DAILY.
Length of receiver variable *WEEKLY Return information for objects that are
INPUT; BINARY(4) backed up *WEEKLY.
The length of the receiver variable provided. The length *MONTHLY Return information for objects that are
of receiver variable parameter may be specified up to backed up *MONTHLY.
the size of the receiver variable specified in the user *ALL Return information for objects that are
program. If the length of receiver variable parameter backed up *DAILY, *WEEKLY, or
specified is larger than the allocated size of the receiver *MONTHLY.
variable specified in the user program, the results are
Error code
not predictable.
I/O; CHAR(*)
List information The structure in which to return error information. For
OUTPUT; CHAR(80) the format of the structure, see “Error Code Parameter”
Information about the list that is created by this program. on page 2-6.
For a description of the layout of this parameter, see
“Format of List Information” on page 3-21.
Format of Receiver Variable
Number of records to return
INPUT; BINARY(4) The following tables describe the order and format of the
data that is returned in the receiver variable.
The number of records in the list to put into the receiver
variable. The value must be 0 or greater. OBKL0100 Format: The OBKL0100 format includes the
basic information for a library object entry. The following
Format name
table shows how this information is organized. For detailed
INPUT; CHAR(8)
descriptions of the fields in the list, see “Field Descriptions”
The name of the format to be used to return the on page 3-21.
requested information.
One of the following format names may be used: Offset
Dec Hex Type Field
OBKL0100 Library basic information format. The
object type parameter must be *LIB. For 0 0 CHAR(10) Backup option
more information, see “OBKL0100 10 A CHAR(10) Library name
Format.”
20 14 CHAR(2) Reserved
OBKL0200 Folder basic information format. The
object type parameter must be *FLR. For
more information, see “OBKL0200
Format” on page 3-21.
OBKL0200 Format: The OBKL0200 format includes the Last backup time. The time that the object was last backed
basic information for a folder object entry. The following up. The format of this field is in the HHMMSS as follows:
table shows how this information is organized. For detailed HH Hour
descriptions of the fields in the list, see “Field Descriptions” MM Minute
on page 3-21. SS Second
0 0 CHAR(10) Backup option Object description text. The text that describes the object.
10 A CHAR(12) Folder name
Reserved. An ignored field.
First record in buffer. The number of the first record in the Error Messages
receiver variable.
CPF1E65 E Library backup list in use.
Information complete indicator. Whether all information CPF1E67 D
that was requested has been supplied. Backup options and library backup list
damaged.
I Incomplete information. An interruption
CPF1E6B E
causes the list to contain incomplete informa-
Folder backup list in use.
tion about a buffer or buffers.
CPF1E6D D
P Partial and accurate information. Partial infor-
Folder backup list damaged; new one created.
mation is returned when the maximum space
CPF1EC5 E
is used and not all of the buffers that were
Backup option &1 is not valid.
requested are read.
CPF1EE4 E
C Complete and accurate information. All the
Not authorized to run backup.
buffers that were requested are read and
CPF1EEA E
returned.
Not authorized to library backup list.
Length of information returned. The size, in bytes, of the CPF1EEB E
information that is returned in the receiver variable. Not authorized to folder backup list.
CPF1E99 E Unexpected error occurred.
List status indicator. The status of building the list. CPF24B4 E Severe error while addressing parameter list.
CPF3C19 E
0 Building the list is pending.
Error occurred with receiver variable specified.
1 The list is in the process of being built.
CPF3C21 E
2 The list has been completely built.
Format name &1 is not valid.
3 An error occurred when the system built the
CPF3C31 E
list. The next call to the Get List Entries
Object type &1 is not valid.
(QGYGTLE) API causes the error to be sig-
CPF3C90 E
naled to the caller of QGYGTLE.
Literal value cannot be changed.
Record length. The length of each record of information CPF3CF1 E
returned. For variable length records, this value is set to 0. Error code parameter not valid.
For variable length records, you can obtain the length of indi- CPF8148 E Object &4 type &3 in &9 damaged.
vidual records from the records themselves. CPF8A77 E Folder &1 not found.
CPF8A78 E Folder &1 in use.
Records returned. The number of records that are returned CPF8A79 E Folder &1 is logically damaged.
in the receiver variable. This is the smallest of the following CPF8A80 E Document &2 in use in folder &1.
values: CPF9012 E Start of document interchange session not suc-
cessful for &1.
The number of records that fit into the receiver variable.
CPF9032 E Document interchange session not started.
The number of records in the list. CPF9076 E Internal system error processing documents or
The number of records that was requested. folders.
CPF9095 E Folder &1 is damaged.
Request handle. The handle of the request that can be CPF909A E Document &2 in folder &1 is damaged.
used for subsequent requests of information from the list. CPF9810 E Library &1 not found.
The handle is valid until the Close List (QGYCLST) API is CPF9872 E Program or service program &1 in library &2
called to close the list or until the job ends. ended. Reason code &3.
CPF9830 E Cannot assign library &1.
Note: This field should be treated as a hexadecimal field. It
CPF9838 E User profile storage limit exceeded.
should not be converted from one CCSID to another, for
CPF9999 E Function check. &1 unmonitored by &2 at state-
example, EBCDIC to ASCII, because doing so could result in
ment &5, instruction &3.
an unusable value.
[EFAULT] The address used for an argument is not The entire system has too many other file
correct. descriptors already open.
In attempting to use an argument in a call, the
[ENOENT] No such path or directory.
system detected an address that is not valid. The directory or a component of the path
name specified does not exist.
While attempting to access a parameter
passed to this function, the system detected A named file or directory does not exist or is
an address that is not valid. an empty string.
[EINVAL] The value specified for the argument is not [ENOMEM] Storage allocation request failed.
correct.
A function needed to allocate storage, but no
A function was passed incorrect argument storage is available.
values, or an operation was attempted on an
There is not enough memory to perform the
object and the operation specified is not sup-
requested function.
ported for that type of object.
[ENOTDIR] Not a directory.
An argument value is not valid, out of range,
A component of the specified path name
or NULL.
existed, but it was not a directory when a
[EIO] Input/output error.
directory was expected.
A physical I/O error occurred.
Some component of the path name is not a
A referenced object may be damaged. directory, or is an empty string.
[EISDIR] Specified target is a directory. [ENOSPC] No space available.
The path specified named a directory where a The requested operations required additional
file or object name was expected. space on the device and there is no space
left. This could also be caused by exceeding
The path name given is a directory.
the user profile storage limit when creating or
[ELOOP] A loop exists in the symbolic links.
transferring ownership of an object.
This error is issued if the number of symbolic
Insufficient space remains to hold the intended
links encountered is more than
file, directory, or link.
POSIX_SYMLOOP (defined in the limits.h
header file). Symbolic links are encountered
[ENOSYSRSC]
System resources not available to complete
during resolution of the directory or path
request.
name.
[EMFILE] Too many open files for this process.
[ENOTSAFE] Function is not allowed in a job that is running
with multiple threads.
An attempt was made to open more files than
allowed by the value of OPEN_MAX. The
[ENOTSUP] Operation not supported.
value of OPEN_MAX can be retrieved using The operation, though supported in general, is
the sysconf() function. not supported for the requested object or the
requested arguments.
The process has more than OPEN_MAX
descriptors already open (see the sysconf() [EOFFLINE] Object is suspended.
function).
You have attempted to use an object that has
[ENAMETOOLONG] had its data saved and the storage associated
A path name is too long.
with it freed. An attempt to retrieve the
A path name is longer than PATH_MAX char- object's data failed. The object's data cannot
acters or some component of the name is be used until it is successfully restored. The
longer than NAME_MAX characters while object's data was saved and freed either by
_POSIX_NO_TRUNC is in effect. For sym- saving the object with the STG(*FREE)
bolic links, the length of the name string sub- parameter, or by calling an API.
stituted for a symbolic link exceeds
[EUNKNOWN]
PATH_MAX. The PATH_MAX and
Unknown system state.
NAME_MAX values can be determined using
the pathconf() function. The operation failed because of an unknown
system state. See any messages in the job
[ENFILE] Too many open files in the system.
log and correct any errors that are indicated,
A system limit has been reached for the then retry the operation.
number of files that are allowed to be concur-
rently open in the system.
Error Messages
Required Parameter Group:
The following messages may be sent from this function:
1 Qualified user space Input Char(20)
CPI3C80 I An exit program has been called for which the
name
threadsafety status was not known. 2 User space format Input Char(8)
CPFA0D4 E name
File system error occurred. 3 Status format name Input Char(8)
CPE3418 E Possible APAR condition or hardware failure. 4 Status information Output Char(*)
CPF3CF2 E 5 Length of status infor- Input Binary(4)
Error(s) occurred during running of &1 API. mation
CPF9872 E Program or service program &1 in library &2 6 Error code I/O Char(*)
ended. Reason code &3.
Service Program: QANESERV
- QOpenSys To use the API, the application must provide the following:
- User-defined A user space that contains the required input parameter
- QNTC group
- QOPT When processing the restore command, the API does the fol-
- QLANSrv lowing:
If the Save Storage Free exit program calls the SAV Calls the exit program to indicate the start of the transfer
command or the QsrSave function or any other function sequence
that is not threadsafe, and there are secondary threads Submits the restore command for processing
active in the job, Qp0lSaveStgFree() may fail as a
Calls the exit program repeatedly to transfer the restore
result.
records
If the Save Storage Free exit program is not threadsafe
Calls the exit program to signal the end of the restore
or uses a function that is not threadsafe, then
operation
Qp0lSaveStgFree() is not threadsafe.
May call the exit program to force an abnormal end to
the restore operation
Related Information
The <Qp0lstdi.h> file The program that calls the API is suspended while the
restore operation is being processed.
Example
Restrictions
See Qp0lGetAttr() description for a code example that
shows a call to Qp0lSaveStgFree() by using a procedure as QTEMP should not be specified for the library name on the
the exit program. This API also shows an example of a call OUTFILE parameter because the restore command is sub-
to Qp0lGetAttr(). mitted by a prestart job running in the QSYSWRK subsystem
and not in the job that called the API. Locks should not be
applied to restore objects that would conflict with locks
applied by the restore operation running in the prestart job.
Restore from Application (QaneRsta) API
Objects can only be restored by this API if the objects were
saved using the “Save to Application (QaneSava) API” on
page 3-80, and only if the objects were saved from the
current or an earlier release of the operating system.
The application must provide the restore records in the order Status information
presented, without modification, for the objects to be suc- OUTPUT; CHAR(*)
cessfully restored.
The status information returned on the API call.
You can use the following special values for the library | 44 2C Char(8) Target release
name: Char(*) Restore command parame-
ters
*CURLIB The job's current library is used to locate
the user space. If no library is specified Char(*) Application data
as the current library for the job, the
QGPL library is used. Field Descriptions:
*LIBL The library list is used to locate the user
space. Application data. Information that the application wants
passed to the exit program. The content of this information
The actual library that is used is returned in the status is defined by the application. This field could contain infor-
information. the user space. mation specific to the object being saved (such as the object
name, size, and so forth), or it could contain the qualified
User space format name
name of another object that contains this information.
INPUT; CHAR(8)
The format name for the input parameters that are con- Exit program library. The name of the library that contains
tained in the user space. For the format of the structure, the exit program called by the API. the exit program.
see “SVRS0100 Format.”
Exit program name. The name of the exit program that is
Status format name called by the API. See “Restore from Application Exit
INPUT; CHAR(8) Program” on page 3-83 for additional details.
The format name for the status information returned on
Length of application data. The length of the application
the API call. For the format of the structure, see
data. This value is passed to the exit program. This value
“SRST0100 Format” on page 3-28.
must be set to zero if there is no application data.
Length of restore command parameters. The length of These additional restrictions apply to the command parame-
the restore command parameters. The maximum allowable ters when you use the Restore Object (QsrRestore) API.
length is 5900 bytes for restore commands.
The keys specified must be consistent with restore from
Length of structure. The length of this structure, from the save file operations.
start of the input parameters to the last byte of the applica- The DEV key must not be used. These key is provided
tion data. by this API.
Offset to application data. The byte offset from the begin- The starting offset for the keys is always 0 and not the
ning of the user space to the start of the application data. offset of the restore command parameters.
This value must be set to zero if there is no application data. All integer values within the keys must be aligned on
4-byte boundaries.
Offset to restore command parameters. The byte offset
from the beginning of the user space to the start of the All pointers within the keys must be aligned on 16-byte
restore command parameters. boundaries.
Restore command parameters. A character string that Restore command type. The type of restore command that
contains the restore command parameters or restore keys. is to be processed.
These parameters are validated when the API submits the 1 Restore (RST) command
command for processing. Refer to the restore commands in 2 Restore Object (RSTOBJ) command
the CL Reference (Abridged) book for detailed information 3 Restore Document Library Object (RSTDLO)
about valid parameters when you restore objects from save command
files. Refer to “Restore Object (QsrRestore) API” on 4 Restore Library (RSTLIB) command
page 3-29 for detailed information about valid keys when you 5 Restore Object (QsrRestore) API
restore objects from save files.
| Target release.
These additional restrictions apply to the restore command
parameters when you use this API: | An ignored field. Must be set to blanks.
Example 3: Restore command type 4 (RSTLIB) Transfer block size. The number of bytes in the blocks
SAVLIB(JOE) transferred by the exit program.
These parameters restore the library named JOE.
Transfer time. The elapsed time, in seconds, that begins Required Parameter Group:
when the application calls the API, and ends when the API
1 Qualified user space Input Char(20)
returns to the caller.
name
2 Error code I/O Char(*)
User space library used. The name of the user space
library that is used in the API call.
Service Program: QSRLIB01
user. Care should be taken when you use these special Field Descriptions
values to avoid unexpected results.
Data. The data used to specify the value for the given key.
*CURLIB The job’s current library is used to locate
the user space. If no library is specified Key. The parameter of the Restore Object (RST) command
as the current library for the job, the to specify. See “Valid Keys” for the list of valid keys.
QGPL library is used.
*LIBL The library list is used to locate the user Offset to first record. The offset from the beginning of the
space. user space to the first variable length record.
Error code Offset to next record. The offset from the beginning of the
I/O; CHAR(*) user space to the next variable length record.
The structure in which to return error information. For
the format of the structure, see “Error Code Parameter” Number of variable length records. The number of vari-
on page 2-6. | able length records that are passed in the user space. The
| valid range is from 2 through 16.
Authorization list linkage: The system on BINARY(4) Offset to first device path
name
which an object with an authorization list
is being restored is different from the Note: These fields repeat for each device name.
system on which it was saved. BINARY(4) Offset to next device path
name
The default is 0.
CHAR(12) Reserved
The possible values are:
0 No differences are allowed CHAR(*) Device path name
between the saved object and
the restored object. If 0 is spec- Device path name.
ified for the allow object differ- The path name of the device used for the
ence field, 1 must be specified restore operation. The path name should be
for the number in array field. specified in the Qlg_Path_Name_T format. If
(*NONE) a pointer is specified in the path name format,
If the owner is different, the it must be 16-byte aligned. If not, unpredict-
object is not restored. able results may occur. For more information
on this structure, see “Path Name Format” on
If the system is different for an page 2-8.
object with an authorization list,
the object is restored, but the The possible values are:
current values, not with the values they had at The possible values are:
the time of the save operation. The path 0 The objects that match the
name should be specified in the object name pattern are not
Qlg_Path_Name_T format. If a pointer is restored. This value overrides
specified in the path name format, it must be the objects that are included
16-byte aligned. If not, unpredictable results with option 1 and is intended to
may occur. For more information on this be used to omit a subset of a
structure, see “Path Name Format” on previously selected pattern.
page 2-8. (*OMIT)
The possible value is:
1 The objects that match the
object name pattern are
path-name The path name or pattern that
restored, unless overridden by
can match many names. If 0 is
an omit specification.
specified for the new name
(*INCLUDE)
option, each component in the
path name must exist with the
Reserved Reserved.
exception of the last compo- The possible value is:
nent. The name in the last blanks This field should contain
component is restored as new blanks.
if it does not exist.
Offset to first object path name. Optical file. The path name of the optical file that is used
The offset from the beginning of the user for the restore operation. The path name should be specified
space to the first object path name. in the Qlg_Path_Name_T format. If a pointer is specified in
the path name format, it must be 16-byte aligned. If not,
The possible value is:
unpredictable results may occur. For more information on
n The offset from the beginning
this structure, see “Path Name Format” on page 2-8.
of the user space to the first
object path name. Note: This key is required when using an optical device.
Offset to new object path name.
The possible value follows:
The offset from the beginning of the user
space to the new object path name. Optical file The path name of the optical file that is used
for the restore operation, beginning with the
The possible values are:
root directory of the volume.
0 There is not a new object path
name. The object will be When using a CD-ROM device, the extension
restored to the same name with separator, the version separator, and the
which it was saved. version number must be included at the end
n The offset from the beginning of the path name. For example, a file named
of the user space to the new 'myfile' that is in the root directory of the
object path name. volume, and that has no extension and only a
Offset to next object. single version, is specified as '/myfile.;1'.
The offset from the beginning of the user
space to the next object in the list. Option. Whether to restore objects that already exist on the
system or to restore objects that do not already exist on the
The possible value is:
system. The default is 0.
n The offset from the beginning
of the user space to the next The possible values are:
object in the list. If the current
object is the last object in the
0 All of the specified objects are restored,
whether or not they already exist on the
array, this value should be 0.
system. (*ALL)
Option. Whether names that match the pattern should
be included or omitted from the restore opera-
1 Objects are restored only if they do not
already exist on the system. (*NEW)
tion. Note that in determining whether the
name matches a pattern, relative name pat-
2 Objects are restored only if they already exist
on the system. (*OLD)
terns are always treated as relative to the
current working directory.
Output. Whether a list of information about the restored
Note: The subtree key specifies whether the objects is created. The information can be directed to a
subtrees are included or omitted. spooled file, a stream file, or a user space.
Save date. The date the objects were saved. If the most
Offset
recently saved version is the one being restored, or if mul-
Dec Hex Type Field tiple saved versions reside on the media, specify the date
CHAR(1) Option that identifies which version of the objects to restore. If this
CHAR(1) Type of output information key is not specified, the restored version of the objects is the
first version found.
CHAR(14) Reserved
CHAR(*) Output path name The possible values are:
date The date the objects were saved, in the
Option. Whether a list of information about the format CYYMMDD:
restored objects is created. The default is 0. C Century, where 0 indicates
The possible values are: years 19xx and 1 indicates
0 No output is created. (*NONE) years 20xx.
1 The output is printed with the YY Year
job’s spooled output. (*PRINT) MM Month
2 The output is directed to an DD Day
existing stream file or user
Save time. The time the objects were saved. If this key is
space specified by the output
not specified, the version of the objects to be restored is the
path name.
first version on the volume.
Output path name.
The path name should be specified in the Note:
Qlg_Path_Name_T format. If a pointer is 1. This key is valid only if the save date key is specified.
specified in the path name format, it must be 2. This key is ignored when the sequence number key is
16-byte aligned. If not, unpredictable results specified.
may occur. For more information on this
structure, see “Path Name Format” on The possible values are:
page 2-8.
time The time the objects were saved in the format
The possible value is: HHMMSS:
path-name The path name of the existing HH Hour
stream file or user space to MM Minute
which the output of the SS Second
command is directed.
Reserved Reserved. Sequence number. The tape file sequence number to be
used. The default is -1.
The possible value is:
blanks This field should contain The possible values are:
blanks.
Type of output information. -1 The tape volume is searched for the next file
The type of information that should be that contains any of the specified objects.
directed to the spooled file, stream file, or user (*SEARCH)
space specified for the output key. 1-16777215 The sequence number of the file.
The possible values are: System. Whether to process objects that exist on the local
0 The file will contain information system or remote systems. The default is 0.
about the command, and an
entry for each directory. The possible values are:
(*SUMMARY) 0 Only local objects are processed. (*LCL)
1 The file will contain information 1 Only remote objects are processed. (*RMT)
about the command, an entry 2 Both local and remote objects are processed.
for each directory, and an entry (*ALL)
for each object that was not
successfully restored. (*ERR) Volume identifier. The volume identifiers of the volumes, or
2 The file will contain information the cartridge identifier of a tape in a tape media library
about the command, an entry device, from which data is to be restored. The volumes must
for each directory, an entry for be placed in the device in the order specified on this key.
each object that was success- After all specified volumes are filled, the restore operation
fully restored, and an entry for continues on whatever volumes are mounted on the device.
each object that was not suc-
cessfully restored. (*ALL)
Due to the relationship between the QsrRestore API and the Required Parameter Group:
RST command, the following situations should be noted:
1 Receiver variable Output Char(*)
Message text: Several messages produced by this API 2 Length of receiver variable Input Binary(4)
refer to parameters or values of the RST command (for 3 Object name Input Char(*)
example, *SEARCH). To determine which key a given 4 Object name length Input Binary(4)
parameter corresponds to, see “Valid Keys” on 5 Format name Input Char(8)
6 Object type Input Char(10)
page 3-30. To determine which key value a given
7 Error Code I/O Char(*)
parameter value corresponds to, see “Field Descriptions”
on page 3-31.
Command type: The command type listed for the API The Retrieve Backup Detail (QEZRTBKD) API retrieves more
on headings of displays and print files is QsrRestore for detailed information about the library or folder that is to be
integrated file system objects. If QsrRestore is used to backed up.
restore objects in libraries or document library objects
(DLOs), the generated output indicates that the corre-
sponding library or DLO command generated the media. Authorities and Locks
Backup Object *USE
Error Messages
CPF0001 E Error found on &1 command. Required Parameter Group
CPF24B4 E Severe error while addressing parameter list. Receiver variable
CPF3700 E All CPF37xx messages could be signalled. xx OUTPUT; CHAR(*)
is from 01 to FF. The receiver variable that receives the information
CPF3800 E All CPF38xx messages could be signalled. xx requested. You can specify the size of the area to be
is from 01 to FF. smaller than the format requested as long as you specify
CPF3C31 E the length parameter correctly. As a result, the API
Object type &1 is not valid. returns only the data that the area can hold.
CPF3C4D E
Length &1 for key &2 not valid. Length of receiver variable
CPF3C81 E INPUT; BINARY(4)
Value for key &1 not valid. The length of the receiver variable provided. The length
CPF3C82 E of receiver variable parameter may be specified up to
Key &1 not valid for API &2. the size of the receiver variable specified in the user
CPF3C83 E program. If the length of receiver variable parameter
Key &1 not allowed with value specified for key specified is larger than the allocated size of the receiver
&2. variable specified in the user program, the results are
CPF3C84 E not predictable. The minimum length is 8 bytes.
Key &1 required with value specified for key &2.
Object name
CPF3C85 E
INPUT; CHAR(*)
Value for key &1 not allowed with value for key
The name of the object to retrieve backup detail informa-
&2.
tion about. The length of this field is based on the
CPF3C86 E
Object type parameter and the Object name length
Required key &1 not specified.
parameter. Specify either a 10-character library name or
CPF3C87 E
specify a 12-character folder name.
Key &1 allows one value with special value.
CPF3C90 E Object name length
Literal value cannot be changed. INPUT; BINARY(4)
CPF3CF1 E The length of the name of the object to retrieve backup
Error code parameter not valid. detail information about.
CPF5729 E Not able to allocate object &1.
Allowable object name lengths follow:
CPF9800 E All CPF98xx messages could be signaled. xx is
from 01 to FF. 10 The 10-character library name when the Object
CPF9999 E Function check. &1 unmonitored by &2 at state- type parameter is *LIB.
ment &5, instruction &3. 12 The 12-character folder name when the Object
type parameter is *FLR.
RBKH0100 Basic backup status and history. For 100 64 CHAR(6) Last backup time of all
more information, see “RBKH0100 folders (changes only)
Format.” 106 6A CHAR(4) Tape set for folders
RBKH0200 Detailed backup status and information. (changes only)
For more information, see “RBKH0200 110 6E CHAR(7) Last date folders on list
Format” on page 3-40. backed up
Offset Offset
Dec Hex Type Field Dec Hex Type Field
157 9D CHAR(4) Tape set for configuration CHAR(1) Folders saved
data
CHAR(1) User directories saved
161 A1 CHAR(7) Last date calendars backed
CHAR(1) Security data saved
up
CHAR(1) Configuration saved
168 A8 CHAR(6) Last backup time of calen-
dars CHAR(1) Calendars saved
174 AE CHAR(4) Tape set for calendars CHAR(1) Mail saved
178 B2 CHAR(7) Last date mail backed up
185 B9 CHAR(6) Last backup time of mail Field Descriptions
191 BF CHAR(4) Tape set for mail
Some of the fields use a date format (CYYMMDD) as
195 C3 CHAR(7) Last date all user directories
backed up
follows:
202 CA CHAR(6) Last backup time of all user C Century, where 0 indicates years 19xx and 1
directories indicates years 20xx.
YY Year
208 D0 CHAR(4) Tape set for all user directo-
ries backed up MM Month
DD Day
212 D4 CHAR(7) Last date all user directories
backed up (changes only) Some of the fields use a time format (HHMMSS), where:
219 DB CHAR(6) Last backup time of all user HH Hour
directories (changes only)
MM Minute
225 E1 CHAR(4) Tape set for all user directo- SS Second
ries backed up (changes
only) For more information on the following fields, refer to the doc-
229 E5 CHAR(21) Reserved umentation for the Display Backup Status (DSPBCKSTS)
command in the CL Reference (Abridged) manual.
RBKH0200 Format Backup date. The completion date of the backup. This date
is in the format CYYMMDD.
The following table describes the information that is returned
in the receiver variable for the RBKH0200 format. For Backup time. The completion time of the backup. This time
detailed descriptions of the fields, see “Field Descriptions.” is in the format HHMMSS.
0 All objects in the libraries, folders, and directo- Last backup time of configuration. The completion time of
ries were saved during the backup. the most recent backup of the system configuration. This
1 Only changes made to the libraries, folders, uses the 24-hour clock and is in the format HHMMSS.
and directories since the last backup were
saved during the backup. Last backup time of folders on list. The completion time
of the most recent backup of all the objects in all the folders
Configuration saved. Whether the system configuration on the folder backup list. This time uses the 24-hour clock
was saved. and is in the format HHMMSS.
0 The system configuration was not saved Last backup time of libraries on list. The completion time
during the backup. of the most recent backup of all the objects in all the libraries
1 The system configuration was saved during on the library backup list. This time uses the 24-hour clock
the backup. and is in the format HHMMSS.
Folders saved. Which folders were saved during the Last backup time of libraries on list (changes only). The
backup. The possible values follow: completion time of the most recent backup of all the objects
1 Only folders that were selected from the folder in all the libraries on the library backup list that changed
backup list were saved. since the previous backup. This time uses the 24-hour clock
2 All folders were saved. and is in the format HHMMSS.
3 No folders were saved.
Last backup time of security data. The completion time of
Last backup time of calendars. The completion time of the the most recent backup of all the system security data. This
most recent backup of all the calendars for OfficeVision. This uses the 24-hour clock and is in the format HHMMSS.
time uses the 24-hour clock and is in the format HHMMSS.
Last date all folders backed up. The completion date for
Last backup time of mail. The completion time of the most the most recent backup of all the objects in all the root
recent backup of all the mail for OfficeVision. This time uses folders on the system. This date is in the format CYYMMDD.
the 24-hour clock and is in the format HHMMSS.
Last date all folders backed up (changes only). The com-
Last backup time of all folders. The completion time of the pletion date for the most recent backup of all the objects in
most recent backup of all the objects in all the root folders. all the folders that changed since the previous backup. This
This time uses the 24-hour clock and is in the format date is in the format CYYMMDD.
HHMMSS.
Last date all user directories backed up (changes only).
Last backup time of all folders (changes only). The com- The completion date for the most recent backup of all the
pletion time of the most recent backup of all the objects in all objects in all the user directories that changed since the pre-
the root folders that changed since the previous backup. vious backup. This date is in the format CYYMMDD.
This time uses the 24-hour clock and is in the format
HHMMSS. Last date all user directories backed up. The completion
date for the most recent backup of all the objects in all the
Last backup time of all user directories. The completion user directories on the system. This date is in the format
time of the most recent backup of all the objects in all the CYYMMDD.
user directories on the system. This time uses the 24-hour
clock and is in the format HHMMSS. Last date all user libraries backed up. The completion
date for the most recent backup of all the objects in all the
Last backup time of all user directories (changes only). user libraries on the system. This date is in the format
The completion time of the most recent backup of all the CYYMMDD.
objects in all the user directories that changed since the pre-
vious backup. This time uses the 24-hour clock and is in the Last date all user libraries backed up (changes only).
format HHMMSS. The completion date for the most recent backup of all the
objects in all the user libraries that changed since the pre-
Last backup time of all user libraries. The completion vious backup. This date is in the format CYYMMDD.
time of the most recent backup of all the objects in all the
user libraries on the system. This time uses the 24-hour Last date calendars backed up. The completion date for
clock and is in the format HHMMSS. the most recent backup of all the OfficeVision calendars on
the system. This date is in the format CYYMMDD.
Last backup time of all user libraries (changes only).
The completion time of the most recent backup of all the Last date configuration data backed up. The last backup
objects in all the user libraries that changed since the pre- date for the most recent backup of the system configuration.
vious backup. This time uses the 24-hour clock and is in the
Last date folders on list backed up. The completion date
format HHMMSS.
for the most recent backup of all the objects in all the folders
in the folder backup list. This date is in the format the objects in all the user libraries on the system. The pos-
CYYMMDD. sible value follows:
Last date mail backed up. The completion date for the Tape set for calendars. The name of the last tape set that
most recent backup of all the OfficeVision mail on the the system used for the most recent backup of all the calen-
system. This date is in the format CYYMMDD. dars for OfficeVision. The possible value follows:
Last date security data backed up. The last backup date
*ANY The option that the system used for the
backup did not specify a tape set name.
for the most recent backup of system security data.
Tape set for configuration. The name of the last tape set
Length of a backup date entry. The length of one backup
that the system used for the most recent backup of the
date entry.
system configuration. The possible value follows:
Mail saved. Whether mail was saved during the backup. *ANY The option that the system used for the
0 OfficeVision mail was not saved during the backup did not specify a tape set name.
backup.
Tape set for folders. The name of the last tape set that t
1 OfficeVision mail was saved during the
he system used for the most recent backup of all the objects
backup.
in all the root folders on the system. The possible value
Number of backup date entries. The number of backup follows:
date e ntries that are contained in format RBKH0200. *ANY The option that the system used for the
backup did not specify a tape set name.
Reserved. This space is reserved for future use.
Tape set for folders (changes only). The name of the last
Security data saved. Whether the security data was saved.
tape set that the system used for the most recent backup of
0 Security data was not saved during the all the new and changed documents from all the new and
backup. changed root folders since the previous backup. The pos-
1 Security data was saved during the backup. sible value follows:
Tape set. The name of the last tape set that the system
*ANY The option that the system used for the
backup did not specify a tape set name.
used to complete the backup of the information described in
this backup date entry.
Tape set for folders on list. The name of the last tape se t
that the system used for the most recent backup of all the
Tape set for all user directories backed up. The name of
folders that were selected for backup from the folder backup
the last tape set that the system used for the most recent
list. The possible value follows:
backup of all the objects in all the user directories on the
system. The possible value follows: *ANY The option that the system used for the
backup did not specify a tape set name.
*ANY The option that the system used for the
backup did not specify a tape set name.
Tape set for libraries on list. The name of the last tape set
that the system used for the most recent backup of all the
Tape set for all user directories backed up (changes
libraries on the library backup list. The possible value
only). The name of the last tape set that the system used
follows:
for the most recent backup of all the objects in all the user
directories that changed since the previous backup. The *ANY The option that the system used for the
possible value follows: backup did not specify a tape set name.
*ANY The option that the system used for the
Tape set for libraries on list (changes only). The name of
backup did not specify a tape set name.
the last tape set that the system used for the most recent
backup of all the objects in the libraries on the library backup
Tape set for all user libraries. The name of the last tape
list that changed since the previous backup. The possible
set that the system used for the most recent backup of all
value follows:
*ANY The option that the system used for the The Retrieve Backup Options (QEZRTBKO) API returns in a
backup did not specify a tape set name. receiver variable the backup options for the requested
backup type. If you request all options, the receiver variable
Tape set for mail. The name of the last tape set that the contains the header, which is followed by three RBKO0100
system used for the most recent backup of all the mail for formats, one for each backup type.
OfficeVision. The possible value follows:
*ANY The option that the system used for the Authorities and Locks
backup did not specify a tape set name.
User Index Authority
Tape set for security data. The name of the last tape set *USE
that the system used for the most recent backup of the User Index Lock
system security data. The possible value follows: *SHRRD
*ANY The option that the system used for the
backup did not specify a tape set name. Required Parameter Group
User directories saved. The directories that were saved Receiver variable
during the backup. The possible values follow: OUTPUT; CHAR(*)
2 All user directories were saved. The receiver variable that receives the information
3 No user directories were saved. requested. You can specify the size of the area to be
smaller than the format requested as long as you specify
User libraries saved. The libraries that were saved during the length parameter correctly. As a result, the API
the backup. The possible values follow: returns only the data that the area can hold.
1 Only user libraries that were selected from the Length of receiver variable
library backup list were saved. INPUT; BINARY(4)
2 All user libraries were saved.
3 No user libraries were saved. The length of the receiver variable provided. The length
of receiver variable parameter may be specified up to
the size of the receiver variable specified in the user
Error Messages program. If the length of receiver variable parameter
CPF1E00 E All CPF1Exx messages could be returned. xx specified is larger than the allocated size of the receiver
is from 01 to FF. variable specified in the user program, the results are
CPF24B4 E Severe error while addressing parameter list. not predictable. The minimum length is 8 bytes.
CPF3CF1 E Format name
Error code parameter not valid. INPUT; CHAR(8)
CPF3C19 E
Error occurred with receiver variable specified. The format of the backup option descriptions to be
CPF3C21 E returned. The valid format names are RBKO0100 and
Format name &1 is not valid. RBKO0200.
CPF3C24 E RBKO0100 This format returns information about
Length of the receiver variable is not valid. what the user has selected to be saved
CPF3C90 E on the next backup for that type (*DAILY,
Literal value cannot be changed. *WEEKLY, or *MONTHLY).
CPF9872 E Program or service program &1 in library &2 RBKO0200 This format returns information on the last
ended. Reason code &3. backup date and time, and when the next
backup date and time for that backup
option are scheduled to occur.
Retrieve Backup Options (QEZRTBKO) API
Backup option
INPUT; CHAR(10)
Required Parameter Group: The backup options to retrieve. Possible values follow:
Error code
Offset
I/O; CHAR(*)
Dec Hex Type Field
The structure in which to return error information. For
55 37 CHAR(1) Reserved
the format of the structure, see “Error Code Parameter”
on page 2-6. 56 38 BINARY(4) Offset to additional infor-
mation
The offsets to ARRAY OF Backup devices
RBOH0100 Format these fields CHAR(10)
depend on the
ARRAY OF Tape sets to rotate
Offset number of
CHAR(4)
Dec Hex Type Field backup
devices and
0 0 BINARY(4) Bytes returned the number of
4 4 BINARY(4) Bytes available tape sets to
rotate.
8 8 BINARY(4) Offset to daily options
12 C BINARY(4) Offset to weekly options
16 10 BINARY(4) Offset to monthly options RBKO0200 Format
Offset
RBKO0100 Format Dec Hex Type Field
Note: The following is accessed by using the offsets that 0 0 CHAR(*) All data in format
are provided in format RBOH0100. RBKO0100
The offsets to CHAR(7) Last backup date
Offset these fields
CHAR(6) Last backup time
depend on the
Dec Hex Type Field
number of CHAR(7) Next backup date
0 0 BINARY(4) Offset to list of backup backup
CHAR(6) Next backup time
device names devices and
4 4 BINARY(4) Number of backup the number of
devices tape sets to
rotate.
8 8 BINARY(4) Offset to list of tape sets
to rotate
12 C BINARY(4) Number of tape sets to Field Descriptions
rotate
16 10 CHAR(4) Last tape set used Back up configuration data. Whether to save the system
configuration data. Possible values follow:
20 14 CHAR(4) Next tape set to be used
0 Do not save configuration data.
24 18 CHAR(1) Erase tape before backup
1 Save configuration data.
25 19 CHAR(1) Back up user libraries
26 1A CHAR(1) Back up folders
Backup devices. The tape devices that are used for a
backup.
27 1B CHAR(1) Back up user directories
28 1C CHAR(1) Back up security data Back up folders. Which root folders are backed up. Pos-
sible values follow:
29 1D CHAR(1) Back up configuration
data 1 The root folders that are selected for backup
30 1E CHAR(1) Back up OfficeVision mail in the folder backup list are backed up.
2 All root folders are backed up.
31 1F CHAR(1) Back up OfficeVision cal-
3 No root folders are backed up.
endars
32 20 CHAR(1) Submit as batch job Back up OfficeVision calendars. Whether to save
33 21 CHAR(1) Save changed objects OfficeVision calendar data. OfficeVision calendars are also
only saved when QUSRSYS is saved. Possible values follow:
34 22 CHAR(1) Print detailed report 0 Calendars are not saved when the backup is
35 23 CHAR(10) User exit program name
run.
1 Calendars are saved when the backup is run.
45 2D CHAR(10) User exit program library 9 Calendars are not saved when the backup is
name
run because the OfficeVision calendar function
is not available.
Back up OfficeVision mail. Whether to save OfficeVision 2 All user libraries are saved when the backup
mail. The backup ignores this option if FLR(*ALL) is speci- is run.
fied. 3 No user libraries are saved when the backup
is run.
0 Mail is not saved when the backup is run.
1 Mail is saved when the backup is run.
Back up user directories. Whether to save all user directo-
9 Mail is not saved when the backup is run
ries. This does not include any IBM-supplied directories that
because the OfficeVision mail function is not
contain user data. Some directories that are not saved
available.
include QOPT, QFileSvr.400, QSYS.LIB, and QDLS (QDLS
data is saved under the option to save folders). Possible
Back up security data. Whether to save the system secu-
values follow:
rity data. Possible values follow:
0 Security data is not saved when the backup is
2 All user directories are saved when the
backup is run.
run.
1 Security data is saved when the backup is
3 Do not back up any user directories.
run.
Bytes available. The number of bytes of data available to
be returned. All available data is returned if enough space is
Back up user libraries. Which user libraries are saved
provided.
when a backup is run. All libraries with names that do not
begin with the letter Q are backed up except for the fol-
Bytes returned. The number of bytes of data returned.
lowing:
#CGULIB Erase tape before backup. Whether to clear the tape and
start the save operation at sequence number 1. Possible
#COBLIB
values follow:
#DFULIB
0 The save operation continues at the next
#DSULIB available sequence number.
#RPGLIB
1 The tape is cleared, and the save operation
starts at sequence number 1.
#SDALIB
Last backup date. The completion date of the last Opera-
#SEULIB
tional Assistant backup in CYYMMDD format.
Although IBM provides the following Qxxx libraries, the
Last backup time. The completion time of the last Opera-
libraries typically contain user data that changes frequently.
tional Assistant backup in HHMMSS format.
Therefore, these libraries are considered user libraries and
are also backed up: Last tape set used. The tape set that was used to com-
QDSNX plete the last Operational Assistant backup.
QGPL Next backup date. The next date that an Operational
QGPL38 Assistant backup is run in CYYMMDD format.
QPFRDATA Next backup time. The time of the next scheduled backup.
QRCL This time is in the format HHMMSS and uses the 24-hour
clock.
QS36F
QUSER38 Next tape set to be used. The tape set that is used to start
the next backup.
QUSRINFSKR
QUSRSYS Number of backup devices. The number of backup
devices that are defined as available for use in an Opera-
QUSRVxRxMx
tional Assistant backup.
The user can create a different library name, of the form
QUSRVxRxMx, for each release that IBM supports. Number of tape sets to rotate. The number of tape sets
VxRxMx is the version, release, and modification level of that are defined to be used in a backup.
the library.
Offset to additional information. The offset from the start
Possible values follow: of format RBOH0100 to the last backup date field.
1 The objects in the libraries that are selected
Offset to daily options. The offset from the start of the
for backup from the library backup list are
RBOH0100 structure to the backup options.
backed up.
Offset to list of backup device names. The offset from the CPF3C21 E
start of the RBOH0100 structure to the list of device names. Format name &1 is not valid.
This list is defined by the user to be used during an Opera- CPF3C24 E
tional Assistant backup. Length of the receiver variable is not valid.
CPF3C90 E
Offset to list of tape sets to rotate. The offset from the Literal value cannot be changed.
start of the RBOH0100 structure to the list of tape sets to be CPF3CF1 E
used in an Operational Assistant backup. Error code parameter not valid.
CPF9820 E Not authorized to use library &1.
Offset to monthly options. The offset from the start of the
CPF9872 E Program or service program &1 in library &2
RBOH0100 structure to the monthly backup options.
ended. Reason code &3.
Offset to weekly options. The offset from the start of the
RBOH0100 structure to the weekly backup options.
Retrieve Backup Schedule (QEZRTBKS)
Print detailed reports. Whether each save command that API
supports OUTPUT(*PRINT) generates a detailed list of the
objects that were saved in addition to a summary report.
Possible values follow: Required Parameter Group:
0 Only a summary report is generated from the
1 Receiver variable Output Char(*)
backup. A detailed report is not generated.
2 Length of receiver variable Input Binary(4)
1 A detailed list of saved objects is printed. A 3 Format name Input Char(8)
summary report is always printed. 4 Error Code I/O Char(*)
variable specified in the user program, the results are Bytes available. The number of bytes of data available to
not predictable. The minimum length is 8 bytes. be returned. All available data is returned if enough space is
provided.
Format name
INPUT; CHAR(8) Bytes returned. The number of bytes of data returned.
The name of the format in which to return the backup
Friday backup. The type of backup that is run on Friday.
schedule. The following format name may be used:
Possible values follow:
RBKS0100 Basic schedule information. For more
blank No backup is scheduled for this day of the
information, see “RBKS0100 Format.”
week.
Error code 1 A daily backup is run on this day.
I/O; CHAR(*) 2 A weekly backup is run on this day.
3 A monthly backup is run on this day.
The structure in which to return error information. For
4 A *WEEKMONTH backup is run on this day. A
the format of the structure, see “Error Code Parameter”
weekly backup is run on this day of the week
on page 2-6.
every week except on the week that a monthly
backup is run. In that case, the monthly
RBKS0100 Format
backup is run.
Offset Friday backup time. Using the 24-hour clock, the time that
Dec Hex Type Field the backup takes place (in format HHMMSS).
0 0 BINARY(4) Bytes returned
Hours before backup to send tape message. If you
4 4 BINARY(4) Bytes available choose, you may have the system send a reminder to the
8 8 BINARY(4) Hours before backup to system operator to load the tape before a backup starts.
send tape message Specify the number of hours before the backup that you
would like this message to be sent. Possible values follow:
12 C BINARY(4) Occurrence in month to run
backup 0 No message is sent to the system operator
16 10 CHAR(1) Run backup using this before the backup.
schedule 1-24 The number of hours prior to backup to send
the message.
17 11 CHAR(1) Sunday backup
18 12 CHAR(6) Sunday backup time Monday backup. The type of backup that is run on
24 18 CHAR(1) Monday backup Monday. Possible values follow:
25 19 CHAR(6) Monday backup time blank No backup is scheduled for this day of the
week.
31 1F CHAR(1) Tuesday backup
1 A daily backup is run on this day.
32 20 CHAR(6) Tuesday backup time 2 A weekly backup is run on this day.
38 26 CHAR(1) Wednesday backup 3 A monthly backup is run on this day.
39 27 CHAR(6) Wednesday backup time
4 A *WEEKMONTH backup is run on this day.
A weekly backup is run on this day of the
45 2D CHAR(1) Thursday backup week every week except on the week that a
46 2E CHAR(6) Thursday backup time monthly backup is run. In that case, the
52 34 CHAR(1) Friday backup monthly backup is run.
53 35 CHAR(6) Friday backup time Monday backup time. Using the 24-hour clock, the time
59 3B CHAR(1) Saturday backup that the backup takes place (in format HHMMSS).
60 3C CHAR(6) Saturday backup time
Occurrence in month to run backup. The week of the
month that you want the backup to occur when the backup
type is either *MONTHLY or *WEEKMONTH. Possible
Field Descriptions values follow:
Some of the fields use a time format (HHMMSS), where: 0 No monthly backup is scheduled to run.
HH Hour 1–4 A value 1 through 4 corresponds to the week
MM Minute of the month that the monthly backup is run.
SS Second 5 The monthly backup is run on the last week of
the month.
0 A schedule has been created, but it is not blank No backup is scheduled for this day of the
being used at this time. week.
1 Backups are run according to the schedule. 1 A daily backup is run on this day.
2 A weekly backup is run on this day.
Saturday backup. The type of backup that is to run on Sat- 3 A monthly backup is run on this day.
urday. Possible values follow: 4 A *WEEKMONTH backup is run on this day.
blank No backup is scheduled for this day of the A weekly backup is run on this day of the
week. week every week except on the week that a
1 A daily backup is run on this day. monthly backup is run. In that case, the
2 A weekly backup is run on this day. monthly backup is run.
3 A monthly backup is run on this day.
Tuesday backup time. Using the 24-hour clock, the time
4 A *WEEKMONTH backup is run on this day.
that the backup takes place (in format HHMMSS).
A weekly backup is run on this day of the
week every week except on the week that a
Wednesday backup. The type of backup that is run on
monthly backup is run. In that case, the
Wednesday. Possible values follow:
monthly backup is run.
blank No backup is scheduled for this day of the
Saturday backup time. Using the 24-hour clock, the time week.
that the backup takes place (in HHMMSS). 1 A daily backup is run on this day.
2 A weekly backup is run on this day.
Sunday backup. The type of backup that is to be run on 3 A monthly backup is run on this day.
Sunday. Possible values follow: 4 A *WEEKMONTH backup is run on this day. A
blank No backup is scheduled for this day of the weekly backup is run on this day of the week
week. every week except on the week that a monthly
1 A daily backup is run on this day. backup is run. In that case, the monthly
2 A weekly backup is run on this day. backup is run.
3 A monthly backup is run on this day.
Wednesday backup time. Using the 24-hour clock, the time
4 A *WEEKMONTH backup is run on this day. A
that the backup takes place (in format HHMMSS).
weekly backup is run on this day of the week
every week except on the week that a monthly
backup is run. In that case, the monthly Error Messages
backup is run.
CPF1629 E Not authorized to job schedule &1.
Sunday backup time. Using the 24-hour clock, the time CPF1632 E Job schedule entry &3 number &4 damaged.
that the backup takes place (in format HHMMSS). CPF1637 E Job schedule &1 in library &2 in use.
CPF1640 E Job schedule &1 in library &2 does not exist.
Thursday backup. The type of backup that is run on CPF1641 E Job schedule &1 in library &2 damaged.
Thursday. Possible values follow: CPF24B4 E Severe error while addressing parameter list.
CPF3CF1 E
blank No backup is scheduled for this day of the
Error code parameter not valid.
week.
CPF3C21 E
1 A daily backup is run on this day.
Format name &1 is not valid.
2 A weekly backup is run on this day.
CPF3C90 E
3 A monthly backup is run on this day.
Literal value cannot be changed.
4 A *WEEKMONTH backup is run on this day. A
CPF812C E
weekly backup is run on this day of the week
Job schedule &4 in &9 damaged.
every week except on the week that a monthly
CPF9802 E Not authorized to object &2 in &3.
backup is run. In that case, the monthly
CPF9803 E Cannot allocate object &2 in library &3.
backup is run.
CPF9820 E Not authorized to use library &1.
Thursday backup time. Using the 24-hour clock, the time CPF9872 E Program or service program &1 in library &2
that the backup takes place (in format HHMMSS). ended. Reason code &3.
Resources to list
The Retrieve Device Capabilities (QTARDCAP) API retrieves INPUT; CHAR(1)
information that is associated with a specified tape device Which media library device resources are listed if the
description or tape resource name. The resource that is device description indicator in the device description or
specified or associated with the specified device description resource indicator parameter is *DEVD. This parameter
must currently exist on the system. is blank if the device requested is not a media library
device description. If a media library device description
The QTARDCAP API currently supports the following device
is specified, the possible values are as follows:
types:
Tape (TAP) devices 1 All resources are listed (*ALL).
2 Allocated resources are listed (*ALLO-
Tape media library (TAPMLB) devices CATED).
3 Unprotected resources are listed
Authorities and Locks (*UNPROTECTED).
4 Deallocated resources are listed (*DEAL-
Device Description Authority LOCATED).
*READ 5 Both allocated and unprotected resources
are listed (*AVAILABLE).
Required Parameter Group blank The requested input device or resource is
not a media library device, not a device
Receiver variable description, or the information is not
OUTPUT; CHAR(*) requested.
The receiver variable that receives the information Error code
requested. You can specify the size of the area to be I/O; CHAR(*)
smaller than the format requested as long as you specify
the length parameter correctly. As a result, the API The structure in which to return error information. For
returns only the data that the area can hold. the format of the structure, see “Error Code Parameter”
on page 2-6.
Length of receiver variable
INPUT; BINARY(4)
TAPE0100 Format
The length of the receiver variable provided. The length
of receiver variable parameter may be specified up to The following table shows the information that is returned for
the size of the receiver variable specified in the user the TAPE0100 format. For more details about the fields in
program. If the length of receiver variable parameter the following table, see “Field Descriptions” on page 3-51.
specified is larger than the allocated size of the receiver
variable specified in the user program, the results are Offset
not predictable. The minimum length is 8 bytes.
Dec Hex Type Field
Format name 0 0 BINARY(4) Bytes returned
INPUT; CHAR(8)
4 4 BINARY(4) Bytes available
The content and format of the information being
8 8 CHAR(10) Device description or
returned. The TAPE0100 format must be used for the resource name
tape device capabilities information. See “TAPE0100
Format” to view the information returned for this format. 18 12 CHAR(10) Device description or
resource indicator
Offset Offset
Dec Hex Type Field Dec Hex Type Field
28 1C CHAR(10) Device resource name 103 67 CHAR(2) Bit mapping of the highest
supported density
38 26 CHAR(3) Reserved
105 69 CHAR(1) Reserved
41 29 CHAR(1) Device relationship to media
library device 106 6A CHAR(2) Bit mapping of all supported
character densities
42 2A CHAR(1) Type of media library device
108 6C BINARY(4) Offset to supported char-
43 2B CHAR(1) Intelligent tape device
acter densities
44 2C CHAR(4) Device type
112 70 BINARY(4) Number of supported char-
48 30 CHAR(4) Device model acter densities
52 34 BINARY(4) Maximum block size 116 74 BINARY(4) Offset to resource list
56 38 CHAR(1) Logical-block-ID capability 120 78 BINARY(4) Number of resources in
resource list
57 39 CHAR(1) Assign capability
124 7C BINARY(4) Offset to resource status list
58 3A CHAR(1) Overwrite capability
128 80 BINARY(4) Number of resource status
59 3B CHAR(1) Read-backward capability
list entries
60 3C CHAR(1) Cartridge-checking capa-
132 84 CHAR(1) Reserved
bility
61 3D CHAR(1) Device class
| 133 85 CHAR(1) QTACTLDV API supported
134 86 CHAR(1) Media library device with
62 3E CHAR(1) Hardware data compression
door
capability
135 87 CHAR(5) Reserved
63 3F CHAR(1) Label compaction supported
140 8C BINARY(4) Offset to density capability
64 40 BINARY(4) Offset to supported write
entries
densities
144 90 BINARY(4) Number of density capability
68 44 BINARY(4) Number of supported write
entries
densities
148 94 BINARY(4) Length of density capability
72 48 BINARY(4) Offset to supported read
entries
densities
152 98 BINARY(4) Offset to system feature
76 4C BINARY(4) Number of supported read
codes
densities
156 9C BINARY(4) Length of system feature
80 50 BINARY(4) Offset to supported
codes
improved-data-recording-
capability (IDRC) densities 160 A0 BINARY(4) Acceptable read error
thresholds
84 54 BINARY(4) Number of supported
improved-data-recording- 164 A4 BINARY(4) Acceptable write error
capability (IDRC) densities thresholds
88 58 BINARY(4) Optimum block size 168 A8 BINARY(4) Instantaneous performance
92 5C CHAR(1) Space to end of data | 172 AC BINARY(4) Offset to slot and station
93 5D CHAR(1) Space backward allowed
| information
176 B0 BINARY4) Offset to device text
94 5E CHAR(1) Media library device with
bar-code scanner 180 B4 BINARY4) Length of device text
95 5F CHAR(1) Improved-data-recording- 184 B8 ARRAY(*) of Supported improved-data-
capability (IDRC) supported CHAR(10) recording-capability (IDRC)
densities
96 60 CHAR(1) Automatic cartridge mech-
anism supported ARRAY(*) of Supported write densities
CHAR(10)
97 61 CHAR(2) Bit mapping of all supported
improved-data-recording- ARRAY(*) of Supported read densities
capability (IDRC) densities CHAR(10)
99 63 CHAR(2) Bit mapping of all supported ARRAY(*) of Supported character densi-
write densities CHAR(10) ties
101 65 CHAR(2) Bit mapping of all supported ARRAY(*) of Resource list
read densities CHAR(10)
Bit mapping of all supported write densities. A bit- *RSRC The name specified is a device resource
mapped encoding of densities that correspond to the sup- name.
ported write densities. This field is not available for a media
library device. The definition of example bit maps can be Device description or resource name. The device descrip-
found in the bit mapping of all supported character densities tion or resource name of the device.
field.
Device relationship to media library device. The relation-
Bytes available. The number of bytes of data available to ship of the device or resource to the media library device.
be returned. All available data is returned if enough space is Possible values follow:
provided. 0 The device is not a media library resource.
1 The device is a tape resource in a media
Bytes returned. The number of bytes of data returned.
library resource.
Cartridge-checking capability. Whether the device com-
2 The device is a media library resource.
municates valid cartridge densities or formats. This capa-
Device model. The device model number.
bility allows OS/400 to verify cartridge density or formats.
Devices that do not support this capability cannot send intelli- Device resource name. The resource name if the device
gent messages about the cartridge. When the device is information is for a device description.
unable to write to the cartridge, a generic error message
usually results. It could be as simple as a cartridge not sup- Device text. The specific text that is reported by the device.
ported by the device. Possible values follow:
Device type. The device type number.
0 No device or resource that is requested has
special cartridge-density checking capabilities. Hardware data compression capability. Whether hard-
1 The device requested has special cartridge- ware data compression (HDC) is supported. This field corre-
density checking capabilities. sponds to the data compression (DTACPR) parameter on
blank This is not an available value for a media save commands. Possible values follow:
library device.
0 No device or resource that is requested has
Device class. The class of the device. Possible values hardware data compression capabilities.
follow: 1 The device that is requested has hardware
data compression capabilities.
1 1/2-inch reel technology
blank This is not an available value for a media
2 1/2-inch cartridge technology
library device.
3 1/4-inch cartridge technology
4 8-mm technology Improved-data-recording-capability (IDRC) supported.
blank None of the above technologies or media Whether the device supports IDRC (or compaction) at any
library device density. If IDRC is supported, see the supported IDRC den-
sities field. Possible values follow:
Density capability entries. The list of density capabilities
based on density, format, or both. Each entry consists of the 0 No device or resource that is requested has
following format and has a length that is specified in the IDRC capabilities.
length of density capability entry field. 1 The device that is requested has IDRC capa-
bilities.
CHAR(10) Density or format
blank This is not an available value for a media
CHAR(2) Bit map representation of density
library device.
BINARY(4) Instantaneous performance in megabytes per
second for this density or format. One MB per Instantaneous performance. The highest instantaneous
second is returned for each field if the perfor- performance that is reported by the device. This value can
mance number is not reported by the device. be obtained from the density capability entries list on a
BINARY(4) Maximum block size for this density or format. density, format, or both. This value is the highest perfor-
BINARY(4) Optimum block size for this density or format. mance number that is specified in the density capability
This format is repeated once for each density or format that entries list. The value is in megabytes per second. If the
is supported by the device. The number of entries in the device does not report this value, a value of 1 MB per
array is specified in the number of density capability entries second will be used. This is not an available value for a
field. This field is not available for a media library device. media library device and is set to zero for media library
devices.
Device description or resource indicator. Whether the
information is retrieved for a device description or a device Intelligent tape device. Whether this resource or device is
resource name. This field is left-justified. Possible values an intelligent tape device. Possible values follow:
follow: 0 The device is not an intelligent tape device.
*DEVD The name specified is a device description. 1 The device is an intelligent tape device.
Label compaction supported. Whether the device volumes Media library device with door. Whether the media library
are written with compacted labels. Possible values follow: device has a door that can be opened. Possible values
follow:
0 The device does not generate labels with
compaction. 0 The device does not have a door.
1 The device generates labels with compaction 1 The device has a door.
if compaction is requested. blank This field is only valid for a media library
device.
Length of density capability entry. The length, in bytes, of
each entry in the density capability entries list. This field Number of density capability entries. The number of
should be used in stepping through the array of density density capability entries in the density capability entries list.
capability entries. Additional fields for each density or format This field is not available for a media library device and is set
in the density capability entries list may be added at any to zero when the input device is a media library device.
time.
Number of resources in resource list. The number of
Length of device text. The length, in bytes, of text that is resources that are listed in the resource list. This number is
reported by the device. If the device does not report specific set to zero when the input device is not a media library
text about the device, zero is returned. device description (*DEVD).
Length of system feature codes. The length, in bytes, of Number of resource status list entries. The number of
the system feature codes entry. This field should be used in resource status entries for the resource status list. This
determining the system feature codes (type and model) of number is set to zero when the input device is not a media
the device. If the device does not report this information, zero library device description (*DEVD).
is returned.
Number of supported improved-data-recording-capability
Logical-block-ID capability. Whether the device allows fast (IDRC) densities. The number of supported IDRC (or com-
access capabilities. This allows logical-block-identifier paction) densities that are specified in the supported IDRC
support through a tape management system that is regis- densities field. This field is not available for a media library
tered with the registration facility and used in combination device and is set to zero when the input device is a media
with the Media and Storage Extensions feature of OS/400. library device.
Possible values follow:
Number of supported character densities. The number of
0 No device or resource that is requested has
supported character densities that are specified in the sup-
fast access by logical-block-identifier capabili-
ported character densities field. This field is not available for
ties.
a media library device and is set to zero when the input
1 The device that is requested has fast access
device is a media library device.
by logical-block-identifier capabilities.
blank This is not an available value for a media Number of supported read densities. The number of sup-
library device. ported read densities that are specified in the supported read
densities field. This field is not available for a media library
Maximum block size. The highest maximum block size that
device and is set to zero when the input device is a media
is supported by the device. If you use the maximum block
library device.
size, tapes may be created that are not compatible with other
device types. A tape that is created with a maximum block Number of supported write densities. The number of sup-
size can only be duplicated with the Duplicate Tape ported write densities that are specified in the supported
(DUPTAP) command to devices that support the same block write densities field. This field is not available for a media
size. This field is not available for a media library device and library device and is set to zero when the input device is a
is set to zero for media library devices. media library device.
The maximum block size that a device supports may vary Offset to density capability entries. The offset, in bytes, to
with density. Use the Density capability entries to determine the density capability entries list.
the maximum block size for a specific density.
Offset to device text. The offset, in bytes, to the text that is
Media library device with bar-code scanner. Whether the reported by the device.
device has a bar-code scanner, which is for a media library
device. Possible values follow: Offset to resource list. The offset, in bytes, to the resource
list.
0 The device has no bar-code scanner.
1 The device has a bar-code scanner. Offset to resource status list. The offset, in bytes, to the
blank This field is only valid for a media library resource status list field.
device.
| Offset to slot and station information. The offset, in
| bytes, to the slot and station information field.
Offset to supported character densities. The offset, in blank This is not an available value for a media
bytes, to the supported character densities field. library device.
1 The device that is requested has space- Supported read densities. The list of valid read densities
backward capabilities. that are supported by this device.
blank This is not an available value for a media
Note: The data is an array of 10-byte entries. Each entry
library device.
consists of a 10-byte density that is left-justified and padded
with blanks. The number of entries in the array is specified
Space to end of data. The function that allows quick
in the number of supported read densities field. This field is
access to the end of the logical tape when a command spec-
not available for a media library device.
ifies SEQNBR(*END), such as the Save Library (SAVLIB)
command. This function allows a significant improvement on
Supported write densities. The list of valid write densities
performance when the tape is positioned at the beginning of
that are supported by this device.
the tape and needs to be positioned a long way into the
tape. If the device does not support this function, OS/400 Note: The data is an array of 10-byte entries. Each entry
spaces by the file marks until the end of data is reached. consists of a 10-byte density that is left-justified and padded
Possible values follow: with blanks. The number of entries in the array is specified
in the number of supported write densities field. This field is
0 No device or resource that is requested has
not available for a media library device.
space to end of data capabilities.
1 The device that is requested has space to end Type of media library device. The media library tech-
of data capabilities. nology. Possible values follow:
blank This is not an available value for a media
library device.
0 The device is not a media library device.
1 Library commands are communicated to the
Supported improved-data-recording-capability (IDRC) library robotic device.
densities. The list of densities that support IDRC (or com- 2 Library commands are communicated to a
paction) on this device. communications line.
3 Library commands are communicated to the
Note: The data is an array of 10-byte entries. Each entry
library robotic device and the device.
consists of a 10-byte density that is left-justified and padded
with blanks. The number of entries in the array is specified in
the number of supported improved-data-recording-capability Error Messages
(IDRC) densities field. This field is not available for a media CPF3C90 E
library device. Literal value cannot be changed.
CPF6707 E Format name &1 not valid.
System feature codes. The system feature codes (type and
CPF6708 E Command ended due to error.
model) that the device reports. The first 4 bytes of the
CPF6709 E Parameter &3 not correct.
system feature codes field displays which feature codes are
CPF6710 E Specified length not correct.
available or reported by the device. The 32 bits of the 4
CPF6721 E Device &1 not a tape device.
bytes are defined as follows:
CPF672F E Resource &1 not found.
Bit 0 AS/400 default feature code provided CPF673F E Device &1 does not support &2.
Bit 1-31 Not used CPF9814 E Device &1 not found.
CPF9825 E Not authorized to device &1.
Each bit that is identified in the 32 bits as defined above is CPF9872 E Program or service program &1 in library &2
represented with 4 bytes of device type and model in ended. Reason code &3.
hexadecimal representation. These 4 bytes are repeated for
each bit that is turned on in the first 4 bytes of the system
feature codes field. The length of this field determines how
much information is returned from the device and is con-
Retrieve Device Information (QTARDINF)
tained in the length of system feature codes. The length of API
this field includes the first 4 bytes of bit definitions. That is, if
only bit 0 is on, then the length of the field is 8 bytes, which
includes the 4 bytes of bit definition and the 4 bytes of the Required Parameter Group:
one system feature code.
1 Receiver variable Output Char(*)
Supported character densities. The list of densities that 2 Length of receiver variable Input Binary(4)
3 Device Input Char(10)
are supported on this device.
4 Format name Input Char(8)
Note: The data is an array of 10-byte entries. Each entry 5 Error code I/O Char(*)
consists of a 10-byte density that is left-justified and padded
with blanks. The number of entries in the array is specified Threadsafe: No
in the number of supported character densities field. This
field is not available for a media library device.
Specifically, it retrieves information about the current status 0 0 BINARY(4) Bytes returned
and mode of the specified device. The device must be 4 4 BINARY(4) Bytes available
varied on at run time of the API.
8 8 BINARY(4) Number of active jobs
The format name RJMA0100 is the only valid format 16 10 BINARY(4) Length of a device entry
name used by this API. For more information, see 20 14 CHAR(12) Reserved
“RJMA0100 Format.” Offsets vary. CHAR(10) Media library device
These fields
Qualified job name CHAR(6) Reserved
repeat in the
INPUT; CHAR(26) order listed, BINARY(4) Resource allocation pri-
The name of the job for which information is to be for each ority
returned. The qualified job name has three parts: media library
BINARY(4) Wait time for initial mount
device that
Job name CHAR(10). A specific job name or the has attributes BINARY(4) Wait time for end of
following special value: defined. volume mount
CHAR(4) Reserved
Field Descriptions Wait time for initial mount. The maximum amount of time,
in minutes, a request will wait for the allocation of a tape
Bytes available. The number of bytes of data available to resource to mount the first volume.
be returned. All available data is returned if enough space is
provided. Exceptions:
Value of -2 implies *DEV. The initial mount wait time
Bytes returned. The number of bytes of data returned. specified in the device description will be used.
Length of a device entry. The length, in bytes, of a device Value of -8 implies *NOMAX. The specified job will wait
entry. A value of zero is returned if the list is empty. until a resource becomes available.
Value of -31 implies *JOB. The specified job's default
Media library device. The name of the media library device
wait time will be used to calculate the wait time. The
that the attributes apply to. The special value supported is:
time is calculated by rounding the default wait time, in
*DEFAULT The attributes apply to all media libraries that seconds, to the next highest minute.
do not have attributes defined.
Value of -32 implies *IMMED. The specified job will not
Number of device entries. The number of entries in the wait for a resource to become available.
device list returned for this format. A value of zero is
returned if the list is empty. Error Messages
Offset to the list of device entries. The offset, in bytes, to CPF1343 E Job &3/&2/&1 not valid job type for function.
the list of device entries returned with this format. A value of CPF136A E Job &3/&2/&1 not active.
zero is returned if the list is empty. CPF24B4 E Severe error while addressing parameter list.
CPF3C19 E
Reserved. All reserved fields will contain hexadecimal Error occurred with receiver variable specified.
zeros. CPF3C21 E
Format name &1 is not valid.
Resource allocation priority. The priority that the specified CPF3C24 E
job will be given when the job requests a tape resource Length of the receiver variable is not valid.
within a media library device. CPF3C51 E
Internal job identifier not valid.
Exceptions:
CPF3C52 E
Value of -2 implies *DEV. The priority specified in the Internal job identifier no longer valid.
device description will be used when the job requests a CPF3C53 E
tape resource. Job &3/&2/&1 not found.
Value of -31 implies *JOB. The specified job's run-time CPF3C54 E
priority will be used for the resource allocation priority Job &3/&2/&1 currently not available.
when the job requests a tape resource. CPF3C55 E
Job &3/&2/&1 does not exist.
Wait time for end of volume mount. The maximum CPF3C58 E
amount of time, in minutes, a request will wait for the allo- Job name specified is not valid.
cation of a tape resource to mount the next volume after the CPF3C59 E
end of volume is reached. Internal identifier is not blanks and job name is
not *INT.
Exceptions: CPF3C90 E
Value of -2 implies *DEV. The end of volume mount Literal value cannot be changed.
wait time specified in the device description will be used. CPF3CF1 E
Error code parameter not valid.
Value of -8 implies *NOMAX. The specified job will wait CPF6708 E Command ended due to error.
until a resource becomes available. CPF67B6 E &3/&2/&1 not authorized to do requested opera-
Value of -31 implies *JOB. The specified job's default tion.
wait time will be used to calculate the wait time. The CPF9872 E Program or service program &1 in library &2
time is calculated by rounding the default wait time, in ended. Reason code &3.
seconds, to the next highest minute.
Value of -32 implies *IMMED. The specified job will not
wait for a resource to become available. | Retrieve Media Definition (QSRRTVMD,
| QsrRetrieveMediaDefinition) API
| *CURLIB The job’s current library is used to locate | Field Descriptions for Receiver Variable
| the media definition. If no library is speci-
| fied as the current library for the job, the | Bytes available. The number of bytes available to be
| QGPL library is used. | returned. All available data is returned if enough space is
| *LIBL The library list is used to locate the media | provided.
| definition.
| Bytes returned. The number of bytes of data returned. If
| Receiver variable | this is less than the bytes available, the information returned
| OUTPUT; CHAR(*) | is not complete.
| The variable that is to hold all the information defining
| the use of multiple tape files for a save or restore opera- | Device definitions. A description of the devices to be used.
| tion. See “Format of Receiver Variable” for the format of | See “Device Definition Format” on page 3-60 for the format
| the information. | of a device definition.
| additional volume. The possible value for a volume identifier Locking See the Backup and Recovery book for
| is: information on object locking for the Save
Object (SAV) command.
| Volume identifier
| The identifier of a volume.
Authority In the Security – Reference book, see the
appendix about authorities required for the
Save Object (SAV) command.
| Error Messages
| CPF24B4 E Severe error while addressing parameter list. Required Parameter Group
| CPF3C19 E
| Error occurred with receiver variable specified. Qualified user space name
| CPF3C21 E INPUT; CHAR(20)
| Format name &1 is not valid. The user space that is to hold all the information for the
| CPF3C24 E save operation. The first 10 characters contain the user
| Length of the receiver variable is not valid. space name. The second 10 characters contain the
| CPF3C3C E name of the library where the user space is located.
| Value for parameter &1 not valid. See “User Space Format” for the format of the informa-
| CPF3C90 E tion in the user space.
| Literal value cannot be changed. You can use the following special values for the library
| CPF3CF1 E name. However, it should be noted that the library
| Error code parameter not valid. name that is actually used is not passed back to the
| CPF9800 E All CPF98xx messages could be signaled. xx is user. Care should be taken when you use these special
| from 01 to FF. values to avoid unexpected results.
| CPF9999 E Function check. &1 unmonitored by &2 at state-
| ment &5, instruction &3. *CURLIB The job’s current library is used to locate
the user space. If no library is specified
as the current library for the job, the
QGPL library is used.
Save Object (QsrSave) API
*LIBL The library list is used to locate the user
space.
Required Parameter Group: Error code
I/O; CHAR(*)
1 Qualified user space Input Char(20)
name The structure in which to return error information. For
2 Error code I/O Char(*) the format of the structure, see “Error Code Parameter”
on page 2-6.
Service Program: QSRLIB01
If the length of the data is longer than the key identifier's data
Key Type Field SAV Command
length, the data will be truncated at the right. No message Parameter
will be issued.
3 CHAR(1) Directory SUBTREE
If the specified data length is shorter than the key field's subtree
defined data length, an error message is returned for binary 4 CHAR(1) System SYSTEM
fields. If the field is a character field, the data is padded with 5 CHAR(40) Change period CHGPERIOD
blanks and an error message will not be returned.
6 CHAR(1) Object precheck PRECHK
Note: This does not apply to keys that allow a list of values
7 CHAR(10) Target release TGTRLS
to be specified. In these cases, the amount of data read is
based on the specified number of entries in the list. 8 CHAR(*) Update history UPDHST
9 CHAR(*) Volume identi- VOL
If keys are duplicated in the user space, only the last value fier
for a given key is used for the save operation.
10 CHAR(*) Label LABEL
Each variable length record must be 4-byte aligned. If not, 11 BINARY(4) Sequence SEQNBR
unpredictable results may occur. number
12 CHAR(7) Expiration date EXPDATE
Field Descriptions 13 CHAR(1) End of tape ENDOPT
option
Data. The data used to specify the value for the given key. 14 CHAR(1) Clear CLEAR
Key. The parameter of the Save Object (SAV) command to 15 CHAR(1) Data com- DTACPR
specify. See “Valid Keys” for the list of valid keys. pression
16 CHAR(1) Data com- COMPACT
Offset to first record. The offset from the beginning of the paction
user space to the first variable length record.
17 CHAR(*) Optical file OPTFILE
Offset to next record. The offset from the beginning of the 18 CHAR(1) Save while SAVACT
user space to the next variable length record. active
19 CHAR(*) Save-while- SAVACTMSGQ
Number of variable length records. The number of vari- active message
| able length records that are passed in the user space. The queue
| valid range is from 2 through 22.
20 CHAR(*) Output OUTPUT, INFTYPE
Reserved. An ignored field. 21 CHAR(1) Use optimum USEOPTBLK
block size
| 22 CHAR(1) Save-while- SAVACTOPT
Valid Keys | active option
The following table lists the valid keys for the key field area
of the variable length record. For detailed descriptions of
the keys, see the “Field Descriptions.” Field Descriptions
Some messages for this API refer to parameters and values The values shown in parentheses are the corresponding
of the Save Object (SAV) command. This table can also be values for the SAV command parameters.
used to locate the key names that correspond to the SAV
Change period. A date and time range. Objects that
command parameters. The field descriptions contain, in
changed within the range are saved.
addition to detailed descriptions, the corresponding param-
eter values. If this key is not specified, the default of *ALL will be used for
the start date and time and the end date and time.
The object path name key and the device path name key are
required keys. The other keys are optional.
Offset
End date. The date before which objects that have start-date The date after which objects
changed are saved. that have changed are saved in
the format CYYMMDD:
The possible values are:
*ALL No ending date is specified. All
C Century, where
0 indicates years
objects changed since the
19xx and 1 indi-
starting date are saved.
cates years
end-date The date before which objects
20xx.
that have changed are saved in
the format CYYMMDD:
YY Year
C Century, where
MM Month
0 indicates years
DD Day
19xx and 1 indi-
Start time. The time on the start date after which objects
that have changed are saved.
cates years
20xx. The possible values are:
YY Year *ALL All times of day are included in
MM Month the range.
DD Day start-time The time on the start date after
End time. The time on the end date before which objects which objects that have
that have changed are saved. changed are saved in the
format HHMMSS:
The possible values are:
*ALL All times of day are included in
HH Hour
the range.
MM Minute
end-time The time on the end date
SS Second
before which objects that have Note: An explicit time is valid
changed are saved in the only if the starting date is an
format HHMMSS: explicit date.
HH Hour
MM Minute Clear. Whether tapes, diskettes, optical volumes, or save
SS Second files that contain active data and are encountered during the
save operation are automatically cleared. An uncleared tape,
Note: An explicit time is valid
diskette, or optical volume is one that contains a file with an
only if the ending date is an
expiration date later than the date of the save operation
explicit date.
(including files protected permanently with a permanent expi-
Start date. The date after which objects that have
ration date). The default is 0.
changed are saved.
The possible values are: Notes:
*ALL No starting date is specified. a. This key does not control initializing tapes or
All objects changed prior to the diskettes used to perform the save operation.
ending date are saved. Before the save is issued, tapes should be initialized
*LASTSAVE Objects are saved that have to a standard label format and diskettes should be
changed since the last time initialized to a save and restore format.
they were saved with update
You can use the Initialize Tape (INZTAP)
history.
command and specify a value on the NEWVOL
Notes: parameter to initialize a tape to a standard label
1. If this value is specified, format.
the value *ALL must be You can use the Initialize Diskette (INZDKT)
specified on all other ele- command and specify FMT(*SAVRST) to ini-
ments of this key. tialize a diskette to a save and restore format.
2. For file systems that are If a tape or diskette volume that is not initialized is
accessed through the encountered during the save operation, an inquiry
network server, the PC message will be sent and an operator can initialize
archive attribute is used. the tape or diskette volume.
For other file systems, the
b. This key does control initializing optical volumes.
AS/400 archive attribute is
By clearing an optical volume, you initialize it. If an
used.
optical volume is cleared, the optical file specified
on the optical file key must be in the root directory
of the volume.
The possible values are: key, both device data compaction and device
data compression are performed if supported
0 None of the media volumes or save files
on the device.
encountered during the save operation are
automatically cleared. (*NONE)
Data compression. Whether data compression is per-
If an uncleared tape, diskette, or optical formed. The default is 2.
volume is encountered, an inquiry
message is sent to the operator. The The possible values are:
operator can clear the volume, place 0 No data compression is performed. (*NO)
another volume in the tape or diskette 1 If the save operation is to tape and the target
unit, or end the save operation. device has the hardware compression feature,
If a save file that contains data is encoun- hardware compression is done. If the feature
tered, an inquiry message is sent to the is not present, or if the save data is written to
work station message queue for an inter- diskette or save file, software data com-
active job, or to the operator for a batch pression is done. If the save operation is
job. The choice is to clear the save file or being done while other jobs on the system are
to end the save operation. active and software data compression is used,
the overall system performance may be
1 All uncleared tapes, diskettes, optical
affected. (*YES)
volumes, or save files encountered during the
save operation are cleared automatically. Note: If 1 is specified for the data com-
(*ALL) pression key and 1 is specified for the data
compaction key, both device data compaction
If tapes are used and a sequence number is
and device data compression are performed if
specified for the sequence number key, the
supported on the device.
first tape is cleared beginning at that
2 If the tape device has the hardware com-
sequence number. All tapes following the first
pression feature installed, processing pro-
tape are completely cleared. To clear the
ceeds as if 1 were specified for the data
entire first tape, 1 must be specified for the
compression key. If the compression feature
sequence number key.
is not installed or if save data is written to a
2 All of the tapes, diskettes, or optical volumes
diskette or save file, processing proceeds as if
that are found after the first volume, and that
0 were specified for the data compression
are not already cleared, are cleared. If the
key. (*DEV)
operation cannot proceed because the first
volume is not cleared, an inquiry message is Note: If 2 is specified for the data com-
sent to the operator. The operator can either pression key and 1 is specified for the data
end the save operation or can specify that the compaction key, only device data compaction
currently selected volume be cleared so the is performed if compaction is supported on the
operation can continue. (*AFTER) device. Otherwise, data compression is per-
formed if supported on the device.
Note: This value is not valid for save files.
Device path name. The path name of the device to which
Data compaction. Whether device data compaction is per-
the objects are saved.
formed. The default is 1.
a pointer is specified in the path name format, 1 The entire subtree of each directory that
it must be 16-byte aligned. If not, unpredict- matches the object name pattern is included.
able results may occur. For more information The subtree includes all subdirectories and
on this structure, see “Path Name Format” on the objects within those subdirectories. (*ALL)
page 2-8. 2 The objects in the first level of each directory
that matches the object name pattern are
The possible values are:
included. The subdirectories of each
device-path-name
matching directory are included, but the
The path name of the diskette
objects in the subdirectories are not included.
device, media library device,
(*DIR)
optical device, save file, or tape
device used to save the
3 Only the objects that exactly match the object
name pattern are included. If the object name
objects. If a diskette device,
pattern specifies a directory, objects in the
media library device, optical
directory are not included. (*OBJ)
device, or save file path name
is specified, it must be the only
End of tape option. The operation that is automatically per-
element in the array.
formed on the tape volume after the operation ends. If more
Number in array. than one volume is included, this key applies only to the last
The number of devices used during the save
tape volume used; all other tape volumes are rewound and
operation.
unloaded when the end of the tape is reached. The default
The possible values are: is 0.
1-4 The number of devices used
during the save operation. The possible values are:
Offset to first device path name. 0 The tape is automatically rewound, but not
The offset from the beginning of the user unloaded, after the operation ends.
space to the first device path name in the list. (*REWIND)
The possible values are: 1 The tape does not rewind or unload after the
n The offset from the beginning operation ends. It remains at the current posi-
of the user space to the first tion on the tape drive. (*LEAVE)
device path name in the list. 2 The tape is automatically rewound and
Offset to next device path name. unloaded after the operation ends.
The offset from the beginning of the user (*UNLOAD)
space to the next device path name in the list.
Expiration date. The media in the device cannot be over-
The possible values are: written until the expiration date. The expiration date must be
n The offset from the beginning later than or equal to the current date. The default is
of the user space to the next 0999999.
device path name in the list. If
the current device path name is The possible values are:
the last device path name in
0999999 The media in the device is protected perma-
the array, this value should be
nently. (*PERM)
0.
date The date when protection for the media ends
Reserved Reserved.
in the format CYYMMDD:
The possible value is: C Century, where 0 indicates
blanks This field should contain years 19xx and 1 indicates
blanks. years 20xx.
YY Year
Directory subtree. Whether the directory subtrees are MM Month
included in the save operation. The default is 1. DD Day
The possible values are: Label. The file identifier of the media to be used for the
0 No subtrees are included in the save opera- save operation. The default is *GEN.
tion. If a directory matches the object name
The possible values are as follows:
pattern specified, the objects in the directory
are included. If the directory has subdirecto- *GEN The system generates the label.
ries, neither the subdirectories nor the objects
For objects in libraries, this is the equiv-
in the subdirectories are included. (*NONE)
alent of LABEL(*LIB) on the Save Object
(SAVOBJ) and the Save Library (SAVLIB)
commands.
in the Qlg_Path_Name_T format. If a pointer is specified in blanks This field should contain
the path name format, it must be 16-byte aligned. If not, blanks.
unpredictable results may occur. For more information on Type of output information.
this structure, see “Path Name Format” on page 2-8. The type of information that is directed to the
spooled file, stream file, or user space speci-
Note: This key is required when using an optical device.
fied for the output key.
The possible value follows: The possible values are:
Optical file The path name of the optical file that is used 0 The file contains information
for the save operation, beginning with the root about the command, and an
directory of the volume. entry for each directory.
(*SUMMARY)
When using a CD-ROM device, the extension
1 The file contains information
separator, the version separator, and the
about the command, an entry
version number must be included at the end
for each directory, and an entry
of the path name. For example, a file named
for each object that was not
'myfile' that is in the root directory of the
successfully saved. (*ERR)
volume, and that has no extension and only a
2 The file contains information
single version, is specified as '/myfile.;1'.
about the command, an entry
for each directory, an entry for
Output. Whether a list of information about the saved
each object that was success-
objects is created. The information can be directed to a
fully saved, and an entry for
spooled file, a stream file, or a user space.
each object that was not suc-
cessfully saved. (*ALL)
Offset
Dec Hex Type Field Save while active. Whether an object can be updated while
CHAR(1) Option it is being saved. The default is 0.
Option. Whether a message should be used to notify The possible values are:
the user that save-while-active checkpoint pro- *CURRENT The object is to be restored to, and used on,
cessing is complete. The default is 0. the release of the operating system that is
The possible values are: currently running on your system. The object
0 No notification message is can also be restored to a system with any
sent. (*NONE) subsequent release of the operating system.
1 The notification message is *PRV The object is to be restored to the previous
sent to the work station release with modification level 0 of the oper-
message queue. (*WRKSTN) ating system. The object can also be restored
2 The notification message is to a system with any subsequent release of
sent to the specified save- the operating system installed.
while-active message-queue target-release
path name. The release in the format VxRxMx. The
Reserved Reserved. object can be restored to a system with the
specified release or with any subsequent
The possible value is:
release of the operating system.
blanks This field should contain
blanks. When you specify the target-release value, the
Save-while-active message-queue path name. format VxRxMx is used to specify the release,
The path name of the message queue that will where Vx is the version, Rx is the release,
be used to notify the user that save-while- and Mx is the modification level. For example,
active checkpoint processing is complete. V4R3M0 is Version 4, Release 3, Modification
The path name should be specified in the Level 0.
Qlg_Path_Name_T format. If a pointer is Valid values depend on the current version,
specified in the path name format, it must be release, and modification level, and they
16-byte aligned. If not, unpredictable results change with each new release. See the valid
may occur. For more information on this values for TGTRLS parameter table in the
structure, see “Path Name Format” on Backup and Recovery book for a complete list
page 2-8. of valid values.
The possible value is:
Save-while-active message-queue path name Update history. Whether to update the save history on
The path name of the message objects saved with this save operation. The save history is
queue. used when *LASTSAVE is specified for the start time value
of the change period key on a subsequent save operation.
Sequence number. The tape file sequence number to be
used. The default is -1. The possible values include:
-1 The system saves the object starting after the Dec Hex Type Field
last sequence number on the first tape. If the BINARY(4) Number in array
first tape is full, an error message is issued
Note: This field repeats for each update history value.
and the operation ends. (*END)
1-16777215 The sequence number of the file. Any CHAR(1) Update history
existing files on the tape at or beyond this
sequence number are overwritten. Number in array.
The number of update history values.
System. Whether to process objects that exist on the local
The possible values are:
system or remote systems. The default is 0.
1-2 The number of update history
The possible values are: values.
Update history
Offset
Whether to update the save history on objects
saved with this save operation. The save Dec Hex Type Field
history is used when *LASTSAVE is specified BINARY(4) Number in array
for the start time value of the change period BINARY(4) Length of each volume
key on a subsequent save operation. The identifier
default is 0.
BINARY(4) Offset to first volume identi-
The possible values include: fier
0 The save history is not Note: These fields repeat for each volume identifier
updated. (*NO)
BINARY(4) Offset to next volume identi-
1 The save history is updated.
fier
For file systems that are
accessed through the network CHAR(*) Volume identifier
server, the PC archive attribute
is set to No. For other file Length of each volume identifier.
systems, the AS/400 archive The character length of each of the volume
attribute is set to No. (*YES) identifiers.
2 The system save history is The possible value follows:
updated. The AS/400 archive n The size of a single volume
attribute is set to No. (*PC) identifier. The maximum size
3 The PC save history is of a tape or diskette volume
updated. The PC archive attri- identifier is 6 characters. The
bute is set to No. (*SYS) maximum size of an optical
volume identifier is 32 charac-
Use optimum block size. Whether the optimum block size ters. If a volume identifier
is used for the save operation. The default is 1. larger than the maximum size
is entered for this key, it is trun-
The possible values are:
cated to the maximum size.
0 The optimum block size supported by the Number in array.
device is not used. Save uses the default The number of volume identifiers that are
block size supported by all device types. The used during the save operation. The default
tape volume can be duplicated to any media is 0.
format by using the Duplicate Tape (DUPTAP)
The possible values are:
command. (*NO)
0 The volume currently placed in
1 The optimum block size supported by all
the device is used. If 0 is
devices is used. If the optimum block size is
specified for a tape media
used, the following can occur:
library device, volume identi-
Performance may improve. fiers must be supplied by using
The tape file that is created is only com- the Tape Management exit
patible with a device that supports the program during the save or
block size used. Commands such as restore operation. If 0 is speci-
Duplicate Tape (DUPTAP) do not dupli- fied, the length of each volume
cate files unless the files are being dupli- identifier value is ignored.
cated to a device that supports the same (*MOUNTED)
block size that was used. Note: This value cannot be
The value for the data compression key is specified for an optical media
ignored. library device.
1-75 The number of volume identi-
If the target release key that is specified is fiers used during the save
earlier than V3R7M0, then the block size sup- operation.
ported by all device types is used. (*YES) Offset to first volume identifier.
The offset from the beginning of the user
Volume identifier. The volume identifiers of the volumes, or
space to the first volume identifier in the list.
the cartridge identifier of a tape in a tape media library
device, on which data is saved. The volumes must be placed The possible value is:
in the device in the order specified on this key. After all n The offset from the beginning
specified volumes are filled, the save operation continues on of the user space to the first
whatever volumes are mounted on the device. volume identifier in the list.
Output Files
The Save Object List (QSRSAVO) API saves a list of objects
Output File Lock
specified by the user. The list of objects, as well as any addi-
*SHRRD
tional information needed for the save operation, is gener-
ated by the user into a user space. If the output file does not exist:
Output File Library Authority
Authorities and Locks *READ and *ADD
The following authorities are needed if the user does not If the output file exists and a new member will be added:
have *SAVSYS or *ALLOBJ special authority.
Output File Authority
User Space *OBJMGT, *OBJOPR, and *ADD
Output File Library Authority
User Space Authority *EXECUTE and *ADD
*USE
User Space Library Authority If the output file exists and an existing member will be
*USE appended:
User Space Lock
Output File Authority
*SHRNUP
*OBJMGT and *ADD
Objects to Be Saved Output File Library Authority
*EXECUTE
Object Authority
*OBJEXIST If the output file exists and an existing member will be
Library Authority replaced:
*EXECUTE
Output File Authority
Object Lock *SHRNUP
*OBJMGT, *OBJOPR, *ADD, and *DLT
Library Lock *SHRUPD
Output File Library Authority
Note: Lower levels of locking may be used for objects in *EXECUTE
certain cases. See the Backup and Recovery book
for more information on these special cases.
Required Parameter Group
Devices
Qualified user space name
Save File Authority INPUT; CHAR(20)
*USE and *ADD The user space that is to hold all the information for the
Save File Library Authority save operation. The first 10 characters contain the user
*EXECUTE space name. The second 10 characters contain the
Save File Lock name of the library where the user space is located.
*EXCLRD See “User Space Format” on page 3-72 for the format of
Tape, Optical, or Diskette Authority the information in the user space.
*USE
You can use the following special values for the library Field Descriptions
name. However, it should be noted that the library
name that is actually used is not passed back to the Data. The data used to specify the value for the given key.
user. Care should be taken when using these special
values to avoid unexpected results. Key. The parameter of the Save Object (SAVOBJ)
command to specify. See “Valid Keys” for the list of valid
*CURLIB The job’s current library is used to locate keys.
the user space. If no library is specified
as the current library for the job, the Length of data. The length of the data used to specify the
QGPL library is used. value for the given parameter.
*LIBL The library list is used to locate the user
space. Length of variable length record. The length of the vari-
able length record.
Error code
I/O; CHAR(*) Number of variable length records. The number of vari-
The structure in which to return error information. For | able length records that are passed in the user space. The
the format of the structure, see “Error Code Parameter” | valid range is from 2 through 31.
on page 2-6.
Valid Keys
User Space Format The following table lists the valid keys for the key field area
The following defines the format for the information in the of the variable length record. For detailed descriptions of
user space. For detailed descriptions of the fields in the user the keys, see the “Field Descriptions” on page 3-73.
space format, see “Field Descriptions.”
Some messages for this API refer to parameters and values
of the Save Object (SAVOBJ) command. This table can also
Offset
be used to locate the key names that correspond to the
Dec Hex Type Field SAVOBJ command parameters. The field descriptions
0 0 BINARY(4) Number of variable length contain, in addition to detailed descriptions, the corre-
records sponding parameter values.
Note: These fields repeat for each variable length record.
The library key and the device key are required keys. The
BINARY(4) Length of variable length other keys are optional.
record
BINARY(4) Key Key Type Field SAVOBJ
Command
BINARY(4) Length of data
Parameter
CHAR(*) Data
1 CHAR(*) Object information OBJ, OBJTYPE
2 CHAR(*) Library LIB
If you specify a data length that is longer than the key field’s
defined data length, the data is truncated at the right. No 3 CHAR(*) Device DEV
error message is returned. 4 CHAR(20) Save file SAVF
If you specify a data length that is shorter than the key field’s 5 CHAR(1) Update history UPDHST
defined data length, an error message is returned for binary 6 CHAR(*) Volume identifier VOL
fields. If the field is a character field, the data is padded with 7 BINARY(4) Sequence number SEQNBR
blanks.
8 CHAR(*) Label LABEL
Note: This does not apply to keys that allow a list of values
9 CHAR(7) Expiration date EXPDATE
to be specified. In these cases, the amount of data
read is based on the specified number of entries in 10 CHAR(1) End of tape option ENDOPT
the list. 11 CHAR(10) Target release TGTRLS
12 CHAR(1) Clear CLEAR
If keys are duplicated in the user space, only the last value
for a given key is used for the save operation. 13 CHAR(1) Object precheck PRECHK
14 CHAR(1) Save while active SAVACT
15 BINARY(4) Save while active SAVACTWAIT
wait time
16 CHAR(20) Save while active SAVACTMSGQ
message queue
Label. The name that identifies the data file on the tape or 0 The save operation for a library continues,
diskette. Although the label key is defined as CHAR(*), the saving only those objects that can be saved.
maximum length of a label is currently 17. If the length of (*NO)
data field is specified as more than 17, the label is truncated 1 If one or more objects cannot be saved after
such that only the first 17 characters are used. The default the specified objects are checked, the save
is *LIB. operation for a library ends before any data is
written. (*YES)
The possible values are as follows:
Omit libraries. A list of the libraries to be omitted from the
*LIB The file label is created by the system using
save operation. The default is *NONE. For the format of this
the name of the library specified for the library
field, see “Library Key Format” on page 3-77.
key.
Data file identifier Omit object information. A list of the name and type of the
The data file identifier of the data file used. objects and library to be omitted from the save operation. If
This option is valid only for a single-library *ALL is specified for the object name and object type, the list
save operation. cannot contain other entries. The default for both the object
name and the object type is *ALL. For the format of this
Library. A list of libraries that contain the objects that are
field, see “Omit Object Information Format” on page 3-78.
saved. If more than one library is specified, *ALL must be
the only object name specified (object information key) and Optical file. The name that identifies the file on the optical
the device cannot be *SAVF. For the format of this field, see volume. Although the optical file is defined as CHAR(*), the
“Library Key Format” on page 3-77. maximum length of an optical file name is currently 256 char-
acters. If the length of data field is specified as more than
| Media definition. The name and library of the media defi-
256 characters, the name is truncated such that only the first
| nition that identifies the devices and media used to contain
256 characters are used. The possible value is as follows:
| the saved data. For information about creating and using a
| media definition, see the Backup and Recovery book and the Optical file path name
| Create Media Definition (QSRCRTMD, The path name (starting with a /) of the file on
| QsrCreateMediaDefinition) API. The first 10 characters the optical volume.
| contain the media definition name, and the second 10 char-
Output. Whether a list of information about the saved
| acters contain the library in which the media definition is
objects is created. The default is 0.
| located.
The possible values are:
| You can use these special values for the library name:
| *CURLIB The job’s current library is used to locate the
0 No output listing is created. (*NONE)
| media definition. If no library is specified as
1 The output is printed with the job’s spooled
output. (*PRINT)
| the current library for the job, the QGPL library
| is used.
2 The output is directed to the database file
specified with the output file key. (*OUTFILE)
| *LIBL The library list.
Output member. The name of the database file member
Object information. A list of the name and type of the
used to save the object information. This field also deter-
objects to be saved. If *ALL is specified for the object name
mines whether to replace or add the data if the member
and object type, the list cannot contain other entries. The
already exists. The defaults are *FIRST for the output
default for both the object name and the object type is *ALL.
member name field and 0 for the option field. For the format
For the format of this field, see “Object Information Format”
of this field, see “Output Member Format” on page 3-78.
on page 3-77.
Qualified output file. The qualified name of the database
Object precheck. Whether the save operation for a library
file to which the information about the objects is directed.
should end if all objects specified by the API do not satisfy all
This key is required only if the output key is set to 2. The
the following conditions:
first 10 characters contain the output file name. The second
The objects exist 10 characters contain the output file library. The possible
values for output file library are:
*CURLIB The job’s current library is used to locate the 3 Objects in a library can be saved while they
output file. If no library is specified as the are in use by another job. All the objects and
current library for the job, the QGPL library is all the libraries in the save operation reach a
used. checkpoint together. They are saved in a
*LIBL The library list is used to locate the output file. consistent state in relationship to each other.
Library name The name of the library where the output file (*SYNCLIB)
is located.
Save while active message queue. The name and library
Save access paths. Whether the logical file access paths of the message queue that is used to notify the user that the
that are dependent on the physical files being saved are also checkpoint processing for a library is complete. The first 10
saved. The default is 0. characters contain the message queue name. The second
10 characters contain the name of the library where the
The possible values are: message queue is located. If *NONE or *WRKSTN is speci-
0 The logical file access paths are not saved. fied for the message queue name, blanks must be specified
(*NO) for the message queue library. The defaults are *NONE for
1 The specified physical files and all eligible the message queue name and blanks for the library.
logical file access paths over them are saved.
The possible values for the message queue name are:
(*YES)
*NONE No notification message is sent.
Save file. The name and library of the save file that is used *WRKSTN The notification message is sent to the work
to contain the saved data. The first 10 characters contain the station message queue. This is not valid in
save file name, and the second 10 characters contain the batch mode.
library where the save file is located. Message queue name
The name of the message queue.
You can use these special values for the library name:
*CURLIB The job’s current library is used to locate the The possible values for the message queue library are:
save file. If no library is specified as the *CURLIB The job’s current library is used to locate the
current library for the job, the QGPL library is message queue. If no library is specified as
used. the current library for the job, the QGPL library
*LIBL The library list. is used.
*LIBL The library list is used to locate the message
Save file data. For save file objects, whether only the
queue.
description of a save file, or both the description and the con-
Library name The name of the library where the message
tents of a save file are saved. The default is 1.
queue is located.
The possible values are:
Save while active wait time. If an object is not available,
0 Only the description of a save file is saved. the amount of time to wait for a commit boundary or a lock
(*NO) on the object before continuing the save operation. The
1 The description and contents of a save file are default is 120.
saved. (*YES)
The possible values are:
Note: For System/38 environments, the default value of 1 is
not valid; therefore, this key must be explicitly set to a -1 No maximum wait time exists.
value of 0. 0-99999 The time (in seconds) to wait.
Save while active. Whether an object can be updated while Sequence number. The sequence number to use for the
it is being saved. The default is 0. save operation when tape is used. The default is -1.
0 Objects that are in use are not saved. (*NO) -1 The save operation begins after the last
1 Objects in a library can be saved while they sequence number on the tape volume.
are in use by another job. Objects in a library 1-16777215 The sequence number of the file to be used
may reach checkpoints at different times and for the save operation.
may not be in a consistent state in relationship
Storage. Whether the system storage that is occupied by
to each other. (*SYSDFN)
the data portion of the following objects in the library being
2 Objects in a library can be saved while they
saved is freed:
are in use by another job. All the objects in a
library reach a checkpoint together. They are Files
saved in a consistent state in relationship to
Modules
each other. (*LIB)
Media library device name Number of members. The number of member names for
The name of the media library device used for the given file name. Possible values are 1 through 50.
the save operation. If specified, it must be the
only element in the array. Reserved. An ignored field.
Optical device name
The name of the optical device used for the Library Key Format
save operation. If specified, it must be the
only element in the array.
Offset
Tape device name
The name of the tape device used for the Dec Hex Type Field
save operation. A maximum of four tape BINARY(4) Number in array
devices may be used. They must be specified
Note: This field repeats for each library name.
in the order in which they should be used.
CHAR(10) Library name
Number in array. The number of devices to be used during
the save operation. The possible values are 1 through 4.
Field Descriptions
File Member Format Library name. The name of the library containing the
objects. The possible value is:
Offset
Library name Either a simple or generic library name
Dec Hex Type Field
BINARY(4) Number in array
Number in array. The number of libraries used during the
save operation. The possible values are 1 through 300.
Note: These fields repeat for each file.
CHAR(10) File name
Object Information Format
CHAR(2) Reserved
BINARY(4) Number of members Offset
Note: This field repeats for each member associated with the Dec Hex Type Field
given file.
BINARY(4) Number in array
CHAR(10) Member
Note: These fields repeat for each object name.
CHAR(10) Object name
Field Descriptions CHAR(10) Object type
File name. The name of the file being saved. The possible
values are: Field Descriptions
*ALL The list of member names that follow this
value applies to all files indicated in the list of Number in array. The number of objects that are specified
objects to save. If *ALL is specified for the file for this key. There is no limit for the number in array field.
name, it must be the only file name in the list. However, the total amount of information in the user space
Database file name cannot exceed 16MB.
The name of the database file from which the
Object name. The name of the object that is to be saved.
listed members are saved.
The possible values are:
Member. The name of the member to save. The possible *ALL All the objects in the specified libraries,
values are: depending on the values specified for object
*ALL All members are saved from the specified file. type
If *ALL is specified for member name, it must Object name Either a simple name or a generic name
be the only member name for that file.
Object type. The type of the object that is to be saved. The
*NONE No members are saved from the specified file.
possible values are:
Only the file description is saved.
Member name *ALL All objects with the specified object name,
The name of the member to save. It may be regardless of type
either a simple name or a generic name. Object type A valid type on the current release of the
system
Number in array. The number of file and member struc-
tures used during the save operation. The possible values
are 1 through 50.
Omit Object Information Format Output member name. The name of the file member that
receives the output. The possible values are:
Offset *FIRST The first member in the file is used and
receives the output.
Dec Hex Type Field
Member name
BINARY(4) Number in array If the member does not exist, the system
Note: These fields repeat for each object name. creates it.
CHAR(10) Object name
CHAR(10) Library name Volume Identifier Format
CHAR(10) Object type
Offset
Dec Hex Type Field
Field Descriptions BINARY(4) Number in array
Library name. The name of the library that is to be omitted. Note: These fields repeat for each volume identifier.
The possible values are: BINARY(4) Length of volume identifier
*ALL All the libraries, depending on the values CHAR(*) Volume identifier
specified for object and object type
Library name Either a simple name or a generic name
Field Descriptions
Number in array. The number of values that are specified
for this key. The possible values are 1 through 300. Length of volume identifier. The character length of the
identifier of the volume. The possible values are:
Object name. The name of the object that is to be omitted.
The possible values are: n The size of a single volume identifier. The
maximum size of a tape or diskette volume
*ALL All the objects in the specified libraries, identifier is 6 characters. The maximum size
depending on the values specified for object of an optical volume identifier is 32 characters.
type If a volume identifier larger than the maximum
Object name Either a simple name or a generic name size is entered for this key, it is truncated to
the maximum size. If the volume identifier is
Object type. The type of the object that is to be omitted.
*MOUNTED, this value must be 8.
The possible values are:
*ALL All objects with the specified object name, Number in array. The number of volume identifiers used
regardless of type during the save operation. The possible values are 1
Object type A valid type on the current release of the through 75.
system
Volume identifier. The identifier of a volume. The possible
values are:
Output Member Format *MOUNTED The volume currently placed in the device is
used. If *MOUNTED is specified, it must be
Offset the only value specified. This value cannot be
Dec Hex Type Field specified for an optical media library device.
CHAR(10) Output member name *MOUNTED cannot be specified for a tape
media library device unless a category is set
CHAR(1) Option
with the Set Tape Category (SETTAPCGY)
command.
Volume identifier
Field Descriptions The identifier of a volume.
Option. An indicator of whether to add to or replace the
existing member. The possible values are: Dependencies between Keys
0 The existing records in the specified database
The following two tables list the dependencies between the
file member are replaced by the new records.
different keys. If the dependency holds only for a certain
(*REPLACE)
value, then that value is also shown (key = n, where n is the
1 The new records are added to the existing
value). Otherwise, if the dependency is true for all values of
information in the database file member.
the key, then only the name of the key is given.
(*ADD)
QTEMP should not be specified for the library name on the User space format name
OUTFILE or SAVACTMSGQ parameter because the save INPUT; CHAR(8)
command is submitted by a prestart job running in the The format name for the input parameters that are con-
QSYSWRK subsystem and not in the job that called the API. tained in the user space. For the format of the structure,
Locks should not be applied to save objects that would con- see “SVRS0100 Format” on page 3-81.
flict with locks applied by the save operation running in the
prestart job.
Status format name Exit program name. The name of the exit program that is
INPUT; CHAR(8) called by the API. See “Save to Application Exit Program”
on page 3-85 for additional details.
The format name for the status information returned on
the API call. For the format of the structure, see
Length of application data. The length of the application
“SRST0100 Format” on page 3-82.
data. This value is passed to the exit program. This value
Status information must be set to zero if there is no application data.
OUTPUT; CHAR(*)
Length of save command parameters. The length of the
The status information returned on the API call. save command parameters. The maximum allowable length
is 5900 bytes for save commands.
Length of status information
INPUT; BINARY(4)
Length of structure. The length of this structure, from the
The length of the status information returned on the API start of the input parameters to the last byte of the applica-
call. The minimum length is 8 bytes. tion data.
Error code Offset to application data. The byte offset from the begin-
I/O; CHAR(*) ning of the user space to the start of the application data.
The structure in which to return error information. For This value must be set to zero if there is no application data.
the format of the structure, see “Error Code Parameter”
Offset to save command parameters. The byte offset from
on page 2-6.
the beginning of the user space to the start of the save
command parameters.
SVRS0100 Format
Save command parameters. A character string that con-
This format defines the input parameter group for the API. tains the save command parameters or save keys. These
parameters are validated when the API submits the
Offset command for processing. Refer to the save commands in
the CL Reference (Abridged) book for detailed information
Dec Hex Type Field
about valid parameters when you save objects to save files.
0 0 Binary(4) Length of structure Refer to “Save Object (QsrSave) API” on page 3-61 for
4 4 Binary(4) Offset to save command detailed information about valid keys when you save objects
parameters to save files.
8 8 Binary(4) Length of save command
parameters These additional restrictions apply to the save command
parameters when you use this API:
12 C Binary(4) Offset to application data
The parameters specified must be consistent with the
16 10 Binary(4) Length of application data
save command type.
20 14 Binary(4) Save command type
The parameters must not include the save command
24 18 Char(10) Exit program name name.
34 22 Char(10) Exit program library
The parameters must be separated by at least one blank
| 44 2C Char(8) Target release character.
Char(*) Save command parameters Only a single library name can be used with the LIB
Char(*) Application data parameter.
The CLEAR, DEV, SAVF and TGTRLS parameters must
not be used. These parameters are provided by the
Field Descriptions API.
Application data. Information that the application wants The DTACPR data compression and COMPACT data
passed to the exit program. The content of this information compaction parameters must not be used. These param-
is defined by the application. This field could contain infor- eters are not supported by the API.
mation specific to the object being saved (such as the object
name, size, and so forth), or it could contain the qualified The following examples illustrate the save command parame-
name of another object that contains this information. ters that are required for typical save scenarios:
Example 1: Save command type 1 (SAV)
Exit program library. The name of the library that contains
OBJ('/\') ('/QSYS.LIB' \OMIT)
the exit program called by the API. the exit program.