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
can I touch the array during treatments?
Explain mdt?
what is an online rpg?
thanks mr.Harshad R Suryawaunshi,i'm new to as400 i think you are telling in rpgile i know only rpg400 if possible can you tell in rpg400
Interviewer asked me write down DDS for load all subfile .can anybody write dds
How to call one program from another program in RPG? please help me with the code
What is file identifier where we can use?
what is the necessary keyword needed to scroll subfile records?
1. What is bound-by-call and bound-by-reference? 2. Where and why is *Nomain used? 3. What are the difficulties faced by programmers when using service programs? 4. Explain the different ways of parsing and compiling XML in iSeries.
write an RPG program to calculate the marks of 5 students (A,B, C, D, E)in 3 different subjects (eng, math, sci) an display on the screen
what is data area and how it is used in rpg program ?
what is the procedure and explain about real time scenario.
what do you mean by an input subfile, what are the keywords required?
do you use message subfiles? What are the necessary keywords required coding a message subfile?
When it is desirable to describe files Internally?