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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How Chain operation copies the record's data to the input buffer for the program?

1084


How can we override a file during runtime in rpg?

690


Hi Viewers can any body explain me how to update and ahange the already existed data in physical file using subfile ? please explain me with the code if possible?

4216


We have job which is running as batch. It takes atleast 06 hours to complete tht job. But I wanna do tht job with in 3 hours?

774


How can we know running job is batch or interactive?

660






how do you use commitment control in rpg?

759


how do I declare a table or array in rpg iv?

739


What is the difference between copybooks and subprocedures in as400?

814


how do I play {insert rpg system here}?

587


what is the use of sflnxtchg?

805


Program to read marks of 10 students for 4 subjects and compute and display total marks and status of each student in rpg

721


Please tell me how to read the records from a file with load an array of size with error conditions(The logic answer for this question is ARR is array of 99 elements Z-ADD 0 IDX *LOVAL SETLL FILE READ FILE 99 *IN99 DOWEQ *OFF IDX ANDLT 99 ADD 1 IDX MOVE FIELD ARR,IDX READ FILE 99 ENDDO).So,Please give me the complete of this code.

2056


Set on command is used for closed all opened files , initialize var and release resource , return cmd is used for return to calling program but my req. Is dnt close opened files and resource must released while doing transactions , how can i do this...?

1466


what is the necessary keyword needed to scroll subfile records?

706


is this a rpg channel?

681