1.Suppose my file has 10 fields and I want to make the 2nd
field Zeros in all records. And assume I have millions of
records and I dont want to read each record and update the
desired field with 0. Any other way to do this in one step
operation?
2. Assume my file has 100 records and I want to see only
first 10 records. Is this possible through LF?
3.I have 3 jobs A B and C. I want to submit B after
successful completion of A and want to submit C after
successful completion of B. Without using job scheduler or
job queue, how can i do that through CL program?
4.What is difference between Bind by copy and bind by reference?
Answer Posted / raj
1. STRSQL give UPDATE cmd and take f4 in where condition fld2=*zeros
2. copy first 10 recods to another file BY using CPYF GIVE RUNARY
(OR)
fld2 read file 50
*in50 doweq *off
add 1 a 20
if a>=11
leave
endif
read file 50
enddo
(or)
read the records one by one if it cross 11th record give LEAVE opcode.
4. bind by copy: here module will static
bind by reference: here module will be dynamic.
| Is This Answer Correct ? | 6 Yes | 1 No |
Post New Answer View All Answers
When we have a file with Duplicate records and I want to read the unique record from the file. For example a file containing Emp Name as 'Ram' and there are 3 entries of it. So how to read a unique record from File?
how can you display specific subfile page on the screen in unequal subfile?
what do you mean by an input subfile, what are the keywords required?
during execution, an rpg/400 program automatically follows a sequence of operations for each record that is processed. The built-in program cycle includes the following logical steps.
how can I tell when to replace the array?
what is the use of sflnxtchg?
how do I play {insert rpg system here}?
What is ment by record level identifier?
What is the difference between copybooks and subprocedures in as400?
What is a record lock error?
Assume 2 users are using the same file and first user updates some record in the file. Will the 2nd user will be able to see the updated record or not?
How to call one program from another program in RPG? please help me with the code
Interviewer asked me write down DDS for load all subfile .can anybody write dds
What is the diff bw PF/LF Name and their Record format name? what is restriction in record format then file name?
Suppose we have one database file and it is used by 5 programs and in 3 program we have to add some records in datbase file s what is the impact on other program?