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 ?    32 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

i)What is the command to lock a file in a program ii)2. Can you get a level check error in a CL program

6 Answers  


One of the job in subsystem is in Running status,expected time to complete this job is 2 minutes. But from last 5 -10 minutes this job is still in running status....What are the possible reasons...and What are the actions i need to perform to check this...?

4 Answers  


i have a file with the values 10, 20, 30, 40, if am setll with the value 25 then readp, so what it will return?

6 Answers   Mind Tree,


Q1.How to read the Array? Q2.How to copy the content of one Array to another Array?

4 Answers   IBM,


How to call one program from another program in RPG? please help me with the code

0 Answers   HCL,






3 members in a databasefile .how to read records from all the members?????????

4 Answers   CTS,


What is the OPEN and CLOSE accesspath?

3 Answers   CTS,


how many variables can we declare in cl pgm?

13 Answers  


As Packed veriable store 2 digits in 1 byte and ZONE variable store 1 digit in 1 byte... Please tell me when we have to use Packed and Zone variable...?

1 Answers  


What hapens when we use CPYF command to copy a LF? On which PF will it be dependent???

7 Answers   HSBC, Systime,


We have a Physical file, after reading 5 records,it has to read LF of that same Physical file,Will it start reading from Ist record or will start reading from 5th record?

5 Answers   Hexaware,


what do you mean by SESSION/DEVOCE ERROR?

1 Answers   IBM,


Categories