can we use cl programming to update or delete physical files
Answer Posted / 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 |
Post New Answer View All Answers
what happens when sflsiz = sflpag? What are the advantages and disadvantages?
What is ment by record level identifier?
what is the use of sflnxtchg?
Interviewer asked me write down DDS for load all subfile .can anybody write dds
what are the key words you must use when using a subfile?
can I touch the array during treatments?
what is *place and *auto keyword in prtf ?plz explain
What is the purpose of record level identifier?
How to create a login screen using a command instead of display file.... intention is to get a password field on a command..... how do you achieve this...
during execution, an rpg/400 program automatically follows a sequence of operations for each record that is processed. The built-in program cycle includes the following logical steps.
Hi Viewers can any body explain me how to update and ahange the already existed data in physical file using subfile ? please explain me with the code if possible?
can you debug ile rpg program using isdb?
What is the difference between iter and do?
How to handle duplicate error handling in RPG?
explain sflclr, sflend, sfldlt, and sflcsrrrn?