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 |
Why we have multiple data types in As400 and why we use numeric, packed, decimal, zoned the basic difference between this?
What is an authorization list?
How to genarate the reports?
what is multijoin logical file? what are the keywords available in joinlogical file? what are the mandatary keywords for joinlogical file? explai the keywords?
1)In a pf if we delete a record then how to insert a new record at the same place in that pf?? any logic or code? 2)A batch job is taking a lot of time to run,found that it is going into loop and wrapping up so how to skip that loop and process the job without changing the code? 3)In which scenario C D I R comes and C D G F comes in a job? 4)If a job came to error while processing a file how we can know at which record the error hit and how to skip that record and process other records without changing program code?
When will you use OPEN and CLOSE opcodes in RPG program?
what does defn do?
how many levels are there in a physical file?
What is the purpose of the following FORDHDR1 CF E WORKSTN $2SFN SFILE FMT2
how many triggers can be associated with a file?
What Is Ddm ?
what are the different opcodes available in rpg for database access ?