Hi Peter,

I mostly use QWCCVTDT to convert *DTS timestamps these days - as you say,
MOVE will do nicely for most other data conversions.

In general, I prefer to use bifs if they offer the functionality I need.
Calling an API to do something the programming language already offers in my
opinion only adds unnecessary complexity to a program.  - Let the compiler
do the work - and the RPG/IV reference the documentation.

Talking about the edit APIs compared to their bif counterparts you'll have
to do two calls involving some rather exciting parameter definitions to edit
a numeric field, in stead of a single and simple bif expression. If you
however require the ability to edit a field whose attributes are not known
at compile time, the _LBEDIT (Late bound edit) builtin makes this possible
whereas the bifs and APIs do not.

Best regards,
Carsten Flensburg


----- Original Message -----
From: <midrange-l-admin@midrange.com>
To: <midrange-l@midrange.com>
Sent: Saturday, September 15, 2001 12:54 AM
Subject: Re: QWCCVTDT API and *DTS format


>
>
> Hi Carsten,
>
> Could you give me an idea why the API is better than using MOVE to convert
> dates? So far, any date conversion I've wanted to do has been possible
with
> MOVE. In a similar vein, should I use an API to edit a numeric field
rather
> than using %editc or %editw?
>
> Curious,
> Peter Dow
> Dow Software Services, Inc.
> 909 425-0194 voice
> 909 425-0196 fax
>
> From: "Carsten Flensburg" <flensburg@novasol.dk>
> > Here's a working example:
> >
> >      **--
> > Specifications -----------------------------------------------------**
> >      H Option( *SrcStmt )
> >      **-- Global
> > ariables:  -------------------------------------------------**
> >      D DTS             s              8a
> >      D LongJul         s             17a
> >      D YYMD            s             17a
> >      **-- API error data
> > tructure:  -----------------------------------------**
> >      D ApiError        Ds
> >      D  AeBytPro                     10i 0 Inz( %Size( ApiError ))
> >      D  AeBytAvl                     10i 0
> >      D  AeExcpId                      7a
> >      D                                1a
> >      D  AaExcpDta                   256a
> >      **-- Convert date &
> > ime:  ----------------------------------------------**
> >      D CvtDtf          Pr                  ExtPgm( 'QWCCVTDT' )
> >      D  CdInpFmt                     10a   Const
> >      D  CdInpVar                     17a   Const  Options( *VarSize )
> >      D  CdOutFmt                     10a   Const  Options( *VarSize )
> >      D  CdOutVar                     17a          Options( *VarSize )
> >      D  CdError                   32767a          Options( *VarSize )
> >      **
> >      C                   CallP     CvtDtf( '*YYMD'
> >      C                                   : '20010919180055000'
> >      C                                   : '*DTS'
> >      C                                   : DTS
> >      C                                   : ApiError
> >      C                                   )
> >      **
> >      C                   CallP     CvtDtf( '*DTS'
> >      C                                   : DTS
> >      C                                   : '*LONGJUL'
> >      C                                   : LongJul
> >      C                                   : ApiError
> >      C                                   )
> >      **
> >      C                   Return
> >      **
>
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
> _______________________________________________
> This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
> To post a message email: MIDRANGE-L@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l
> or email: MIDRANGE-L-request@midrange.com
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/midrange-l.
>



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.