I want to add 10 days in current date. how it is possible in
CL program...?
Answer Posted / chandrababu
We can add 10 days to current date as below..
DCL VAR(&DAY) TYPE(*CHAR) LEN(2)
DCL VAR(&D1) TYPE(*DEC) LEN(2)
DCL VAR(&MONTH) TYPE(*CHAR) LEN(2)
DCL VAR(&YEAR) TYPE(*CHAR) LEN(2)
RTVSYSVAL SYSVAL(QDAY) RTNVAR(&DAY)
RTVSYSVAL SYSVAL(QMONTH) RTNVAR(&MONTH)
RTVSYSVAL SYSVAL(QYEAR) RTNVAR(&YEAR)
SNDUSRMSG MSG(&DAY *CAT &MONTH *CAT &YEAR)
CHGVAR &D1 &DAY
CHGVAR &D1 (&D1 + 10)
CHGVAR &DAY &D1
SNDUSRMSG MSG(&DAY *CAT &MONTH *CAT &YEAR)
Also you can covert this date by using CVTDAT to any date format you like...
| Is This Answer Correct ? | 4 Yes | 6 No |
Post New Answer View All Answers
How would display prime numbers using CL program?
How can we override a file during runtime in rpg?
How Chain operation copies the record's data to the input buffer for the program?
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?
what are the key words you must use when using a subfile?
if there is a module object , how to find the program object for this module object.Assume the module object name and program object name is not same.
what is the procedure and explain about real time scenario.
How to handle duplicate error handling in RPG?
What is the diff bw PF/LF Name and their Record format name? what is restriction in record format then file name?
Program to read marks of 10 students for 4 subjects and compute and display total marks and status of each student in rpg
what is the necessary keyword needed to scroll subfile records?
What is difference between bind by copy and bind by reference?
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.
What are the types of identifiers?
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.