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

What is the syntax of passing parameters to a procedure by value?

1 Answers  


How can we override a file during runtime in RPG? Without using OVRDBF or calling a CL program

1 Answers   UST,


What is Multi Occurrence Data Structure(MODS)?

1 Answers   CTS,


What is the difference between ITER and DO ? I know both are used to execute set of statements repeatedly, but what is the main difference?

2 Answers   CGI, Wipro,


How to print output from openquery in as400 ?

1 Answers   Four soft,






We have a Physical file, after reading 5 records,it has to read LF of that same Physical file,Will it start reading from Ist record or will start reading from 5th record?

5 Answers   Hexaware,


2. Which of the following statement(s) explains the difference(s) between the /INCLUDE and ICOPY directives? a.) No difference, they function the same b.) ACOPY cannot be used as a conditional directive c.) IINCLUDE files cannot contain embedded SQL d.) Nesting /TNCLUDE directives is not allowed

2 Answers   IBM,


What are the values of NUM1 and NUM2 after executing the following code? CLONO1NO2NO3 Factorl÷÷+OpcdeFactor2+÷+ResultLenDHHiLoEq C MOVE *LOVAL NUM1 50 C MOVE *J-fIVAL NtJM2 52

2 Answers   Fiserv, IBM,


In how many ways a session/device error occurs,,, and what is the remedy for it?

3 Answers  


What will be your approach in going either for OPNQRYF or Logical files. Which one to go for?

2 Answers  


how can an indexed file be used as arrival sequence in RPG?

3 Answers   IBM,


how many variables can we declare in cl pgm?

13 Answers  


Categories