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



I don't' think this code will do what you want it to do.

A Date variable doesn't contain a different value if it's
*ISO or *YMD or *MDY.  The actual byte values are exactly
the same.  The OS just translates it different when it is
retrieved (read, displayed, etc...).

Your call: 
D#CURRENT         S               D   
EVAL      #CURRENT = GCURRDATE('*MDY')

doesn't care in the least what format the date GCURDATE is
returning.  Just move your Date into a date field in your
subroutine and return it.  Your call can format it any way
it wants.  As long as it gets a Date field it doesn't matter
if it's *ISO, *MDY, *YMD, etc...

Regards,

Jim Langston
Programmer/Analyst
Cels Enterprises, Inc.

-----Original Message-----
From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com]On
Behalf Of Smith, Mike
Sent: Wednesday, August 15, 2001 12:40 PM
To: 'rpg400-l@midrange.com'
Subject: RE: dates as parms


sure. 

here is the prototype.
 D GCurrDate       PR              D          
 D  Dt_Fmt                        4    Value  

here is the procedure
PGCurrdate        B                   Export       
 *                                                 
 *  Input Values                                   
 *                                                 
D GCurrDate       PI              D                
D  Dt_Fmt                        4    Value        

  *                                                   
 D DateMDY         S               D   datfmt(*mdy)   
 D DateDMY         S               D   datfmt(*dmy)   
 D DateYMD         S               D   datfmt(*ymd)   
 D DateJUL         S               D   datfmt(*jul)   
 D DateISO         S               D   datfmt(*iso)   
 D DateUSA         S               D   datfmt(*usa)   
 D DateEUR         S               D   datfmt(*eur)   
 D DateJIS         S               D   datfmt(*jis)            
D DateAlpha       S               D   Inz                     
                                                     
D                 ds                                          
D TimeDate                      14  0                         
D  Time60                        6  0 overlay(TimeDate:  1)   
D  Date80                        8  0 overlay(TimeDate:  7)   

  *----------------------------------------------------*  
  *  Get the current time                              *  
  *----------------------------------------------------*  
 C                   Time                    TimeDate     
 C                   Select                               
 C                   When      Dt_Fmt   = '*MDY'          
 C     *usa          Move      Date80        DateMDY      
 C                   Movel     DateMDY       DateAlpha    
                                                          
 *                                                      
C                   When      Dt_Fmt   = '*DMY'         
C     *usa          Move      Date80        DateDMY     
C                   Movel     DateDMY       DateAlpha   
 *                                                      
C                   When      Dt_Fmt   = '*YMD'         
C     *usa          Move      Date80        DateYMD     
C                   Movel     DateYMD       DateAlpha   
 *                                                      
  *                                                       
 C                   When      Dt_Fmt   = '*JUL'          
 C     *usa          Move      Date80        DateJUL      
 C                   Movel     DateJUL       DateAlpha    
  *                                                       
 C                   When      Dt_Fmt   = '*ISO'          
 C     *usa          Move      Date80        DateISO      
 C                   Movel     DateISO       DateAlpha    
                                                          
  *                                                       
 C                   When      Dt_Fmt   = '*USA'          
 C     *usa          Move      Date80        DateUSA      
 C                   Movel     DateUSA       DateAlpha    
  *                                                       
 C                   When      Dt_Fmt   = '*EUR'          
 C     *usa          Move      Date80        DateEUR      
 C                   Movel     DateEUR       DateAlpha    
  *                                                       
  *                                                        
 C                   When      Dt_Fmt   = '*JIS'           
 C     *usa          Move      Date80        DateJIS       
 C                   Movel     DateJIS       DateAlpha     
 C                   EndSl                                 
  *                                                        
 C                   Return    DateAlpha                   
 P GCurrDate       E                                       

here is the pertinent pieces from the call

D#CURRENT         S               D   
EVAL      #CURRENT = GCURRDATE('*MDY')
 


-----Original Message-----
From: James Rich [mailto:james@eaerich.com]
Sent: Wednesday, August 15, 2001 3:35 PM
To: 'rpg400-l@midrange.com'
Subject: RE: dates as parms


On Wed, 15 Aug 2001, Smith, Mike wrote:

> i too have programs that pass in the date.  My problem(and its probably
> something stupid) is i can't get a date to pass back to my calling
program.
>
> i've tried making the formats the same in the calling pgm and procedure.
>
> I checked to make sure that at the point the return is being executed,
there
> is a valid date in the return variable.
>
> i don't know what else to check.

Could you post to the list some examples of what you have that doesn't
work?  I haven't used a date data type as a return value specifically, but
I see no reason why it wouldn't work.

James Rich
james@eaerich.com

_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@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.