I want to add 10 days in current date. how it is possible in
CL program...?
Answer Posted / c4
TAATOOLS are nice but can get lost, messed up or not be loaded.
This gets the date a week back.
To add change date to YY001 if days are greater than 365 or 366 depending on leap year.
/* GO BACK A WEEK*/
DOFOR VAR(&INT) FROM(1) TO(7)
CVTDAT DATE(&DATE) TOVAR(&JULIAN) TOFMT(*JUL) +
TOSEP(*NONE)
CHGVAR VAR(&DECJULIAN) VALUE(&JULIAN)
CHGVAR VAR(&DECJULIAN) VALUE(&DECJULIAN - 1)
CHGVAR VAR(&JULIAN) VALUE(&DECJULIAN)
/* CHECK IF DECEMBER 31 */
IF COND(%SST(&JULIAN 3 3) *EQ '000') THEN(DO)
CHGVAR VAR(&YEAR#) VALUE(&YEAR)
CHGVAR VAR(&YEAR#) VALUE(&YEAR# - 1)
CHGVAR VAR(&YEAR) VALUE(&YEAR#)
/* CHECK IF LEAP YEAR */
CHGVAR VAR(&REM) VALUE(&YEAR# / 4)
CHGVAR VAR(&REM) VALUE(&REM * 4)
IF COND((&YEAR# - &REM) *EQ 0) THEN(DO)
CHGVAR VAR(&JULIAN) VALUE(&YEAR || '366')
ENDDO
ELSE DO
Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
How Chain operation copies the record's data to the input buffer for the program?
do you use message subfiles? What are the necessary keywords required coding a message subfile?
What is ment by record level identifier?
explain sflclr, sflend, sfldlt, and sflcsrrrn?
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
how can I tell when to replace the array?
What is difference between bind by copy and bind by reference?
what is a rpg?
give an eg of ACQ-(ACQUIRE),BIT OFF,BIT ON,DEALLOC,DUMP,FEOD,FORCE,MHHZO,MHLZO,MHLLZO,MLHZO,REL,RESET,TESTZ,TESTB,TESTN----GIVE SMALL EXAMPLE TO THE OPCODES...TO UNDERSTAND FUNCTIONING...........
how do you use commitment control in rpg?
what is *place and *auto keyword in prtf ?plz explain
write an RPG program to calculate the marks of 5 students (A,B, C, D, E)in 3 different subjects (eng, math, sci) an display on the screen
How to declare the pull button in AS/400..
how do I declare a table or array in rpg iv?
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.