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 anybody tell me that why we use option(*nodebugio)in H- Spec?

3 Answers  


wat is meant by hidden field , why it is used?

4 Answers   Four soft,


How to read a record from file where there is multiple record occurrence is available?

1 Answers  


what is the equivalent keyword for CHAIN opcode ??

7 Answers   TCS,


HOW DO YOU DISPLAY A DISPLAYFILE AT OTHER WORKSTATION? CAN WE MOVE A PHYSICAL FILE? WITHOUT MOVING A FILE?

2 Answers  


Hi, Can anybody give me real sinario for SFLRCDNBR?with example?

2 Answers  


What is the length of Signature?

3 Answers   UST,


How do you find out whether a record is present in the physical file without reading the file? for Example Employee No: 100 in an Employee master.How do we find out whther 100 is present in Employee master without reading the file?

11 Answers   Bank Of America, CSC, IBM,


can you debug ile rpg program using isdb?

0 Answers   IBM,


How do you proceed in case your active AS400 session has got disconnected suddenly, how can you get back to your session ? Is it possible??

1 Answers  


How to get only unique records from a file which contains duplicate data using CPYF command ? Example : FILEA has duplicate records and FILEB is a UNIQUE defined.... and I want to get the data from FILEA to FILEB by eliminating all the duplicate records...

2 Answers  


what is importance of 'MAPFLD' IN OPNQRYF FILE ?

2 Answers  


Categories