Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


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?

Answers were Sorted based on User's Feedback



1.Suppose my file has 10 fields and I want to make the 2nd field Zeros in all records. And assume I..

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

1.Suppose my file has 10 fields and I want to make the 2nd field Zeros in all records. And assume I..

Answer / naga srinivas

1)Using SQL, we can set second field value as '0'

2)Based on RRN number we can retrieve the first 10 records
or otherwise copy the first 10 records using CPYF command
and you can use RUNQRY for new created file

3)Write a CL program in which u have to submit the 'A' job
after completion you can write code for 'B' and after 'C'

Is This Answer Correct ?    1 Yes 1 No

1.Suppose my file has 10 fields and I want to make the 2nd field Zeros in all records. And assume I..

Answer / sujatha

3. Submit job B can be included at the end of call program
in SBMJOB A. Likewise SBMJOB C can be done at the end of
call program of job B.

SBMJOB Call A

Program A:
----------
PGM
....
....
MONMSG CPF0000 GOTO END
SBMJOB B
END: ENDPGM

Program B:
-----------
PGM
.....
.....
MONMSG CPF0000 GOTO END
SBMJOB C
End: ENDPGM

Is This Answer Correct ?    0 Yes 0 No

1.Suppose my file has 10 fields and I want to make the 2nd field Zeros in all records. And assume I..

Answer / ganesh.kandaswamy

Just thought of answering the 3rd question. Basic logic is to make sure the job A is completed before we submit B and similarly on B to submit job C.

Following are the approaches to make sure a job is completed :

1. Allocate a data area before the job gets submitted and check for lock. Once the job is over deallocate and proceed to next job B to submit
2. Using QUSLJOB API

Is This Answer Correct ?    0 Yes 0 No

Post New Answer



More RPG400 Interview Questions

how to change the length of the field in a physicalfile?

12 Answers  


Suppose you have 3 members in a database file. How to read records from all the members without using CL (OVRDBF) i.e. Entire process should be handled exclusively in a RPG program?

7 Answers  


In single page subfile,if I select the mutiple options in 1 page and without pressing enter,I press rollup key (pagedown).In such case how I can handle it in rpg becasue in single page we have to handle it in pgm. It would be helpful if any one answer with coding

4 Answers   Infinite Computer Solutions,


which MONMSG will give higher priority in CL program? I know MONMSG are of two types. Program Level Monmsg and Command Monmsg?

1 Answers  


Difference between RESET and CLEAR

1 Answers   TCS,






how do you use commitment control in rpg?

0 Answers   IBM,


When will DUMP & DEBUG be ignored?

3 Answers   IBM,


where we give the MSGSFL in rpg400?

4 Answers  


Why did we give STRSRVJOB while debugging batch program

3 Answers   HBL Power Systems,


use of PUTOVR,OVRDTA,KEEP keywords?

2 Answers   HCL,


I have some doubts on subfile----------- -----I wrote a prog on subfile to display the records. Every thing is clear but i defined a field called "opt" as input field in subfile record format from that input field i wish to enter into new screen called "EDIT" which i created it as a separate RCD in display file. i gave opt as 2 for edit just like in WRKMBRPDM screen please telll me the code and how can i code for it in RPG.

3 Answers  


Have a join logical file with more than one members with different record formats. So how can we read the different members from this file and also how we can read the different record format from the join logical?

3 Answers  






Categories