HDL - Fixed length input file

Fast Formula

 /* Input Data */
INPUTS ARE OPERATION (text)
, LINESEQUENCE (number)
, LINEREPEAT (text)
, LINEREPEATNO (number)
, POSITION1 (text)
DEFAULT FOR POSITION1 IS 'NO DATA'
/* DEFAULT FOR POSITION10 IS 'NO DATA'
DEFAULT FOR POSITION11 IS 'NO DATA' */
DEFAULT FOR LINESEQUENCE IS 1
DEFAULT FOR LINEREPEATNO IS 1
DEFAULT FOR GLOBAL_PAY_INTERFACE_EXTRACTION_DATE is ' '

IF OPERATION='FILETYPE' THEN
OUTPUTVALUE='FIXED'
ELSE IF OPERATION='DELIMITER' THEN
OUTPUTVALUE='NONE'
ELSE IF OPERATION='READ' THEN
OUTPUTVALUE='NONE'
ELSE IF OPERATION = 'NUMBEROFBUSINESSOBJECTS' THEN 
(
OUTPUTVALUE = '2'
RETURN OUTPUTVALUE
)
ELSE IF OPERATION = 'METADATALINEINFORMATION' THEN
(
METADATA1[1] = 'ElementEntry'
METADATA1[2] = 'ElementEntry'
METADATA1[3] = 'ElementEntryId'
METADATA1[4] = 'EffectiveEndDate'
METADATA1[5] = 'EffectiveStartDate'
METADATA1[6] = 'MultipleEntryCount'
METADATA1[7] = 'AssignmentNumber'
METADATA1[8] = 'CreatorType'
METADATA1[9] = 'ElementName'
METADATA1[10] = 'LegislativeDataGroupName'
METADATA1[11] = 'EntryType'
METADATA1[12] = 'ReplaceLastEffectiveEndDate'

METADATA2[1] = 'ElementEntry'
METADATA2[2] = 'ElementEntryValue'
METADATA2[3] = 'ElementEntryValueId'
METADATA2[4] = 'ElementEntryId'
METADATA2[5] = 'MultipleEntryCount'
METADATA2[6] = 'EffectiveEndDate'
METADATA2[7] = 'EffectiveStartDate'
METADATA2[8] = 'InputValueName'
METADATA2[9] = 'ScreenEntryValue'
METADATA2[10] = 'AssignmentNumber'
METADATA2[11] = 'ElementName'
METADATA2[12] = 'LegislativeDataGroupName'
METADATA2[13] = 'LegislationCode'
METADATA2[14] = 'EntryType'
METADATA2[15] = 'ReplaceLastEffectiveEndDate'

RETURN METADATA1,METADATA2
)
ELSE IF OPERATION='MAP' THEN
(
l_CMP = SubStr(POSITION1, 1, 3)
If Length(l_CMP) > 1 Then (
l_DEPTID = SubStr(POSITION1, 4, 5)
l_EMPLID = trim(SubStr(POSITION1, 9, 11))
l_EffDt = trim(SubStr(POSITION1, 20, 41))
l_TRC = trim(SubStr(POSITION1, 61, 3))
l_TL_Qty = trim(SubStr(POSITION1, 64, 10))


l_EffDt = to_char(to_date(l_EffDt, 'mmddyyyy'), 'yyyy/mm/dd')
l_sysdate = GLOBAL_PAY_INTERFACE_EXTRACTION_DATE

If LINEREPEATNO = 1 Then (
l_random_nbr = GET_VALUE_SET('I_TL_RANDOM_NUMBER')
l_Seq = to_char(to_date(l_EffDt, 'yyyy/mm/dd'), 'yyyymmdd') || lpad(to_char(LINESEQUENCE), 6, '0') || lpad(l_random_nbr, 3, '0')
MultipleEntryCount = To_Number(l_Seq)

l_Delimiter1_pos = 0
l_Delimiter2_pos = 0
l_Delimiter3_pos = 0

l_Asg_Str = GET_VALUE_SET('I_TL063_GET_ASG_DETAILS','|=P_PER_NUM='''||l_EMPLID||''''||'|P_DUR='''||l_EffDt||'''')

l_Delimiter1_pos = INSTR(l_Asg_Str, '*',1,1)
l_Delimiter2_pos = INSTR(l_Asg_Str, '*',1,2)

l_Asg_Number = SUBSTR(l_Asg_Str, 1, l_Delimiter1_pos-1)
l_Asg_DEPTID = SUBSTR(l_Asg_Str, l_Delimiter1_pos+1, l_Delimiter2_pos-(l_Delimiter1_pos+1))
l_PersonID = SUBSTR(l_Asg_Str, l_Delimiter2_pos+1, Length(l_Asg_Str))

If isnull(l_Asg_Number) = 'N' Then (
l_Asg_Str = GET_VALUE_SET('I_TL063_GET_FUTURE_ASG','|=P_PER_NUM='''||l_EMPLID||''''||'|P_DATE='''||l_EffDt||'''')
l_Delimiter1_pos = INSTR(l_Asg_Str, '*',1,1)
l_Delimiter2_pos = INSTR(l_Asg_Str, '*',1,2)

l_Asg_Number = SUBSTR(l_Asg_Str, 1, l_Delimiter1_pos-1)
l_Asg_DEPTID = SUBSTR(l_Asg_Str, l_Delimiter1_pos+1, l_Delimiter2_pos-(l_Delimiter1_pos+1))
l_PersonID = SUBSTR(l_Asg_Str, l_Delimiter2_pos+1, Length(l_Asg_Str))
)

ElementName = GET_VALUE_SET('I_TL063_US_ELEMENT_NAME','|=P_TRC='''||l_TRC||'''')
EffectiveEndDate = GET_VALUE_SET('I_TL063_GET_PAY_END_DATE','|=DUR='''||l_EffDt||'''')

WSA_SET('SEQNBR', l_Seq)
WSA_SET('ASGNUM', l_Asg_Number)
WSA_SET('ENDDATE', EffectiveEndDate)
WSA_SET('ELEMENTNAME',ElementName)

)
Else(

l_Seq = WSA_GET('SEQNBR', 'NO DATA')
l_Asg_Number = WSA_GET('ASGNUM', 'NO DATA')
EffectiveEndDate = WSA_GET('ENDDATE', 'NO DATA')
ElementName = WSA_GET('ELEMENTNAME', 'NO DATA')
MultipleEntryCount = To_Number(l_Seq)

)

AssignmentNumber = l_Asg_Number
EffectiveStartDate = l_EffDt
CreatorType = 'F'
EntryType = 'E'

LegislationCode = 'US'
LegislativeDataGroupName = 'US Legislative Data Group'
ReplaceLastEffectiveEndDate = 'N'

BusinessOperation = 'MERGE'
FileName = 'ElementEntry'


If isnull(l_Asg_Number) = 'N' or isnull(ElementName) = 'N' Then (

If isnull(l_Asg_Number) = 'N' Then (
ElementName = ElementName || ' Assignment number not found.' || l_EMPLID
)
If isnull(ElementName) = 'N' Then (
ElementName = l_TRC || ' TRC is invalid or not found.'
)

)

If LINEREPEATNO = 1 Then (

LINEREPEAT = 'Y'
FileDiscriminator = 'ElementEntry'
Return BusinessOperation,FileName,FileDiscriminator,EffectiveStartDate,EffectiveEndDate,MultipleEntryCount,AssignmentNumber,CreatorType,ElementName,LegislativeDataGroupName,EntryType,ReplaceLastEffectiveEndDate,LINESEQUENCE,LINEREPEAT,LINEREPEATNO
)
Else If LINEREPEATNO = 2 Then (
LINEREPEAT = 'Y'
FileDiscriminator = 'ElementEntryValue'
InputValueName = 'Hours'

l_TL_Qty = to_char(to_number(l_TL_Qty))

If InStr(l_TL_Qty, '.') = 1 Then (
l_TL_Qty = '0' || l_TL_Qty
)

If SubString(l_TL_Qty, 1, 2) = '-.' Then (
l_TL_Qty = Replace(l_TL_Qty, '-.', '-0.')
)

ScreenEntryValue = l_TL_Qty

Return BusinessOperation,FileName,FileDiscriminator,MultipleEntryCount,EffectiveStartDate,EffectiveEndDate,InputValueName,ScreenEntryValue,AssignmentNumber,ElementName,LegislativeDataGroupName,LegislationCode,EntryType,ReplaceLastEffectiveEndDate,LINESEQUENCE,LINEREPEAT,LINEREPEATNO
)
Else If LINEREPEATNO = 3 Then (
LINEREPEAT = 'N'
FileDiscriminator = 'ElementEntryValue'
InputValueName = 'Earned Date'
ScreenEntryValue = EffectiveStartDate

Return BusinessOperation,FileName,FileDiscriminator,MultipleEntryCount,EffectiveStartDate,EffectiveEndDate,InputValueName,ScreenEntryValue,AssignmentNumber,ElementName,LegislativeDataGroupName,LegislationCode,EntryType,ReplaceLastEffectiveEndDate,LINESEQUENCE,LINEREPEAT,LINEREPEATNO
)
)
Else (
LINEREPEAT = 'N'
OUTPUTVALUE = 'NONE'
Return OUTPUTVALUE,LINESEQUENCE,LINEREPEAT,LINEREPEATNO
)
)
ELSE
OUTPUTVALUE='NONE'
RETURN OUTPUTVALUE
/* End Formula Text */

Value Sets


No comments:

Post a Comment

Oracle HCM Cloud technical tips to grow your skills

Few information around Oracle HCM Cloud.