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

1.I have a Physical file with 100 records, No duplicates exists, all are Unique,But while i am running Runqry utility i am getting only 80 records..What could be the reason?

3 Answers   Cap Gemini,


there is any limit to display the members in rpg400?

3 Answers  


What is the purpose of record level identifier?

0 Answers  


suppose i i am changing / updating record of subfile and i want to change the record in reverse order . means i want to change the bottom record first and so on through readc . how i do it please any one explain .

4 Answers   CSC,


How can we receive values from a called procedure in RPG?

1 Answers  






How to index LF by relative record no (RRN)

1 Answers  


Can anybody tell me the setps to create .csv file in IFS folder on AS/400. I also need to know how I can send this .csv file to PC in xls sheet.....?

2 Answers  


1.Can any body share me about thease opcodes with example please.Im new for AS/400.Could u please tell me in real senario? 1.TESTN, 2.EVAL 3.EVALR, TIME, 4.MONITOR 5. ENDMON 6.ON-ERROR 7.COMMIT ROLLBACK?

1 Answers   CSC,


how do u find whether a record is locked or not??

4 Answers   CTS,


can i use UPDDTA command in rpg program in which contains a file

1 Answers   TCS,


What is the purpose of Panel Groups?

4 Answers  


I have to change a program. This program is calling a subroutine mor than 100times within it. so will it have any performance issue? if yes than what changes i can make. Thanx for ur valuable answer.

2 Answers  


Categories