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


Please Help Members By Posting Answers For Below Questions

what are the different opcodes available in rpg for database access ?

807


What is array in as400? What are the types of array?

621


how can we run a batch job?

729


How we will get issues on AS/400 technology ? I mean which issue/Defect Tracking tool is using in all companies when any issue comes? Can anybody explain about the work flow of AS/400 project ? plzzz

1153


what is sflpag and sflsiz ?

2268






Explain this error: "all record formats for externally-described file abcd ignored or dropped due to error; file ignored."?

743


how many maximum spaces could be given in o specs?

631


What are the different opcodes used for file operation on a subfile in a rpg pgm?

1089


what does check opcode is used?

970


what is the difference between udate and the system date?

1147


how will you search an array?

647


what is the maximum number of fields under a record format of physical file?

992


what is cab?

661


which of the following operations does not zero the field flda defined as 4,0?

698


what are different record spacing keywords in rlu ?

1205