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



on 11/11/97at 01:22 PM, the Great and Grand  Wazir "Saskia Hartley"
<shartley@fritzi.com> said:

Does anyone know a simple way (other than referencing QCENTURY) to
retrieve the current year as a 4-digit value ( e.g. "1997" instead of
just "97") in a CL program?

tia
 -saskia
Here's how i solved the problem:
(I ended up having to do a CVTDAT immediately after the RTVdate.
      *************** Beginning of data *****************************
01.00              PGM                                                      
 02.00 /* .............................................................. */   
03.00 /* ..........THIS PROGRAM SIMPLY DISPLAYS who I am                */  
 04.00 /* .....                                                        . */   
05.00           DCL        VAR(&MSGTXT) TYPE(*CHAR) LEN(65)               
06.00           DCL        VAR(&NAME) TYPE(*CHAR) LEN(10)                 
07.00           DCL        VAR(&printer) TYPE(*CHAR) LEN(10)              
08.00           DCL        VAR(&DATE6) TYPE(*CHAR) LEN(6)                 
09.00           DCL        VAR(&DATE8) TYPE(*CHAR) LEN(10)                
10.00           RTVJOBA    USER(&NAME) DATE(&DATE6) PRTDEV(&PRINTER) /* + 
11.00                        get information */                           
12.00           CVTDAT     DATE(&DATE6) TOVAR(&DATE8) TOFMT(*DMYY) +      
13.00                        TOSEP(/)                                     
14.00           CHGVAR     VAR(&MSGTXT) VALUE('User-' *CAT &NAME *CAT +   
15.00                        'Printer-' *CAT &PRINTER *CAT &DATE8)        
16.00                                                                       
 17.00         SNDPGMMSG  MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA(&MSGTXT) + 
18.00                      TOPGMQ(*EXT) MSGTYPE(*INQ)                   
      ****************** End of data *************************
and, here's what it looks like:

                           Display Program Messages   
                                                      
 Job 003711/BOOTH/QPADEV0001 started on 11/11/97
 User-BOOTH     Printer-P1        11/11/1997.         
      
                                                      

----------------------------------------------------
Booth Martin     
---------------------------------------------------



+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to "MIDRANGE-L@midrange.com".
| To unsubscribe from this list send email to MAJORDOMO@midrange.com
|    and specify 'unsubscribe MIDRANGE-L' in the body of your message.
| 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.