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

what is a query can be run in which mode?

0 Answers   IBM,


Space & Skip Are Which Level Keywords?

0 Answers   IBM,


how can you execute a command from within an rpg program without calling a clp program?

1 Answers   IBM,


How can the user implicitly open and close the files in RPG program ?

2 Answers  


pf named karthik 3members jan feb mar cmd must executed create mbr ar ap

0 Answers  






How to add 99 menu (page down) option in menu creation..

0 Answers  


what is the purpose of putovr (put with explicit override) keyword?

1 Answers   IBM,


How do you grant authority?

1 Answers  


What are the record format field mapping options in cpyf?

0 Answers  


what is the difference between udate and the system date?

1 Answers   IBM,


How to create a user defined (general) data area?

1 Answers  


how do you know that records are locked?

1 Answers   IBM,


Categories