× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Sachin

>> 1. Why can't I use DATFMT(*ISO) with DATSEP('/') for a field in
Physical >> file? If it is a limitation ...any workaround ?
>> The default for *ISO is yyyy-mm-dd.

The International Standards Organisation have recommended (in ISO 8601)
how dates should be represented in software and files for maximum
readability and this includes the use of the hyphen ("-") as the date
separator.  By specifying that you want to use DATFMT(*ISO) you are
saying that you wish the date to be represented in that format and so
the DATSEP('/') will not work.


>> 2. While displaying this field on to a Subfile, can I convert it to 
>> yy/mm/dd using some edit code or I have to do the conversion in RPG
code
>> and then display it?

Yes, for the field on the subfile specify a date format of *YMD.  When
you move a date from a field with one date format to a field with
another date format the system will automatically convert between the
two.

In my date handling procedures I always code the incoming date parameter
as DATFMT(*ISO), that way it doesn't matter what the date format is of
the date being passed into the procedure as the sub-procedure will
always get it in *ISO format.


>> 3. Another problem is that I am using TIME to retrieve the current
system
>> date (can't use UDATE/*DATE which gives job date so it doesn't change
if
>> job was started just before midnight). But TIME does not give century
>> (out put for time is yymmddhhmmss). How can achieve that in RPG code?
I
>> want to store the output to PF field mentioned in point 1. One way
would
>> be retrieving century from *YEAR, and rest of the date-time from TIME
>> opcode! Wanted to know if I am missing any opcode, which could do it
>> directly!!

You could also pick up the century portion of the date from the program
status data structure.


All the best

Jonathan 
www.astradyne-uk.com


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Chaudhary, Sachin
(GE Equipment Services,Consultant)
Sent: 05 August 2005 00:46
To: rpg400-l@xxxxxxxxxxxx
Subject: Help in using DATFMT in RPG/400
Importance: High

Hi 




Would really appreciate any help on this.

Regards,
Sachin Chaudhary.
--------------------------------------------------------------
TCS Consultant.                           .
GE Capital Rail Services
Application RTS & Enhancements,
161 N.Clark St, 700 Ste, Chicago.
Phone           : (312) 853-5074
Dial Comm.      : 8*750-5074
Fax             : (312) 853-5046
E-Mail          : sachin.chaudhary@xxxxxx



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.