Show 2 ways to convert a date from YYMMDD to MMDDYY (MULT operation not acceptable)



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

Post New Answer

More IBM AS400 AllOther Interview Questions

How many Printer Files can Declare in a CL Program?

4 Answers  


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?

2 Answers   CTS,


What is compiler directive in as400? Give example of compiler directive.?

0 Answers  


PGM QSH CMD('/QOpenSys/bin/sftp -b/home/test/myfile.txt serverUserID@server') ENDPGM In above example,what is content of myfile.txt ...Thanx

2 Answers  


What is SFLPAG

1 Answers  






what is a physical file?

1 Answers   IBM,


when this error ocuurs in openqry file 'OPNID(BANKPF) for file BANKPF already exists.'?

2 Answers   ITC Infotech,


Is qgpl a user library or system library?

1 Answers  


What is the difference between physical file and logical file?

0 Answers  


what are indicators?

0 Answers   IBM,


what is the difference between *like and *namvar ?

1 Answers   IBM,


What is the purpose of CHGPF (Change physical file) command?

1 Answers  


Categories