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
during input operation which indicator position is seton if there is a record lock?
what are the different opcodes available in rpg for database access ?
How can we change the uppercase to Lowercase in RPG?
what is rpg ?
is their a difference in cobol400 for the release 5.2 and 6.1 at the as400.
when should I use method get, and when should I use method post in my cgis?
what is the maximum number of subroutines allowed in rpg?
can error messages as a result of a comp, range or values keyword be overridden?
how to validate input values in display file ?
define the purpose/use for sflrna?
how does the runqry show the output?
what is the clp command to access a query/400?
give three main purposes of file specification ?
Difference between NOPASS & OMIT?
How do you check object lock