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 |
what is the purpose of data structure?
When will you use OPEN and CLOSE opcodes in RPG program?
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 ....?
what is subfile?
What is SDA used for?
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
What is RETURN CURSER LOCATION in subfile?
what are the different types of variables available in cl?
What is the purpose of the following? A CSRLOC (F1ROW F1COL)
Define each of the following operation codes a, b, c, d, e
What are the two types of read performed on data queues?
what are the two record formats a subfile contain ?