× 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.


  • Subject: Re: *ISO Date fieldin ILE from CLLE
  • From: Scott Klement <klemscot@xxxxxxxxxxxx>
  • Date: Tue, 22 Feb 2000 10:21:24 -0600 (CST)

Hi Jeff,

[SNIP]

> So I got smart.  I thought.  I added the following subprocedure to the
> service program:
> 
>      D IsRchStrD8      PR            
> 1A                                                    
>      D  TestDate8                     8S 0 Const
> 
> and the procedure interface is:
> 
>      P IsRchStrD8      B                   Export 
>      D IsRchStrD8      PI             1A          
>      D   TestDate8                    8S 0 Const  
> 
> This subprocedure simply converts the input date to an *ISO field (which
> happens to be a call to another service program that does these types of
> conversions), then calls IsRchStrDt with the converted date.  Now, I
> thought, I'll pass an 8-character field like "20000306".  Still no
> work.  Tried defining the field in the CLLE program as *DEC length 8. 
> Still no work.


The CL data type "*DEC" is the RPG data type called "packed".  Try
defining "TestDate8" as "8P 0" instead of the zoned decimal "8S 0" 
format.   

Not sure about the "Const", or what it would do to something passed from
a CL program.   A CL program can't define a constant parameter, and have
no idea what happens when you use a procedure interface with CONST and
call it without the CONST.   If you continue to have problems, I'd suggest
removing the CONST as well.

Oh, and save yourself the trouble of trying VALUE, you can't pass by
value from CL, either.   

> 
> What am I missing?  Within the subprocedure, do I need to move the input
> parm to another field first?
> Thanks for any help.
> 
> -- 
> -Jeff

Yes, I'd imagine you'd need to move the input parm to convert it from
packed to a date field.  Something like this (untested) should work
nicely:

CL0N01Factor1+++++++Opcode&ExtFactor2+++++++Result++++++++Len++D+HiLoEq

P IsRchStrD8      B                   Export
D IsRchStrD8      PI             1A
D   TestDate8                    8P 0

D MyDateVar       S               D

C     *ISO          test(D)                 TestDate8              99
C                   if        *in99 = *on
c                   return    'E'     (for error)
c                   endif
C*
c     *ISO          move      TestDate8     MyDateVar
C*
C                   return    IsRchStrDt(MyDateVar)
P                 E



And then something like this:

PGM

        DCL VAR(&MYDATE) TYPE(*DEC) LEN(8 0)
        DCL VAR(&RESULT) TYPE(*CHAR) LEN(1)

        callprc IsRchStrD8 parm(&myDate) rtnval(&result)

ENDPGM


+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


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.