Use DataDict.pkg

Open C_RecPat
Open C_System

Class cC_RecpatDataDictionary is a DataDictionary
    
    Procedure Construct_Object
        Forward Send Construct_Object
        Set Main_file to C_RecPat.File_Number

        Set Add_System_File to C_System.File_Number DD_Lock_On_All

        Set Foreign_Field_Option DD_KEYFIELD DD_NOPUT to True
        Set Foreign_Field_Option DD_KEYFIELD DD_FINDREQ to True
        Set Foreign_Field_Option DD_INDEXFIELD DD_NOPUT to True
        Set Foreign_Field_Option DD_DEFAULT DD_DISPLAYONLY to True

        Set Field_Auto_Increment Field C_RecPat.URN to File_Field C_System.L_URN_RecPat

    End_Procedure

End_Class