In the system program, sys.prmem.rpt1.1, the DrInit PCL for sys.program
sets the start and end key and then calls sys.seek_key().
sys.seek_key() expects a keynum argument, which is gotten by
calling sys.get_keyno.
Coding it this way allows for the keynum to change if you modify
the file definition.
The relevant code follows:
else {
sys.pr_name = sys.prm_fromprog;
sys.set_skey(sys.program,S_PRNAME,MATCH_PARTIAL);
sys.pr_name = sys.prm_toprog;
sys.set_ekey(sys.program,S_PRNAME,MATCH_PARTIAL);
sys.seek_key(sys.program,
sys.get_keyno(sys.program,sys.pr_name),SEEK_START);
}
The sys.seek_key() statement could also be code as:
sys.seek_key(sys.program,
sys.get_keyno(sys.program,S_PRNAME),SEEK_START);
This method is now the preferred method because it is
consistent with the way most other SysPCLs refer to file variables