how to convert date format from one format to another i think
in CL/400 its CVTDAT,Please tell in RPG/400 sir not in RPGILE

Answers were Sorted based on User's Feedback



how to convert date format from one format to another i think in CL/400 its CVTDAT,Please tell in ..

Answer / keshar

IN RPG using DS we can change date format. For example go
through the link
http://tutorialindia.com/articles/as400/ile_rpg_iv_data_stru
cture_for_date_format_conversion.php


Another method is to convert date into another format is
MOVE command.

In MOVE command we can specify date format. But one should
take care about compatibility.
example:
*mdy MOVE field DATE

Also we can use %date inbuilt function to change character
into date. So use %date in this way:
1. First convert date1 into character using %char.
2. then use %date to convert into desirable date format.
syntax:
%DATE{(expression{:date-format})}

%date also use to fetch system date.

Is This Answer Correct ?    2 Yes 1 No

how to convert date format from one format to another i think in CL/400 its CVTDAT,Please tell in ..

Answer / neet

by use user defined data structure, we can change date format

Is This Answer Correct ?    1 Yes 0 No

how to convert date format from one format to another i think in CL/400 its CVTDAT,Please tell in ..

Answer / narmatha

In ds1 we can initialize one fmt.. after tat in ds2, int
another fmt. by using move opc we can move 1 fmt to another
fmt.. eg:
I DS1 DS
I 1 6 DDMMYY
I 1 2 DD
I 3 4 MM
I 5 6 YY Same like DS2 *MDY
c movel DD DD1 like MM1 , YY1, if we want sep
means int '/' then we can use...

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More RPG400 Interview Questions

I have file with data as follows data 1 2 3 4 5 I need to read 1 and 5 ,then 2 and 4 then like.. upto end of file, can any one help on this

3 Answers   ISG,


how we create binder member for updating service program and where we type this code on command line or in program ? strpgmexp pgmlvl(*current) export symbol (xyz0 endpgmexp. plz explain me this step by step .

2 Answers  


can we use cl programming to update or delete physical files

12 Answers  


Hi,Please give me complete code with this logic. The question is how to read the records from a file with load an array of size with error condition? (The logic is Z-Add 0 IDX *LOVAL SETLL FILE READ FILE 99 *IN9 DOWEQ *OFF IDX ANDLT 99 ADD 1 IDX MOVE FIELD ARR,IDX READ FILE 99 ENDDO)please give me complete code with explanation?

1 Answers  


What does Implicit Open means with respect to a file ? What about the Explicit Open?..what are the major differences between these two?

1 Answers   IBM,






Thanks gagan for your answer,i'm new to as400,i don't know embedded sql in rpg.can you send me the coding for the below mentioned question in embedded sql rpg. how to retrieve particular field records from a physical file,say i have a physical file called 'employee' in it i have to retrieve the records of a field 'admin' present in pf 'employee' using rpg,but i should not use logical file or openquery file.

2 Answers   iGate,


When PGMA calls PGMB for the first time PGMB executes the *INZSR. PGMB uses the RETRN operation to return to PGMA. When PGMA call PGMB the second time is the *INZSR executed?

5 Answers   Mphasis,


please help me answer to this question what is the difference between the binding and srvpgm in ilerpg?

4 Answers   HCL,


how do you use commitment control in rpg?

0 Answers   IBM,


How to handle duplicate error handling in RPG?

0 Answers  


what built in function can be used with SETLL.If you want to check whether the search argument is successful or not? Please give me answer with example?

3 Answers  


What will happen if we r using seton lr after return or vice versa.

5 Answers  


Categories