MAC-PAC Homecontact ussupport login 
Documentation > MAC-PAC Reference Library > Distribution > Expert Configurator > Key Concepts and Procedures > Fraction and Unit of Measure Conversion

Fraction and Unit of Measure Conversion

 

The Expert Configurator has the capability to call the ECFRAC program in addition to other MAC-PAC provided programs, which are discussed in this section.

The ECFRAC program

·     converts alphanumeric measurements to their numeric equivalents

·     converts fractions to decimals

·     performs unit of measure conversion

This capability allows you to enter measurements and specifications that contain fractions and up to two unit of measure characters, which are then converted to a standard numeric/decimal format for use in mathematical calculations.  The following table includes examples of conversions to numeric/decimal format:

 

Alphanumeric Measurement

Numeric Format

5 ft 6 1/2 in

66.5 (inches)

5 ft 6 1/2 in

166.25 (centimeters)

5 ft 6.5 in

66.5 (inches)

5 1/2 ft

66 (inches)

6 1/2in

0.54 (feet)

 

Inputs for the ECFRAC program are alphanumeric measurements you enter on Expert Configurator Option screens and conversion types you define on Reference File category I67.

Alphanumeric measurements should be entered in the following format:

(value 1) space(s) (numerator 1/denominator 1) space(s) (unit of measure character 1) space(s) (value 2) space(s) (numerator 2/denominator 2) space(s) (unit of measure character 2)

Note:    There can be one or more spaces between values, fractions, and unit of measure characters, and information for value 2 can precede information for value 1.

Reference File category I67 Setup

Conversion types enable the ECFRAC program to perform unit of measure conversion.  Information you define on Reference File category I67 for conversion types includes:

·     Unit of measure character 1

·     Unit of measure character 2

·     Convert-to unit of measure

·     Numerator 1

·     Denominator 1

·     Numerator 2

·     Denominator 2

To convert fractions to decimals, Reference File category I67 should be set up with a blank key and the following values:

 

 WILLIALMS                      COMMON FEATURES                         3/04/96

 DSP01                    REFERENCE FILE CATEGORY I67                    CHANGE

                                                                               

                   Category Name        EC CONVERSION TYPES                    

                                                                               

                                        CONVERSION TYPE                        

                   Category Key                                                

                                                                                

                                                                               

            Unit of Measure(1)     Unit of Measure(2)                          

       Data                                                                    

                   XX                     XX                                   

                                                                               

            Convert-To-UOM     Conv. Numerator(1)   Conv. Denominator(1)       

       Data                          00001                  00001              

                   XX                NNNNN                  NNNNN              

                                                                               

            Conv. Numerator(2) Conv. Denominator(2)                            

       Data       00001              00001                                     

                  NNNNN              NNNNN                                     

                                                                                

 F2=Command          F3=Exit             F9=Inquiry          F10=Function Select

 F12=Lower Case      F15=Rekey Data                                            

                                                                               

         Conversion Type Definition.  Fraction-to-Decimal Conversions.

 

In addition to the blank key, Reference File category I67 can also be set up with specific key values that represent conversion types.  These conversion types are used to specify conversions between units of measure.  To setup Reference File category I67, the following information should be specified:

 

 WILLIAMS                       COMMON FEATURES                         3/04/96

 DPS01                    REFERENCE FILE CATEGORY I67                    CHANGE

                                                                               

                   Category Name        EC CONVERSION TYPES                    

                                                                                

                                        CONVERSION TYPE                        

                   Category Key         01                                     

                                                                               

                                                                               

            Unit of Measure(1)     Unit of Measure(2)                          

       Data        FT                     IN                                   

                   XX                     XX                                   

                                                                               

            Convert-To-UOM     Conv. Numerator(1)   Conv. Denominator(1)       

       Data        FT                00001                  00001              

                   XX                NNNNN                  NNNNN              

                                                                                

            Conv. Numerator(2) Conv. Denominator(2)                            

       Data       00001              00012                                     

                  NNNNN              NNNNN                                     

                                                                               

 F2=Command          F3=Exit             F9=Inquiry          F10=Function Select

 F12=Lower Case      F15=Rekey Data                                            

                                                                                

 

       Conversion Type Definition.  Unit of Measure Conversion.

This sample illustrates the setup of Reference File category I67 to convert values in inches to feet.

Note     If an error occurs during processing, the ECFRAC program will pass a numeric value containing all 9s back to the Expert Configurator.

Additional ECFRAC Setup

In order to use ECFRAC, a Component Parameter Rule must pass from the option value.  If you are converting from one unit of measure to another then the I67 value must be passed in a second component Parameter Rule.

In addition to Reference File category I67, use the following items to set up the ECFRAC conversions:

1.   Set up an alphanumeric field on your Screen Generation rule, such as LENGTH.  This field will be used to enter the original value.

2.   Set up a Create Parameter rule to pass the value from the option to ECFRAC by putting the option you want passed, such as O-Length, in the Parameter Value.

3.   Set up a second Create Parameter rule to pass the conversion type to ECFRAC.  If you wanted to use conversion type 01 from Reference File category I67 you would enter "01" as the Parameter Value.

4.   Set up a Modify Option (or Secondary Variable) rule to retrieve the decimal value from ECFRAC.  To do this, specify the option you want modified in the Option to be Modified field and P-ECFRAC in the New Value field. 

      Since the option you originally modified was an alphanumeric option, the value that is retrieved will not show any decimal places, so the value will be shown as a string of numbers in other Screen Generation rules.  If you want the value to be entered as a fraction on the first Screen Generation, and then, after ECFRAC was called, display the options entered by the users showing the decimal value, set up a new option in the Modify Option rule, such as DECLENGTH.  Then, on the next Screen Generation that displays the value, define DECLENGTH as a numeric value and display it instead of LENGTH, which is defined as an alphanumeric value.  Setting it up this way will also allow you to have both the originally entered value, such as 5' 6 1/2" in LENGTH, and the retrieved value, such as 5.5416 in DECLENGTH, in EC200M.

MAC-PAC Provided Programs

MAC-PAC provided programs are included on the system to handle common tasks required during Expert Configuration processing.  These programs can be used with Program Variables, external program calls from Screen Generation Rules, and External Program Rules for Sales Force Automation.

ECCLSP

This program converts a calendar date into a shop date.  This version of this function assumes that Saturday and Sunday are non-working days.  On the host, this program uses the shop date file (CT140M) to determine the exact date.

ECSPCL

This program converts a shop date into a calendar date.  This version of this function assumes that Saturday and Sunday are non-working days.  On the host, this program uses the shop date file (CT140M) to determine the exact date.

ECDOCF

This program writes a new document format for use in the interfaces to the document generation system.

ECDOCP

This program writes a new parameter (defined by the customer).  This parameter will appear in a section called Other.

Related