× 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'm trying to prototype a procedure where the first parm is a DS that
will be updated.

The prototype looks like this:

*==================================================================*
*                                                                  *
*  FUNCTION:  ConvPctItm - Convert Percent item.                   *
*                                                                  *
*             INPUT:     - Price zones              (Gets updated) *
*                        - Dollar/Percent code      (Gets updated) *
*                        - Market cost                             *
*                        - Catchweight code                        *
*                        - Nonprofit allowance                     *
*                        - Pack                                    *
*                        - Case lots code                          *
*                                                                  *
*==================================================================*

 * Price Zones DS
D PrcZones        DS            45
D  CLD                           5P 2 Dim(15)

D ConvPctItm      PR
D  pCLDALL                            LikeDS(PrcZones)
D  PCECD                         1
D  MRKET                         7  4
D  CWTCD                         1
D  NPRAL                         5  2
D  PACKX                         5  0
D  CASEL                         1

The procedure interface looks like this:

 *========================================================
 *
 * Procedure    : ConvPctItm
 * Description  : Convert a percent item
 *
 *========================================================
P ConvPctItm      B                   Export
D ConvPctItm      PI
D   pCLDALL                           LikeDS(PrcZones)
D   PCECD                        1
D   MRKET                        7  4
D   CWTCD                        1
D   NPRAL                        5  2
D   PACKX                        5  0
D   CASEL                        1

Some of the local variables are:

D CLS             S              5P 2 Dim(15)
D CLP             S              5P 4 Dim(15)
D Zones           DS                  LikeDS(PrcZones)

I use it in calcs like this (just a sample, not everything):

 * Move data structure parm to used data structure
C                   Eval      Zones = pCLDALL
 * Move raw price zones into array for processing
C                   Eval      CLS(*) = Zones.CLD(*)
C                   Eval      CLP(*) = CLS(*) / 100

The module compiles without syntax error - but dumps (during the
compile) with a joblog and an entry into the problem log.  The first
*ESCAPE message in the joblog is MCH3601 Pointer not set for location
referenced.  There must be something I don't get about the LIKEDS.

--
Jeff Crosby
Dilgard Frozen Foods, Inc.
P.O. Box 13369
Ft. Wayne, IN 46868-3369
260-422-7531

The opinions expressed are my own and not necessarily
the opinion of my company.  Unless I say so.




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.