Q:Hi all,i want accurate answer with code using in built
functions.please sent me code as soon as posible.

I have program nmed PGM1 which '' RETRIEVE Current
production date''should correctly default the production
date for the user who is issuing raw materials to the
manufacturing.The production date can be different from the
celendra date.
However, the program does not make the correct adjustment
for all manufacturing plants.

there is a parameter which determines the
production start time e.g. 07:00 if the system time
precedes this,the program subtracts one from the celendra
day.This work fine when the celendar day starts after
production day as it does in England,the system should be
adding one to the celendar day during the overlap.
unfortunately the program was desined to assumed the
celendar day always starts before the production day.

Change required in the program:
Change the
PROGRAM PGM1 to use the new parrameter to decide whether to
add or subtract 1 from the celendar day when determining
the production date.



Q:Hi all,i want accurate answer with code using in built functions.please sent me code as soon as ..

Answer / Sarita Chaudhary

To modify the program, you can introduce a conditional statement that checks if the system time is before or after the production start time. If the system time is before the production start time and the calendar day has not started yet (i.e., the calendar day is less than the production start day), add 1 to the calendar day. Here's an example in RPGLE:nnEDIT PGM1nnDEC L(CalendarDay) LIKE DATE,n (ProductionStartTime AS %TIME VALUE '07:00') BINARY,n (SystemTime AS %TIME VALUE SYSTIME()) BINARY;nnIF (%TIME DIFF SYSTIME() ProductionStartTime) < 0 THENn IF DAY(SYSDATE()) = DAY(ProductionStartTime) THENn CALC L = SYSDATE() + 1;n ELSEn CALC L = SYSDATE();n ENDIF;nELSEn CALC L = SYSDATE();nENDIF;nnRETAIN PRODUCTION_DATE TYPE DATE VALUE L.nRETURN.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More RPG400 Interview Questions

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,


ESCAPE message sent by child program can be handled by parent program using which keyword?

2 Answers  


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

2 Answers  


Suppose you have 3 members in a database file. How to read records from all the members without using CL (OVRDBF) i.e. Entire process should be handled exclusively in a RPG program?

7 Answers  


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?

1 Answers  


In a particular program one file is used where override command is applied to a file, now this program calls another program where we want to use the same file but without override.How it can be done?

6 Answers   Hexaware,


1.The questions have given an array declaration and move operation then this statement is correct or not?

3 Answers   TCS,


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?

6 Answers   Mind Tree,


can you debug ile rpg program using isdb?

1 Answers   IBM,


I have 1000 records in a file. I would like to generate 10 identical reports from this record with same format (structure of records) how do I do this?

1 Answers   IBM,


How to get only unique records from a file which contains duplicate data using CPYF command ? Example : FILEA has duplicate records and FILEB is a UNIQUE defined.... and I want to get the data from FILEA to FILEB by eliminating all the duplicate records...

2 Answers  


Can more than one subfile record be displayed on one line?

7 Answers   IBM,


Categories