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
can a indexed file be accessed in arrival sequence in rpg program?
What are the types of data structure in as400?
which of the cl command can be used to determine which logical files are dependent on a specific file?
what is the difference between udate and the system date?
how many printer files maximum can be used in single rpg program?
explain the purpose of keep and assume keywords?
is there any way I can ease my rpg controls on numeric input fields? How about an input date field?
which cl command is used to trap error messages during program execution?
how many files can be defined in f specs?
what is a keyed physical file?
how would you design the process for a nightly, high volume check producing process that needs to select only records that are flagged to be processed?
Write a logic program for knowing the repeated number of a vowels in a given program?
how will you search an array?
What is the Difference between command attention key and command function key ?
what opcode will be used to test the zone of a character field?