Show 2 ways to convert a date from YYMMDD to MMDDYY (MULT operation not acceptable)
Answer Posted / sanjeet kumar
1)CVTDAT() DATE() RTNVAR() FROMFMT() TOFMT()
Source code is required to convert from one date format to another date format.
The source code in CLP is given below:
PGM
DCL VAR(&VAR1) LENGTH(6) TYPE(*CHAR) VALUE('YYMMDD')
DCL VAR(&RCVD) LENGTH(6) TYPE(*CHAR)
DCL VAR(&VAR2) LENGTH(4) TYPE(*CHAR)
DCL VAR(&VAR3) LENGTH(2) TYPE(*CHAR)
CHGVAR VAR(&VAR2) VALUE(%SST(&VAR1 3 4))
CHGVAR VAR(&VAR3) VALUE(%SST(&VAR1 1 2))
CHGVAR VAR(&RCVD) VALUE(&VAR2 *CAT &VAR3)
SNDMSG MSG(&RCVD) TOUSR(*USRPRF)
ENDPGM
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
what is the difference between *like and *namvar ?
describe the difference between the dowxx and douxx operations?
which single rpg opcode performs both setll and reade?
what opcode will be used to test the zone of a character field?
what would be the effect on the field where reverse image, underline and highlight display attributes are active ?
WHAT IS AS/400 SYNORIO?
which are the member types which seu supports?
If i change any file through application after entering data , how to check which file is updated through applications . For call stack we takes esc 3 then we chose 11..But What is answer of below qtn..?
What is %CHECK?
what is rpg ?
what is the maximum number of records you can specify in a display file?
how do you use exceptional write in c specs?
which type of object is used in db2/400?
What Is Ddm ?
Difference Between Interactive & Batch Job?