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 |
How many Printer Files can Declare in a CL Program?
what are the types of errors available in rpg IV or 400.Like decimal data error,sessional error or device error etc...means important error occurings,ie to find out suddenly???pls give answ if u know?
What is compiler directive in as400? Give example of compiler directive.?
PGM QSH CMD('/QOpenSys/bin/sftp -b/home/test/myfile.txt serverUserID@server') ENDPGM In above example,what is content of myfile.txt ...Thanx
What is SFLPAG
what is a physical file?
when this error ocuurs in openqry file 'OPNID(BANKPF) for file BANKPF already exists.'?
Is qgpl a user library or system library?
What is the difference between physical file and logical file?
what are indicators?
what is the difference between *like and *namvar ?
What is the purpose of CHGPF (Change physical file) command?