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



Douglas,
        You define your parameters in the D-specs (typed as a date type)
then when you call your program you can pass a date or a 10 character
field to the program that will receive the date.  

        IF you pass a 10 character date, YOU MUST pass the data in the
same date format as the called program has defined it (this goes for
program or command line execution of the program receiving the date
parameter).   

        Passing a date string from a command line is in fact just
passing a 10 character string of a date.  There is no command line
designation that a 10 character string is a date literal (like you can
with an EVAL statement, EVAL DATE = d'2005-12-13'). 

Here are two programs that work for passing date parameters:

        TESTDATE8:
D DATE            s               d              
C     *ENTRY        PLIST                        
C                   PARM                    DATE 
C     DATE          DSPLY                        
C                   EVAL      *INLR = *ON        
C                   RETURN                       
                                                 

        TESTDATE9:
D DATE            s               d   inz(*job)       
D DATEC           s             10A                   
 ****
C                   CALL      'TESTDATE8'             
C                   PARM                    DATE      
 ****
C                   EVAL      DATEC = %CHAR(DATE:*ISO)
C                   CALL      'TESTDATE8'             
C                   PARM                    DATEC     
 ****
C                   EVAL      *INLR = *ON             
C                   RETURN                            



You would then use the MONITOR op-code to check for invalid date on the
incoming parameter like... 

C                         IF        %PARMS > 01
C                   MONITOR                            
C                   EVAL      DATE = DATE                       
C                   ON-ERROR  00112                            
C                     ...                            
C                   ENDMON                            
C                   ENDIF                            


Thank you,
Matt Tyler
WinCo Foods, LLC
mattt@xxxxxxxxxxxxxx

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Douglas W. Palme
Sent: Tuesday, December 13, 2005 7:20 AM
To: RPG Group
Subject: Passing Parms

I still struggle with the issue of passing date parms to a program....

Is there a specific format that they must be in? the user is going to
enter 
it as a type *USA, but it seems like at least from the command line I
can 
never get them to pass correctly.

Suggestions or hints?


If you bought it, it was hauled by a truck - somewhere, sometime.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.