Which command we can use to update a physical file using c.l pgm?
Answers were Sorted based on User's Feedback
Answer / bharathi
We can not update files from CL programs. We can read files
from CL.
Is This Answer Correct ? | 31 Yes | 6 No |
Answer / sidd
We can update physical files from CL program by either
usinf RUNSQLSTM or STRQMQRY
Is This Answer Correct ? | 21 Yes | 3 No |
Answer / sumit
Everyone is saying we cannot update pf using Cl...But please
try once using RUNSQLSTM before marking 'NO' to any answers.
As we can update a PF using CL.
RUNSQLSTM uses source file where source member is present.
And this source member contain UPDATE SQL, OR DELETE SQL, OR
INSERT SQL.
RUNSQLSTM SRCFILE(LIB/QSRCPF)SRCMBR(SQLPGM)COMMIT(*NONE)
Once this statement run in CL then PF will get updated,
deleted or inserted with the new record.
Is This Answer Correct ? | 11 Yes | 0 No |
Answer / anupam
Use of RUNSQLSTM helps in updating the physical file within
a CL program.
Syntax:
RUNSQLSTM SRCFILE(LIB/QSRCPF)SRCMBR(SQLPGM)COMMIT(*NONE)
SQLPGM should contain
UPDATE PF set DATA='Value' where DATA'='Value1' and it will
update the PF
Is This Answer Correct ? | 8 Yes | 2 No |
Answer / rajeev
We can not update a database file throught CL in a normal
way but if we use QSH then we can update or insert. Here I
am showing a exaple of insert.
QSH CMD('db2 "insert into $SCHEMA.$TABLE + VALUES(12,
5,''rajeev'', ''2009-11-24'',.2" ')
Is This Answer Correct ? | 6 Yes | 1 No |
Answer / gaurav agrawal
In CL program we can not update the database file ,
we can read only.
if any doubt contact at gauravag.innovative@gmail.com
Is This Answer Correct ? | 7 Yes | 3 No |
Answer / jaishriram
Did anyone tried to test Rajeev's Answer 13, Saying about to
update file using "QSH" ? Not sure....anyone gave a try.
But folks, it works. You know. He really discover a new way
of updating files from CL program.
Thanks Rajeev. Thanks a lot for sharing this tech info.
Is This Answer Correct ? | 2 Yes | 0 No |
List the steps/commands necessary to accomplish the following: a. Copy data from the file ORDHDR into file ORDHIST b. The file ORDHIST may or may not exist c. If the file ORDHDR does exist, it may or may not contain data d. The file ORDHIST may or may not contain data, if the file does contain data the old data should be erased
What is the use of E specification in RPG?
Is it necessary to define all formats ? Which are mandatory and which are Optional ?
what is the favicon.ico request that my site receives now and then?
Q.Suppose one job is running in a batch mode for a long time now i want to kill this batch job. how you achive this?
is there any way I can ease my rpg controls on numeric input fields? How about an input date field?
In there is 100 no. of recordsin PF, if i delete all the records. Then what is the Size of the PF?
What is the use of Data Queues?
is it possible to create a physical file without dds?
What is the maximum number of key fields allowed defining in a physical file?
What is the difference between Interactive & Batch Job?
what is the main use of OPNQRYF ?? in that query why we can use OVERDBF and in that OVERDBY why should we use SHARE(*YES)