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 to call one program from another program in RPG? please help me with the code
what is the use of sflnxtchg?
how do I declare a minor?
We have job which is running as batch. It takes atleast 06 hours to complete tht job. But I wanna do tht job with in 3 hours?
What is the difference between iter and do?
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
what happens when sflsiz = sflpag? What are the advantages and disadvantages?
What is the purpose of record level identifier?
is this a rpg channel?
Explain mdt?
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?
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...........
what is the difference between do while and do until?
thanks mr.Harshad R Suryawaunshi,i'm new to as400 i think you are telling in rpgile i know only rpg400 if possible can you tell in rpg400
what is a rpg?