|
Dear Sir, I have a program that receive's the date system and convert to the format i want ! I hope this Help You ! D ActDate S D D CHGTDT DS 8 D Ano 4 D Mes 2 D Dia 2 C TIME ActDate C *ISO0 MOVE ActDate CHGTDT Luis Martins (Finibanco - Portugal) Please respond to RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> Sent by: rpg400-l-bounces@xxxxxxxxxxxx To: RPG400-L@xxxxxxxxxxxx cc: Subject: Date conversion Hi group, I have a procedure that takes in an 8s 0 date in YYYYMMDD format and returns the same date in DDMMYYYY format, and have converted it from fixed to free format. This is the code I came up with, but my gut feeling tells me there must be a better and more elegant way. p IsoEuro ? ? ? ? b ? ? ? ? ? ? ? ? ? export d IsoEuro ? ? ? ? pi ? ? ? ? ? ? 8s 0 d DateNum ? ? ? ? ? ? ? ? ? ? ? ?8s 0 value d AtoI ? ? ? ? ? ?PR ? ? ? ? ? ?10i 0 ExtProc('atoi') Alpha to Integer d ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? * ? value options(*string) // /FREE return atoi(%subst(%char(%date(DateNum:*ISO):*EUR):1:2) %subst(%char(%date(DateNum:*ISO):*EUR):4:2) %subst(%char(%date(DateNum:*ISO):*EUR):7:4)); // /END-FREE p IsoEuro ? ? ? ? e Can anybody point me in the right direction? Thanks in advance. Peter Colpaert Application Developer Honda Europe NV Langerbruggestraat 104 B-9000 GENT Belgium Peter.Colpaert@xxxxxxxxxxxx Tel: +32 9 2501 334 Fax: +32 9 2501 231 ---------- Yoda of Borg are we: Futile is resistance. Assimilate you, we will. ---------- ______________________________________________________________________ The information contained in this communication is confidential and may be legally privileged. It is intended solely for the use of the individual or the entity to whom it is addressed and others authorised to receive it. If you have received it by mistake, please let the sender know by e-mail reply and delete it from your system. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution or taking any action in reliance of the contents of this information is strictly prohibited and may be unlawful. Honda Europe NV is neither liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt. _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. __________________________________________________ Esta mensagem e quaisquer ficheiros anexos são confidenciais, destinando-se ao uso exclusivo da pessoa e/ou entidade a que se dirigem. Caso não se lhe destine, ou não seja responsável pelo seu encaminhamento ao destinatário, informamos que a recebeu por engano. Qualquer utilização, distribuição, reencaminhamento ou outra forma de revelação a terceiros, impressão ou cópia são expressamente proibidos; sendo que agradecemos que destrua a mensagem de imediato, informando o seu emissor ou o Finibanco do sucedido. Não obstante o Finibanco utilizar software anti-vírus como precaução, não é possível garantir que a presente mensagem e eventuais ficheiros anexos não contêm vírus, pelo que não consideramos da responsabilidade desta instituição eventuais consequências inerentes. Alerta-se, ainda, que as mensagens transmitidas por este meio podem ser interceptadas, corrompidas, perdidas, destruídas ou entregues com atraso ao destinatário.
As an Amazon Associate we earn from qualifying purchases.
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.