Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Mr.Sidc sirfor my question{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}
you have answered using MOVE opcode,can you illustrate me
with a small example sir very kind of you.



Mr.Sidc sirfor my question{how to convert date format from one format to another i think in CL/4..

Answer / katiyar

A simple method, if you are good user of MOVE and MOVEL. Use
the below code to change date format of one type to another.

movel *date date1 4 0
move *date date2 4 0

move date1 datex
movel date2 datex

Where *date system defined date with mmddyyyy format. Hope
it will help.

===========================================================
Second method, You need to define Data Structure, as below.
Variable starts with 'F' is actually used for first type of
date.

And variable starts with 'S' actually used for second date
format.

I DS
I 1 80FDATE
I 1 40FYEAR
I 1 20FCC
I 3 40FYY
I 5 120SDATE
I 5 60SMO
I 7 80SDA
I 9 120SYEAR
I 9 100SCC
I 11 120SYY


FDATE is 8-digit date as YYYY/MM/DD format and SDATE is an
8-digit date as MM/DD/YYYY format.

Just convert by moving on to other. For MDY to ISO , use
below syntax.

Z-ADD MDYC SDATE
Z-ADD SYEAR FYEAR
Z-ADD FDATE CYMD

To go from ISO to MDY, you first z-add to fdate, then z-add
fyear to syear, and then z-add sdate into your MDY date.
==========================================================

Is This Answer Correct ?    6 Yes 0 No

Post New Answer

More RPG400 Interview Questions

how do I play {insert rpg system here}?

0 Answers   IBM,


i'm working on progA , in that program i want to see the userids of the users who work on this program?

10 Answers   Four soft,


can any one help in hawkeye and turnover or any change management system plzzzzz or send the documents to my mail id :gvsp.as4@gmail.com

0 Answers  


what is kids-rpg?

0 Answers   IBM,


How to sort an array in descending in RPG

3 Answers   Google, TCS,


1.Write code to read the records from a file and load an array of size 99? Make sure that you take care of all the error conditions?

2 Answers   HSBC,


Can we journel logical file and access path? Can we use commitment control for non-join L.F?

4 Answers  


can anyone explain aboutovrOVRDBF,OPNQRYF, OVRSCOPE and OPNSCOPE?

2 Answers   TCS,


1.Load an runtime array of length 99 from the pf and you want to handle all the possible errors?

1 Answers   HCL,


How can a screen field that has changed since the last output operation be detected?

4 Answers   IBM,


I want to add 10 days in current date. how it is possible in CL program...?

11 Answers   CSC,


How do you proceed in case your active AS400 session has got disconnected suddenly, how can you get back to your session ? Is it possible??

1 Answers  


Categories