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 are the functions of Remote Job Entry (RJE) ?

1 Answers  


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

1 Answers  


a multiple format logical file is also known as?

0 Answers   IBM,


The content of Physical file is as below: hfcftp wruquief SENDPASV 0 CDUP ASCII GET 01100901.CSV ramndk/ECP505.EC0110090 (REPLACE QUIT Thw above commands will get executed when we call STRTCPFTP from CL program.... Now if I want to use SFTP what can be the solution? plz reply in detail....Thank you for ny help... I m using RPG/ILERPG to download...

0 Answers  


How to convert a spool file to PDF file in AS400?

0 Answers  






Difference between NOPASS & OMIT?

0 Answers  


I have to execute 12000 CL Commands one by one.. So, I have created a file called COMMAND. This file has only 1 field called STRING. This file had 12000 records, and all these records are CL Commands (ex: CALL PGM(PGM1)), etc) I have written a CL which will read all the record and do sbmjob.. But it is not working... Plz help me to exexute all these 12000 commands..

2 Answers   ISE,


how do you detect unused spool storage?

2 Answers  


what is *iso date format?

0 Answers   IBM,


WHICH REPLY CODE IS USED BT sftp ? ... (e.g.226 is used by FTP IF FILE IS TRANSFERED)

0 Answers  


Why we sometimes use same file name in file and tofile in ovrdbf and sometimes different?

0 Answers  


Distinguish between logical file and physical file?

1 Answers  


Categories