× 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 am trying out some RPGILE for the first time.  I am testing a simple
program from the "Who Knew You Could Do That With RPGIV" Redbook.  It is the
first program in the book that returns the day of the week for a date passed
to the program.

When I run the command...
CRTBNDRPG PGM(DORTEST/DAYPR) SRCFILE(DORTEST/QRPGLESRC) DFTACTGRP (*NO)
ACTGRP(*NEW)

... I get the error message "Program DAYPR in library DORTEST not created".
The message in the job log is:

5>> CRTBNDRPG PGM(DORTEST/DAYPR) SRCFILE(DORTEST/QRPGLESRC) DFTACTGRP(*NO)
ACTGRP(*NEW)
Definition not found for symbol 'DAYOFWEEK'.
Program DAYPR in library DORTEST not created.
Data area RETURNCODE created in library QTEMP.
Compilation failed. Program DAYPR not created in library DORTEST.

Am I missing some important step?  Is the code from the book missing
something?  Below is a copy of the source code from the book that I used.
Any help would be appreciated.  Thank you...


Procedure Interface:

     *
     *
     *  Program name:       DayPI
     *  Date:               10/06/2002
     *
     *
     *********************************************************
     *
     * Procedure Interface to calculate the day of the week

    P DayOfWeek       B

     * Procedure Interface definition
    D DayOfWeek       PI             1  0
    D WorkDate                        D

    D AnySunday       C                   D'1999-06-13'

    D WorkNum         S              7  0
    D WorkDay         S              1  0

    C     WorkDate      SubDur    AnySunday     WorkNum:*D
    C     WorkNum       div       7             WorkNum
    C                   Mvr                     WorkDay

    c                   If        WorkDay < 1
    c                   Return    WorkDay + 1
    c                   Else
    c                   Return    WorkDay
    C                   EndIf

     * Procedure Interface end marker
    P                 E

------------------------------------------------------------------------

Main Procedure:

     *
     *
     *  Program name:       Day1
     *  Date:               10/06/2002
     *
     *
     *********************************************************
     *
     * Prototype for the sub procedure DayOfWeek:
     *
    D DayOfWeek       PR             1  0
    D  InputDate                      D   Datfmt(*ISO)

     * Days of the week name table - note no field names are required
    D NameData        DS
    D                                9    Inz('Monday')
    D                                9    Inz('TuesDay')
    D                                9    Inz('Wednesday')
    D                                9    Inz('Thursday')
    D                                9    Inz('Friday')
    D                                9    Inz('Saturday')
    D                                9    Inz('Sunday')

     * Define the array as an ofvelay  of the DS name
    D Name                           9    Dim(7) Overlay(NameData)

    D DayName         S              9
    D WorkDate        S               D   Datfmt(*ISO)

     * Program Input Parameters
    C     *Entry        Plist
    C                   Parm                    WorkDate

     * Using DayOfWeek, initialize DayName with the gaboe name
    C                   Eval      DayName = Name(DayOfWeek(WorkDate))

     * Display the result
    C     DayName       Dsply

    c                   Eval      *InLr = *On

_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com



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.