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

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


Please Help Members By Posting Answers For Below Questions

what happens when sflsiz = sflpag? What are the advantages and disadvantages?

1240


What is ment by record level identifier?

1186


what is the use of sflnxtchg?

1314


Interviewer asked me write down DDS for load all subfile .can anybody write dds

1780


what are the key words you must use when using a subfile?

1234


can I touch the array during treatments?

1213


what is *place and *auto keyword in prtf ?plz explain

3213


What is the purpose of record level identifier?

1169


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...

1936


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.

1277


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?

5232


can you debug ile rpg program using isdb?

1335


What is the difference between iter and do?

1260


How to handle duplicate error handling in RPG?

2347


explain sflclr, sflend, sfldlt, and sflcsrrrn?

1395