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 are the different opcodes available in rpg for database access ?
What is array in as400? What are the types of array?
how can we run a batch job?
How we will get issues on AS/400 technology ? I mean which issue/Defect Tracking tool is using in all companies when any issue comes? Can anybody explain about the work flow of AS/400 project ? plzzz
what is sflpag and sflsiz ?
Explain this error: "all record formats for externally-described file abcd ignored or dropped due to error; file ignored."?
how many maximum spaces could be given in o specs?
What are the different opcodes used for file operation on a subfile in a rpg pgm?
what does check opcode is used?
what is the difference between udate and the system date?
how will you search an array?
what is the maximum number of fields under a record format of physical file?
what is cab?
which of the following operations does not zero the field flda defined as 4,0?
what are different record spacing keywords in rlu ?