Trying to get the ALTID to create a file from the processor. When trying to create a file from a processor it fails with a message from security (ACF2/TSS or RACF). The processor attempts to create the file under the userid that runs the processor, not the ALTID as expected. How can the file be created using the ALTID and from inside of a processor.
Release : All
The ALTID is not used to create or delete files in a processor this is by design and documented.
Files can't be created using the standard method of creation for example DISP=(NEW,CATLG,DELETE) or DISP=(MOD,CATLG,KEEP) from the processor. Another method must be used.
For example(this will create the file under the user's ID not the ALTID):
//COPY EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD *
&C1ELEMENT
&C1ELMNT10
&C1ELMNT255
//SYSUT2 DD DSN=&#HLQ..GEN.D&C1AYY&C1AMM,
// DISP=(MOD,CATLG,KEEP),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=24000,DSORG=PS),
// UNIT=SYSDA,
// SPACE=(CYL,(50,25))
//SYSIN DD DUMMY
A good method to create the file using the ALTID is to use DFC (Deferred File Creation) to create the file. Files created using DFC are created using the ALTID.
If the file does not exist and the processor attempts to allocate the file with DISP=SHR or OLD. Then DFC would allocate the file. If the file exists then DFC would do nothing.
This is how you would set it up.
1) If you don't have DFC set up then set it up.
2) Add the following to your DFC parm:
*Note this will create a file using the site symbolic #HLQ and string GEN and the C1 variables C1AYY and C1AMM. DFC only uses Site symbolic, and C1 variables(Endevor Symbols). DFC does not translate Processor Symbolic(s) to your DFC DSN or LIKE statements.
Example:
DSN '&#HLQ..GEN.D&C1AYY&C1AMM'
RECFM FB
LRECL 80
BLKSIZE 2400
SPACE CYLS
PRIMARY 50
SECONDARY 25
DSORG PS
.
3) Update your proc Step.
This is the sample if the output is required with DISP= OLD or SHR:
//COPY EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD *
&C1ELEMENT
&C1ELMNT10
&C1ELMNT255
//SYSUT2 DD DSN=&#HLQ..GEN.D&C1AYY&C1AMM,
// DISP=SHR
//SYSIN DD DUMMY
This is the sample when you require the output to have a DISP=MOD. An additional step with DSIP=SHR is required. The DISP=SHR will trigger the DFC allocation.
//ALLOC EXEC PGM=IEFBR14
//DD1 DD DSN=&#HLQ..GEN.D&C1AYY&C1AMM,DISP=SHR
//COPY EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD *
&C1ELEMENT
&C1ELMNT10
&C1ELMNT255
//SYSUT2 DD DSN=&#HLQ..GEN.D&C1AYY&C1AMM,
// DISP=MOD
//SYSIN DD DUMMY