Question

  Asked: May 15 2008   3:38 AM GMT
  Asked by: Cyjil


cl which command do we use to update a physical file in CL program?


AS/400, CL, CL programs

which command we use to update a physical file in CL pgm?

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
+1
Click to Vote:
  •   1
  •  0




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.
  • AddThis Social Bookmark Button

Browse more Questions and Answers on AS/400.

Looking for relevant AS/400 Whitepapers? Visit the Search400.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register

ASPSYS1  |   May 15 2008  2:10PM GMT

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)