Hi,
There's no command available in CL to update a physical file. You can however use various methods of running SQL statements from a CL program to update files (e.g. RUNSQLSTM or the qshell db2 utility). I normally prefer to write a small RPG program.
Regards,
Martin Gilbert.
Last Wiki Answer Submitted: May 15, 2008 8:45 am by Gilly40023,625 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
The CL for Files product, documented here, provides the Update Record using CLF (UPDRCDCLF) command which performs an update to a record within a file. The command is provided with the no-charge runtime option of CLF and is available starting with V5R4. A fee based precompiler option is also available (though not required) as a productivity tool. Bruce Vining (one of the CLF developers)
You could update the file in CL using the STRQMQRY command: you can leave out the &APOST
STRQMQRY QMQRY(TECHSPEC/CYCLESTEP) +
SETVAR((CYCLE (&APOST *CAT &CYCLE *CAT &APOST)) +
(JOBNAM (&APOST *CAT &JOBNAM *CAT &APOST)) +
(JOBUSR (&APOST *CAT &JOBUSR *CAT &APOST)) +
(JOBNBR (&APOST *CAT &JOBNBR *CAT &APOST)) +
(JOBDAT (&APOST *CAT &JOBDAT *CAT &APOST)) +
(JOBTIM (&APOST *CAT &JOBTIM *CAT &APOST)) +
(JOBCDE (&APOST *CAT &JOBCDE *CAT &APOST)))
then in the CYCLESTEP member in QQMQRYSRC
INSERT INTO TECHSPEC/CYCLESTEP
VALUES(&CYCLE,
&JOBNAM,
&JOBUSR,
&JOBNBR,
&JOBDAT,
&JOBTIM,
&JOBCDE)
The CL for Files product, documented here, provides the Update Record using CLF (UPDRCDCLF) command which performs an update to a record within a file. The command is provided with the no-charge runtime option of CLF and is available starting with V5R4. A fee based precompiler option is also available (though not required) as a productivity tool. Bruce Vining (one of the CLF developers)