Purpose
This subcommand call is an aggregate
operation that formats a VSAM linear data set as a zFS aggregate.
It supports both version 1.4 aggregates and version 1.5 aggregates.
Format
ssyscall_parmlist
opcode 134 AGOP_FORMAT_PARMDATA
parms[0] offset to AGGR_ID
parms[1] offset to AGGR_FORMAT
parms[2] offset to system name (optional)
parms[3] 0
parms[4] 0
parms[5] 0
parms[6] 0
AGGR_ID
aid_eye char[4] "AGID"
aid_len char sizeof(AGGR_ID)
aid_ver char 1
aid_name char[45] "OMVS.PRV.AGGR001.LDS0001"
aid_reserved char[33] 0 /* Reserved for the future */
AGGR_FORMAT
af_eye char[4] "AGFM"
af_len short sizeof(AGGR_FORMAT)
af_ver char 1
af_aggrversion char 0 /* 0 means honor format_aggrversion value */
/* 4 means format a version 1.4 aggregate */
/* 5 means format a version 1.5 aggregate */
af_size long 0
af_logsize long 0
af_initialempty long 0 /* this is ignored - always use 1 */
af_overwrite int 0 /* Use caution if you specify 1 */
af_compat int 1 /* compat aggr desired (this is ignored - always compat) */
af_owner int 0 /* no uid specified */
af_ownerSpecified int 0 /* use uid of issuer */
af_group int 0 /* no guid specified */
af_groupSpecified int 0 /* gid set to issuer default group */
af_perms int 0 /* no perms specified */
af_grow int 0 /* grow amount, 0 means grow not specified */
af_newauditfid int 0 /* 0=old auditfid; 1=newauditfid */
af_reserved char[56]
systemname char[9]
Return_value 0 if request is successful, -1 if it is not successful
Return_code
EBUSY Aggregate is busy or otherwise unavailable
EINTR ZFS is shutting down
EINVAL Invalid parameters
EMVSERR Internal error using an osi service
ENOENT No aggregate by this name is found
EPERM Permission denied to perform request
Reason_code
0xEFnnxxxx See z/OS Distributed File Service Messages and Codes
EINVAL Invalid parameters
EMVSERR Internal error using an osi service
ENOENT No aggregate by this name is found
EPERM Permission denied to perform request
Reason_code
0xEFnnxxxx See z/OS Distributed File Service Messages and Codes
Usage notes
- Reserved fields and undefined flags must be set to binary zeros.
- The af_compat bit is ignored. The VSAM LDS is always formatted
as a compatibility mode aggregate.
Privilege required
The
issuer must have ALTER authority on the VSAM linear data set to be
formatted or must be logged in as root or have READ authority to the
SUPERUSER.FILESYS.PFSCTL resource in the z/OS® UNIXPRIV class.
Restrictions
The VSAM linear data set to
be formatted cannot be attached.
Examples
#pragma linkage(BPX1PCT, OS)
extern void BPX1PCT(char *, int, int, char *, int *, int *, int *);
#include <stdio.h>
#define ZFSCALL_AGGR 0x40000005
#define AGOP_FORMAT_PARMDATA 134
typedef struct syscall_parmlist_t {
int opcode; /* Operation code to perform */
int parms[7]; /* Specific to type of operation, */
/* provides access to the parms */
/* parms[4]-parms[6] are currently unused*/
} syscall_parmlist;
#define ZFS_MAX_AGGRNAME 44
typedef struct aggr_id_t {
char aid_eye[4]; /* Eye catcher */
#define AID_EYE "AGID"
char aid_len; /* Length of this structure */
char aid_ver; /* Version */
#define AID_VER_INITIAL 1 /* Initial version */
char aid_name[ZFS_MAX_AGGRNAME+1]; /* Name, null terminated */
char aid_reserved[33]; /* Reserved for the future */
} AGGR_ID;
typedef struct aggr_format_t
{
char af_eye[4]; /* Eye catcher */
#define AF_EYE "AGFM"
short af_len; /* Length of structure */
char af_ver; /* Version of cb */
#define AF_VER_INITIAL 1
char af_aggrversion; /* 0 means honor format_aggrversion value */
#define AF_VERSION4 4
#define AF_VERSION5 5
long af_size;
char af_res1; /* For future use */
long af_size; /* Amount to format of aggr */
#define AF_VERSION4 4 /* make a version 1.4 aggregate */
#define AF_VERSION5 5 /* make a version 1.5 aggregate */
#define AF_DEFAULT_SIZE 0 /* If set, we use default of entire primary partition of LDS */
long af_logsize; /* Size of logfile in aggr */
#define AF_DEFAULT_LOGSIZE 0 /* If set, we use default of 1% of aggr size */
long af_initialempty; /* Initial empty blocks */
#define AF_DEFAULT_INITIALEMPTY 1 /* This is the default & minumum too */
int af_overwrite; /* Overwrite aggr if its not empty */
#define AF_OVERWRITE_OFF 0 /* Overwrite off, that means if aggr not empty it will */
/* NOT be formatted, th default */
#define AF_OVERWRITE_ON 1 /* Overwrite in effect */
int af_compat; /* HFS-compat aggr desired */
#define AF_MULT 0 /* HFS-compat aggr desired */
#define AF_HFSCOMP 1 /* HFS-compat aggr desired */
int af_owner; /* Owner for HFS-compat */
int af_ownerSpecified; /* Indicates an owner was provided */
#define AF_OWNER_USECALLER 0 /* Owner gets set to pfsctl issuer uid */
#define AF_OWNER_SPECIFIED 1 /* Use owner uid set in af_owner */
int af_group; /* Group for HFS-compat */
int af_groupSpecified; /* Indicates if group specified */
#define AF_GROUP_USECALLER 0 /* Group gets set to pfsctl issuer default group */
#define AF_GROUP_SPECIFIED 1 /* Use group gid set in af_group */
int af_perms; /* Perms for HFS-compat */
#define AF_DEFAULT_PERMS 0755 /* The default perms to use */
int af_permsSpecified; /* Indicates if perms provided */
#define AF_PERMS_DEFAULT 0 /* Perms not specified, use default */
#define AF_PERMS_SPECIFIED 1 /* Use perms set in af_perms */
int af_grow; /* Amount to extend each time until we reach desired size */
/* 0 means work the old way, just extend to desired size once */
int af_newauditfid; /* 0 = old format auditfid, 1 = new format auditfid */
char af_reserved[56]; /* For future use */
} AGGR_FORMAT;
struct parmstruct {
syscall_parmlist myparms;
AGGR_ID aid;
AGGR_FORMAT aggformat;
char systemname[9];
} myparmstruct;
int main(int argc, char **argv)
{
int bpxrv;
int bpxrc;
int bpxrs;
char aggrname[45] = "PLEX.JMS.AGGR007.LDS0007"; /* aggregate name to format */
AGGR_FORMAT *aggptr = &(myparmstruct.aggformat);
AGGR_ID *idp = &(myparmstruct.aid);
/* This next field should only be set if parms[2] is non-zero */
/* strcpy(myparmstruct.systemname,"DCEIMGVN"); */ /* set system to change */
myparmstruct.myparms.opcode = AGOP_FORMAT_PARMDATA;
myparmstruct.myparms.parms[0] = sizeof(syscall_parmlist);
myparmstruct.myparms.parms[1] = sizeof(syscall_parmlist)+sizeof(AGGR_ID);
myparmstruct.myparms.parms[2] = 0;
/* Only specify a non-zero offset for the next field (parms[2]) if */
/* you are running z/OS 1.7 and above, and */
/* you want the format to be run on a different system than this one */
/* myparmstruct.myparms.parms[2] = sizeof(syscall_parmlist)+sizeof(AGGR_ID)+sizeof(AGGR_FORMAT);*/
myparmstruct.myparms.parms[3] = 0;
myparmstruct.myparms.parms[4] = 0;
myparmstruct.myparms.parms[5] = 0;
myparmstruct.myparms.parms[6] = 0;
memset(idp,0,sizeof(AGGR_ID));
memcpy(idp->aid_eye,AID_EYE,4);
idp->aid_ver=1;
strcpy(idp->aid_name,aggrname);
idp->aid_len=(int) sizeof(AGGR_ID);
memset(aggptr,0,sizeof(myparmstruct.aggformat));
memcpy(aggptr->af_eye,AF_EYE,4);
aggptr->af_len = sizeof(myparmstruct.aggformat);
aggptr->af_ver = AF_VER_INITIAL;
aggptr->af_size = AF_DEFAULT_SIZE;
aggptr->af_compat = AF_HFSCOMP; /* I want an HFS compatibility mode aggregate */
aggptr->af_ownerSpecified = AF_OWNER_USECALLER; /* aggptr->af_owner = owner; */
aggptr->af_groupSpecified=AF_GROUP_USECALLER; /* aggptr->af_group = group; */
aggptr->af_permsSpecified=AF_PERMS_DEFAULT; /* aggptr->af_perms = perms; */
aggptr->af_grow = 0; /* no grow size */
aggrp->af_aggrversion=0; /*format with default version defined by format_aggrversion value */
aggptr->af_newauditfid = 1; /* generate a new auditfid */ BPX1PCT("ZFS ",
ZFSCALL_AGGR, /* Aggregate operation */
sizeof(myparmstruct), /* Length of Argument */
(char *) &myparmstruct, /* Pointer to Argument */
&bpxrv, /* Pointer to Return_value */
&bpxrc, /* Pointer to Return_code */
&bpxrs); /* Pointer to Reason_code */
if (bpxrv < 0) {
printf("Error formatting, BPXRV = %d BPXRC = %d BPXRS = %x\n",bpxrv,bpxrc,bpxrs);
return bpxrc;
}
else {
printf("Formatted aggregate %s\n",aggrname);
}
return 0;
}