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
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)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 |
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 |
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 |
Program to read marks of 10 students for 4 subjects and compute and display total marks and status of each student in rpg
in a cl pgm records are copied to a file in qtemp a pgm is called to delete records from the file in qtemp no of records in file in library qtemp is checked wat shud be the count of records let say it was 10 initially endpgm
How I can reread the physical file in CL program once the end of file reached in same CL program.
You have a *USE authority on a Library and *All authority on a file in that Library.Can you change the data in that file?
two types of read performed in dataqueue?????
how can you display specific subfile page on the screen in unequal subfile?
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.
i'm working on progA , in that program i want to see the userids of the users who work on this program?
What is SFLNXTCHG keyword why it has used and where? Briefly explain with Example.
How would display prime numbers using CL program?
1) How to declare a file? 2) How to define a display file? 3) How to monitor error messages in RPG? 4) How to find the attributes for subfiles? and what is the DDS for subfiles?
what is the difference between the cpyf command crtdupobj command?