How to update only a field of a PF in an RPG program.
I don't want to update the record, only one field.

Answers were Sorted based on User's Feedback



How to update only a field of a PF in an RPG program. I don't want to update the record, only ..

Answer / s.kumar

If file FileA has fields field1, field2, field3, and we
want to write out field2 only ...

C...except..Change

OfileA...E...Change
O...............field2

Hope it will work fine.

For Free Format try out following...

Update Recformat %fields(field2);

Is This Answer Correct ?    33 Yes 1 No

How to update only a field of a PF in an RPG program. I don't want to update the record, only ..

Answer / kapil kumar

Use CHAIN for that record
then EVAL fld='value'
UPDATE pfrecfmt

Is This Answer Correct ?    1 Yes 24 No

Post New Answer

More RPG400 Interview Questions

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  


can anybody help me to solve this problem. the program that i m checking display error message saying "Record format for file AJDSPFFD does not match model file and decimal error. how to solve this problem. The AJDSPFFD is snapshot the AJTLOG that is the audit trail list.

0 Answers  


how can I tell when to replace the array?

0 Answers   IBM,


How can read PF in reverse order (end to start) in CL pgm..

8 Answers   TCS,


can anyone say,what is the use of operation extended H/N/P?

2 Answers  


How to declare the pull button in AS/400..

0 Answers  


How to add 2 new fields in a file? How many ways are there in as400?

2 Answers  


3. Given the DOS Specification below and the following information: • Indicator 50 is off • No records have been written to the subfile What will be the result if the EXFMT operation code is performed on the record format CTLR? A R SUBFL A DESCRIP 101 6 1ODSPATR(UL) A DFT(’NOT FOUND’) A R CTLR SFLCTL(SUBFL) A N50 SFLDSP A SFLDSPCTL A SFLINZ A 67 SFIJEND A SFLSIZ(13) A SFLPAG(12) A ACCOUNTNO 100 S 10 a.) Only AccountNo will display b.) SUBFL will be initialized with 13 blank records c.) An I/O exception error will occur d.) The screen will display 12 records with ‘NOT FOUND’

4 Answers   IBM,


what is importance of 'MAPFLD' IN OPNQRYF FILE ?

2 Answers  


Anybody know the difference of primary file and full procedural file

4 Answers  


I want my simple Green screen should refersh every 1 min ,How can I do it..? Please share the logic

2 Answers  


Why did we give STRSRVJOB while debugging batch program

3 Answers   HBL Power Systems,


Categories