How to update physical file in rpgle without using display
file?
Answers were Sorted based on User's Feedback
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 |
Answer / mathan kumar
Ffile1 ufe disk
key chain rec1
if %found
update rec1
endif
| Is This Answer Correct ? | 10 Yes | 3 No |
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 |
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 |
what is importance of 'MAPFLD' IN OPNQRYF FILE ?
When will DUMP & DEBUG be ignored?
If I have a file with 5 record and that file has 2 Key field and I want to read the unique record of the file then how can we achieve it?
parameters cannot be passed in which one???
what is plat file?
How I can reread the physical file in CL program once the end of file reached in same CL program.
What you have to do in the display file when you are using message subfile?
how we create binder member for updating service program and where we type this code on command line or in program ? strpgmexp pgmlvl(*current) export symbol (xyz0 endpgmexp. plz explain me this step by step .
1. I have2 records in a PF. READ PF DO DSPLY EMPNO RETRN DSPLY EMPNO ENDDO What was the output 2. SETON LR vs RETURN 3. Primary File 4. How to delete a deleted spaces 5. How to read a PF in reverse order in CL 6. I have a object in Lib A, B and C. But it shows in D Lib..Why? 7.
difference between 1:%found and %equal built function in detail with example .
Can we possible to key with the date field?
1.what are the ARITHMETIC EXPRESSIONS IN CL PGM? 2.How to PASSING PARAMETER TO CL PGM?