BuildDatePatternLinkList

Build Date Pattern Link List

Major Business Rule

Object Name: B3400730

Parent DLL: CMFG

Location: Client/Server

Language: C

1.Functional Description

1.1Purpose
This funtion will retrieve the Dates within a fiscal date pattern, starting with the set that is 
greater than a begin date passed in and loading all periods after that into a Link List.


1.2Setup Notes and Prerequisites

• 

1.3Special Logic

• If the begin date is less than the date the fiscal year begins for the date pattern record a '1' 
will be returned in the error code

• If no date pattern records are found for the date pattern passed in a '2' will be returned in the 
error code


2.Technical Specifications


1.If the MonthlyVsWeekly flag is not set do SETLL to the fiscal date pattern file (F0008) 
with the DatePattern and the BeginDate.

Else

SETLL to the fiscal date pattern - 52 period file (F0008B) with the DatePattern and the 

beginDate.

End

2.Read all records in the file (either F0008 or F0008B) using the DatePattern as the key


If a DatePattern is found

If ProgramID is equal to 'EP3465' or 'EP3461'

-  Do the following until a date pattern is found that the begin date fits in

Place the date pattern record in an array of 52 positions that are each 6 digits

Find  the last non zero date of the fiscal date pattern in the array (this could be the 14th 

 or 

the 52nd bucket) Use that date as the LastDate.  Use the Date Fiscal Year Begins (CDDFYJ)

from the record as the StartDate.  

If the BeginDate is greater than or equal to the StartDate 

And Less then or equal to the LastDate. 

Load the dates for the date pattern record to a Link List. As each data is added

to the LinkList verify that it is not the same as the date added just before it


Else 

 If the BeginDate is less than the StartDate.

Move a '1' to DatePatternError

Get out of the program

Else

Read the next record from the file with the date pattern.

End

End

End

Once the above date conditions are satisfied or the function is called from EP34650, continue 

to read from the file by date pattern adding the dates from the date pattern record after those 

already in the 

Link List.  As each data is added to the LinkList verify that it is not the same as the date 

added just before it

Else

Move a '2' to DatePatternError

End the program

End


3.If the first position in the date pattern Link List is zero move the BeginDate there

Return the Pointer to the Link List in PointerToDates 



Data Structure

D3400730 - BuildDatePatternLinkList

Parameter NameData ItemData TypeReq/OptI/O/Both
jdBeginDateDRQJJDEDATENONENONE

The date that an item is scheduled to arrive or that an action is scheduled for completion.

cMonthlyVsWeeklyEV01charNONENONE

An option that specifies the type of processing for an event.

cDatePatternDTPNcharNONENONE

A code that identifies date patterns. You can use one of 15 codes. You must set up special codes (letters A through N) for 4-4-5, 13-period 
accounting, or any other date pattern unique to your environment. An R, the default, identifies a regular calendar pattern.

cDatePatternErrorERRcharNONENONE

The Data Field Error Code field is simply a generic data field to pass an error condition flag.  This field is one of the fields that make up the 
external parameter data structure of the Data Dictionary Server.

idPointerToDatesGENLNGIDNONENONE

General purpose ID variable.

szProgramIDPIDcharNONENONE

The number that identifies the batch or interactive program (batch or interactive object). For example, the number of the Sales Order Entry 
interactive program is P4210, and the number of the Print Invoices batch process report is R42565. The program ID is a variable length value. 
It is assigned according to a structured syntax in the form TSSXXX, where: T The first character of the number is alphabetic and identifies the 
type, such as P for Program, R for Report, and so on. For example, the value P in the number P4210 indicates that the object is a 
program. SS The second and third characters of the number are numeric and identify the system code. For example, the value 42 in the number P4210 
indicates that this program belongs to system 42, which is the Sales Order Processing system. XXX The remaining characters of the numer are 
numeric and identify a unique program or report. For example, the value 10 in the number P4210 indicates that this is the Sales Order Entry 
program.

Related Functions

None

Related Tables

F0008 Date Fiscal Patterns
F0008B Date Fiscal Patterns - 52 Period Accounting