Show 2 ways to convert a date from YYMMDD to MMDDYY (MULT operation not acceptable)
Answer / 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 |
What is the draw back of Procedures? why we are going to Modules?
What is the Difference between command attention key and command function key ?
Define a Job Queue?
can a indexed file be accessed in arrival sequence in rpg program?
What is the difference between Array and Table?
what is the version of os/400 that we have?
How can the user implicitly open and close the files in RPG program ?
What is Job description?
is it possible to create a join logical file using two join logical files ? give exact reason for your answer
What is the symbol used for shifting fields in SDA?
in conjunction with which statements can orxx and andxx conditions be used ?
What is the default value for the number of increment for the physical file?