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 the purpose of data structure?

1 Answers   IBM,


When will you use OPEN and CLOSE opcodes in RPG program?

1 Answers  


I had ruestion in one of the interview..... If 1 file has more than 1 member and i want to use the 2nd member in the RPG pgm (in RPG400),how can I use this.... I know the possible answers i.e. useing API 'QCMDEXE' or Before calling the pgm I can use OVRDBF for that member... but I dont' want to use both the tips in above scenarion. Does any body tell me how can i use this ....?

13 Answers   Mind Tree,


what is subfile?

1 Answers   IBM,


What is SDA used for?

7 Answers  






what are the parameters required for calling ls & get command(SFTP COMMANDS) from cl progtram.... I want to transfer files(using GET COMMAND) that are retrieved by LS command ...FROM 1 SYSTEM TO ANOTHER... STEP 1:LS-list all files...from remote system STEP 2:GET-actually transfer the files(listed in step 1) from remote system to local system & get stored in some Physical file....Plz reply in detail...Thanx

1 Answers   EDS,


What is RETURN CURSER LOCATION in subfile?

0 Answers  


what are the different types of variables available in cl?

1 Answers   IBM,


What is the purpose of the following? A CSRLOC (F1ROW F1COL)

1 Answers  


Define each of the following operation codes a, b, c, d, e

1 Answers  


What are the two types of read performed on data queues?

1 Answers  


what are the two record formats a subfile contain ?

1 Answers   IBM,


Categories