10 pts.
 cl which command do we use to update a physical file in CL program?
which command we use to update a physical file in CL pgm?

Software/Hardware used:
ASKED: May 15, 2008  3:38 AM
UPDATED: May 20, 2011  10:29 AM

Answer Wiki:
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  Gilly400   23,625 pts.
All Answer Wiki Contributors:  Gilly400   23,625 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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)

 10 pts.

 

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)

 6,055 pts.