Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


can we use cl programming to update or delete physical files

Answers were Sorted based on User's Feedback



can we use cl programming to update or delete physical files..

Answer / anish

Although there are no keywords to update or insert or
delete records in a CL program, we can do the same with the
help of a 'RUNSQLSTM' statement. With this command we can
runa query directly from the CL program and do an
insert/update/delete without calling an RPG program.

Plzz let me know if my understanding is corerct.

Is This Answer Correct ?    32 Yes 4 No

can we use cl programming to update or delete physical files..

Answer / saravan

We can clear file using CLRPFM command.
If we want delete PF we can use DLTF command.
But before delete any PF first of all we need to
delete all the LFs related in that PF.(DSPDBR=Display Data
Base Relations,we can get all LFs relating to that PF)You
must give the correct Library name for all the commands
above.
For UPDATE, DELETE & INSERT, use RUNSQL command.
Ex: RUNSQL (UPDATE LIBR/FILE SET FLD = 'XXX'
WHERE CONDITION)
Note: RMVM is to delete/remove a member from a file. But
not to delet a file completely.

Is This Answer Correct ?    18 Yes 2 No

can we use cl programming to update or delete physical files..

Answer / narender

No, you can access the records using the CL program but
can't perform any operation other then reading the records.

Is This Answer Correct ?    19 Yes 10 No

can we use cl programming to update or delete physical files..

Answer / chirag

Hi,

First you need to create a TXT source in which you need to
provie the update command.
Next in CL program you should use the command RUNSQLSTM on
this source(TXT).
So whenever you have to change another record you need to
simply change and save the TXT source.

Examply:

Data on file, PF1:
FLD1 FLD2 FLD3
000001 001 AAA BBB
000002 002 BBB CCC
000003 003 CCC DDD
000004 004 XXX ZZZ


Member1, Name: PGM1 , Type: TXT
UPDATE PF1 SET FLD3 = 'CHG' WHERE FLD1 = '004';


Member2, Name: PGM2 , Type: TXT
PGM
RUNSQLSTM SRCFILE(LIB1/SRCFILE) SRCMBR(PGM1) +
COMMIT(*NONE)
ENDPGM

Compile the PGM2 and call it.

Now Result for data on PF1
FLD1 FLD2 FLD3
000001 001 AAA BBB
000002 002 BBB CCC
000003 003 CCC DDD
000004 004 XXX CHG

Is This Answer Correct ?    9 Yes 3 No

can we use cl programming to update or delete physical files..

Answer / nirosh

We can clear all records from the physical file using
CLRPFM command. If we want delete PF we can use DLTF
command.But before delete any PF first of all we need to
delete all the LFs related in that PF.(DSPDBR=Display Data
Base Relations,we can get all LFs relating to that PF)You
must give the correct Library name for all the commands
above. I don't know how to update PF from the CL
programming.

Is This Answer Correct ?    7 Yes 2 No

can we use cl programming to update or delete physical files..

Answer / sree

ok friends what is use of "RUNSQLSTM"

Is This Answer Correct ?    6 Yes 1 No

can we use cl programming to update or delete physical files..

Answer / lama

We can not perform update operation by using CL

Is This Answer Correct ?    12 Yes 9 No

can we use cl programming to update or delete physical files..

Answer / kamal

YES BY USING RUNSQLSTM

Is This Answer Correct ?    5 Yes 2 No

can we use cl programming to update or delete physical files..

Answer / ismail

Yes, With the help of 'RUNSQLSTM' command, we can able to
update/insert/delete record in PF.

Is This Answer Correct ?    2 Yes 1 No

can we use cl programming to update or delete physical files..

Answer / dinesh

we can not update pf
using cl because there is no such
keward

Is This Answer Correct ?    3 Yes 4 No

Post New Answer

More RPG400 Interview Questions

1. I have2 records in a PF. READ PF DO DSPLY EMPNO RETRN DSPLY EMPNO ENDDO What was the output 2. SETON LR vs RETURN 3. Primary File 4. How to delete a deleted spaces 5. How to read a PF in reverse order in CL 6. I have a object in Lib A, B and C. But it shows in D Lib..Why? 7.

4 Answers   HCL,


I have two sessions S1 & S2 under this 3 jobs(say j1,j2,j3 under session S1) And 2 jobs(Say j4, j5 Under session S2)is running. How many QTEMP & how many LDA will create for the same.

9 Answers   IBM,


Suppose i am having 3 programs PgmA,pgmB,pgmC and using source debugger. At debugging time i found that pgmC having some code error..then in debug mode directly how can i debug pgmC

2 Answers  


wat is scan and check ? give me real time scenarios where we used these keywords in ur projects?

2 Answers   Four soft,


A rpg or clp command to find if the file field is defined as a character or numeric field.

1 Answers   IBM,


without logical file we cannot access the data in physical file.but we specify physical file in the program(ie:- Ffile IF E k disk).how can it be accessed?

3 Answers   HSBC, TCS,


What is file identifier where we can use?

0 Answers  


What is journalling and commitment control?

3 Answers   IBM,


What is use of IMPORT and EXPORT in RPGLE ? What is activation Group ? What is Service Program ???? How to call another program in RPGLE ?

1 Answers  


Suppose you have 3 members in a database file. How to read records from all the members without using CL (OVRDBF) i.e. Entire process should be handled exclusively in a RPG program?

7 Answers  


steps for debugging two rpg programs????

4 Answers  


What is the difference between ITER and DO ? I know both are used to execute set of statements repeatedly, but what is the main difference?

2 Answers   CGI, Wipro,


Categories