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 |
how to change the length of the field in a physicalfile?
Anyone help me for the below question:- If problem/error occur in *PSSR subroutine,how should I handel it in RPG program.
without logical file we cannot access the data in physical file.but we specify physical file in the program(ie:- Ffile IF E k disk).how can it be accessed?
What is the difference Return and InLr?
1.find most occurrences of a character. for exm: input:aaabbbbdddddyyy output: d 5 times how can i get that?
How can we make use of SETLL operation in CL?
How to select highest score of each subject or how to select highest income of every month?
1. What is bound-by-call and bound-by-reference? 2. Where and why is *Nomain used? 3. What are the difficulties faced by programmers when using service programs? 4. Explain the different ways of parsing and compiling XML in iSeries.
i have a file with the values 10, 20, 30, 40, if am setll with the value 25 then readp, so what it will return?
How do you code file / field renames in ILE RPG?
How to update selected fields from pf without using update opcode. How to read all member in Rpg-3,without using any cl command?
How do you find out whether a record is present in the physical file without reading the file? for Example Employee No: 100 in an Employee master.How do we find out whther 100 is present in Employee master without reading the file?
11 Answers Bank Of America, CSC, IBM,