I want to add 10 days in current date. how it is possible in
CL program...?

Answer Posted / john bulloch

DCL VAR(&JOBDATE) TYPE(*CHAR) LEN(6)
DCL VAR(&JULCHAR) TYPE(*CHAR) LEN(5)
DCL VAR(&JULNUM) TYPE(*DEC) LEN(5 0)
DCL VAR(&ISODATE) TYPE(*CHAR) LEN(10)

RTVJOBA DATE(&JOBDATE)
CVTDAT DATE(&JOBDATE) TOVAR(&JULCHAR) FROMFMT(*DMY) +
TOFMT(*JUL) TOSEP(*NONE)
CHGVAR VAR(&JULNUM) VALUE(&JULCHAR)
CHGVAR VAR(&JULNUM) VALUE(&JULNUM -10)
CHGVAR VAR(&JULCHAR) VALUE(&JULNUM)
CVTDAT DATE(&JULCHAR) TOVAR(&ISODATE) FROMFMT(*JUL) +
TOFMT(*ISO)

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how do I preserve and clean the array?

677


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

1265


How Chain operation copies the record's data to the input buffer for the program?

1084


do you use message subfiles? What are the necessary keywords required coding a message subfile?

694


how do I declare a table or array in rpg iv?

740






What is a record lock error?

1271


What is difference between bind by copy and bind by reference?

1736


When we have a file with Duplicate records and I want to read the unique record from the file. For example a file containing Emp Name as 'Ram' and there are 3 entries of it. So how to read a unique record from File?

511


how do I declare a minor?

718


What is the difference between iter and do?

680


Please tell me how to read the records from a file with load an array of size with error conditions(The logic answer for this question is ARR is array of 99 elements Z-ADD 0 IDX *LOVAL SETLL FILE READ FILE 99 *IN99 DOWEQ *OFF IDX ANDLT 99 ADD 1 IDX MOVE FIELD ARR,IDX READ FILE 99 ENDDO).So,Please give me the complete of this code.

2056


How can we override a file during runtime in rpg?

690


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

3291


what is the necessary keyword needed to scroll subfile records?

707


how do you use commitment control in rpg?

760