I have a CLP which declares a file:
DCLF FILE(QTEMP/TEMPFILE)
When I compile it, it will have an error:
CPD0852 30 File TEMPFILE in library QTEMP not found. So, I tried to create it:
CRTPF FILE(QTEMP/TEMPFILE) RCDLEN(150) SIZE(*NOMAX)
But it still cannot be found when I compile.
Note that I'm creating and compiling the file in the same session.
What I tried to do is to edit the authority and grant access to all:
EDTOBJAUT OBJ(QTEMP/TEMPFILE) OBJTYPE(*FILE)
So here is what it looks like:
Edit Object Authority
Object . . . . . . . : TEMPFILE Owner . . . . . . . : PAXUS
Library . . . . . : QTEMP Primary group . . . : *NONE
Object type . . . . : *FILE ASP device . . . . . : *SYSBAS
Type changes to current authorities, press Enter.
Object secured by authorization list . . . . . . . . . . . . *NONE
Object
User Group Authority
*PUBLIC *ALL
*GROUP PAXUS *ALL
Bottom
F3=Exit F5=Refresh F6=Add new users F10=Grant with reference object
F11=Display detail object authorities F12=Cancel F17=Top F18=Bottom
(C) COPYRIGHT IBM CORP. 1980, 2018.
Please help me why I can't compile it due to missing file even if it is existing.
Because you have your compiles set to run in batch.
Since QTEMP to unique to a job, the file doesn't exist in the submitted job's QTEMP.
Quick and dirty solution is to run the compile interactively. I'd hope you aren't using PDM. But if you are, from "Work with Members", F18=Change defaults
then change Compile in batch . . . . . . Y
The real solution is to use an actual change management system, or at least some build tooling.