How to update physical file in rpgle without using display
file?

Answers were Sorted based on User's Feedback



How to update physical file in rpgle without using display file?..

Answer / anurudh dwivedi

this can be done wid 2 methods
1.Interactive SQL
2.Embedded Sql
1. In interactive Sql
Strsql(Command line)
update pf001
set sal=sal+30
where id=1
2. same in embedded sql but save your object of type SQLRPGLE
c/exec sql
c+ update LIB1/pf001 set sal = sal + 30 where id=1
c/end-exec
save and compile(when u will compile,,,, u would be shock!!! update will not work)
but after following steps:
journaling it will work.

Is This Answer Correct ?    13 Yes 0 No

How to update physical file in rpgle without using display file?..

Answer / mathan kumar

Ffile1 ufe disk
key chain rec1
if %found
update rec1
endif

Is This Answer Correct ?    10 Yes 3 No

How to update physical file in rpgle without using display file?..

Answer / sivaprasad

by using update opcode we can do the update before tht we
must read tht file

Is This Answer Correct ?    3 Yes 0 No

How to update physical file in rpgle without using display file?..

Answer / san

HERE EMPLIST IS MY PHYSICAL FILE I OPENED IN UPDATE MODE AND
NAME,ID,BRANCH,SEX IS THE PHYSICAL FILE FIELDS. IT IS VERY
EASY WAY JUST FIRST U HAVE TO READ THE RECORD FORMAT OF
PFILE AND EVALUATE THE VALUES WHICH U WANT INTO THE FIELDS
NOTE THAT FOR CHARACTER FIELDS SPECIFY THE STRING IN SINGLE
QUOTE AND NUMERIC WITHOUT QUOTES AND GIVE THE VALUES TO THE
FIELDS BASED ON THE LENGTHS WHICH U HAD DECLARED IN PFILE. I
THINK I EXPLAINED VERY BRIEFLY K CHEERS BYE KEEP LEARNING .

FEMPLIST UF A E K DISK
/FREE
READ E;
NAME = 'SAN';
ID = 12345 ;
BRANCH= 'CSE';
ADDR = 'HYDERABAD';
SEX = 'MALE';
UPDATE E;
*INLR = *ON;
/end-free

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More RPG400 Interview Questions

can anyone explain aboutovrOVRDBF,OPNQRYF, OVRSCOPE and OPNSCOPE?

2 Answers   TCS,


what is program status data structure?

1 Answers   IBM,


What does Implicit Open means with respect to a file ? What about the Explicit Open?..what are the major differences between these two?

1 Answers   IBM,


What is SFLNXTCHG keyword why it has used and where? Briefly explain with Example.

2 Answers   IBM,


What is difference between bind by copy and bind by reference?

0 Answers  






What is ment by record level identifier?

0 Answers  


How can you determine the number of characters in a variable?

3 Answers  


Assume my file has 100 records and I want to see only first 10 records. Is this possible through lf?

1 Answers  


How to handle duplicate error handling in RPG?

0 Answers  


how to retrieve RRN value in RPGLE program

3 Answers  


1.Are there any errors in the following statement?If so then list them.DTAARA is a data area having a field EMP # and EMPNO is a field in the file EMPPF.Which has one record. READ EMPPF IF %FOUND(EMPPF) IN DTAARA EVAL EMP#=EMPNO OUT DTAARA ENDIF

5 Answers  


what is a rpg?

0 Answers   IBM,


Categories