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

Can somebody tell me that, Is it possible to read all the member of PF without OVRDBF?

6 Answers  


Can we possible to key with the date field?

1 Answers   IBM,


Q:HI friends accually ihave one problem plesase let me know the alternate code of this code. Related field description of code: Add a field, CALvsPRD, "Calendar Day Starts Before/After Production Day" to the parameter set WRKORDER which accepts values 'A' or 'B' o B = Calendar Day Starts Before Production Day o A = Calendar Day Starts After Production Day o Any other value indicates the production and calendar dates are always the same. code: Automatic Execution Of *INZSR Subroutine /Z01 * retrieves WRKORDER field values. /Z01 * Calculate default Production Date and return it to caller. /Z01 * Production date defaults to system date /Z01 C Eval P@Pdate = %DATE() /Z01 * unless Calendar date starts Before PDN(production) date and /Z01 * system time is before PDN Start Time then /Z01 * PDN date is yesterday. /Z01 C If W@CALvsPRD = 'B' and /Z01 C %TIME() < %TIME (W@Strtime) /Z01 C Eval P@Pdate -= %Day(1) /Z01 * unless Calendar date starts After PDN date and /Z01 * system time is *GE PDN(production) Start Time then /Z01 * PDN date is tomorrow. /Z01 C ElseIf W@CALvsPRD = 'A' and W@Strtime > *Zero and /Z01 C %TIME() >= %TIME (W@STrtime) /Z01 C Eval P@Pdate += %Day(1) /Z01 C EndIf /Z01 C Eval *InLr = *On

0 Answers   IBM,


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

0 Answers   IBM,


i have 6 char field in program, but this field is using in all files i want to chage field size as 10 char , how can i do this except using *like defn...?

1 Answers   IBM,






Assume my file has 100 records and I want to see only first 10 records. Is this possible through lf?

1 Answers  


please guys help me,I need to write a program that shows more than one way to display a subfile. Both views are of the same file but sorted differently and show different fields of the same file when the user presses a function key. send me code

4 Answers   Virtusa,


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?

1 Answers  


CAN WE READ RECORDS WITHOUT USING SETLL,READ,CHAIN IN RPG?

6 Answers   Satyam,


what is data area and how it is used in rpg program ?

0 Answers   IBM,


what is the difference between do while and do until?

0 Answers   IBM,


What is the OPEN and CLOSE accesspath?

3 Answers   CTS,


Categories