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?

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do u design a physical file, when you have 2 Unique fields like for eg in A student file student ID and student examination no both are unique

549


can I touch the array during treatments?

759


If my rpg program has a date field, what extra care I have to take while compiling that rpg program? If the file is keyed and I have declared the file as well as key list properly in my program. Still am getting an error message like "chain/reade operation is not allowed" what may be the case?

622


do you use message subfiles? What are the necessary keywords required coding a message subfile?

690


Suppose we have one database file and it is used by 5 programs and in 3 program we have to add some records in datbase file s what is the impact on other program?

1456






what is the difference between do while and do until?

710


Hi Viewers can any body explain me how to update and ahange the already existed data in physical file using subfile ? please explain me with the code if possible?

4214


When it is desirable to describe files Internally?

1190


What are the types of identifiers?

573


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

2015


How to call one program from another program in RPG? please help me with the code

1261


How many program bind in one module....

2125


how does the rpg element work?

718


what is file information data structure?

1376


1.Load an runtime array of length 99 from the pf and you want to handle all the possible errors?

2374