Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

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

1716


what is the use of sflnxtchg?

1249


how do I declare a minor?

1155


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?

1240


What is the difference between iter and do?

1202


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

1302


what happens when sflsiz = sflpag? What are the advantages and disadvantages?

1185


What is the purpose of record level identifier?

1119


is this a rpg channel?

1161


Explain mdt?

1120


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?

1096


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...........

3823


what is the difference between do while and do until?

1237


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

2308


what is a rpg?

1185