SlideShare a Scribd company logo
1 of 17
Algorithm #3

CHANGE and ADD transactions;
Several transactions per master
             record

          Prepared by Perla P. Cosme   1
Recall Algorithm #1
Get_Next_Master
Get_Next_Trans
While NOT (master_key==sentinel AND trans_key==sentinel)
  if (master_key < trans_key)
      { output master record to new master file
          Get_Next_master
       }
       else if (master_key == trans_key)
                { make a change in the master record
                    output master record in new master file
                    Get_Next_Trans
                    Get_Next_Master
                  }
             else
                 { print “no matching record in the master file”
                    Get_Next_Trans
                  }
                             Prepared by Perla P. Cosme                         2
Recall Algorithm #2
Get_Next_Master
Get_Next_Trans
While NOT (master_key==sentinel AND trans_key==sentinel)
  if (master_key < trans_key)
      { output master record to new master file
          Get_Next_master
       }
       else if (master_key == trans_key)
                { make a change in the master record
                    // output master record in new master file
                    Get_Next_Trans
                    //Get_Next_Master
                  }
             else
                 { print “no matching record in the master file”
                    Get_Next_Trans
                  }
                             Prepared by Perla P. Cosme                         3
Think about this ….
If Algorithm #3 is to include ADD transaction on
   the existing CHANGE transaction in the
   Algorithm #2, then when are we allowed to
   ADD or create a record?
b.Master key < transaction key
c. Master key = transaction key
d.Master key > transaction key


                   Prepared by Perla P. Cosme      4
Think about this ….
If Algorithm #3 is to include ADD transaction on
   the existing CHANGE transaction in Algorithm
   #2, then when are we allowed to ADD or
   create a record?
b.Master key < transaction key
c. Master key = transaction key
d.Master key > transaction key

            Why (c)? Justify.

                       Prepared by Perla P. Cosme   5
Justification why the Answer to the
  previous Question cannot be (a)
Let us prove by citing an example:
      MF: 6      7     8

      TF    8
            A
Note: if master key (7) < transaction key (8), and the
  transaction is ADD, you might add a record whose
  primary key is the same as the one you are about to
  create/add.
                     Prepared by Perla P. Cosme          6
Justification why the Answer to the
  previous Question cannot be (b)
Let us show one typical example:
      MF: 3     6     11

      TF:    3     3
             C     A
Note: if master key (3) is equal to transaction key (3),
  you will be creating duplicate records in the master
  file. (The master file should never have duplicates.)

                       Prepared by Perla P. Cosme          7
Question: How should Algorithm #2 look like
 now to reflect the error in adding a record
 when master key = transaction key?




                  Prepared by Perla P. Cosme   8
Get_Next_Master
Get_Next_Trans
While NOT (master_key==sentinel AND trans_key==sentinel)
  if (master_key < trans_key)
      {     output master record to new master file
            Get_Next_master
       }
       else if (master_key == trans_key)
                {Case update_code
                        ‘A’: print “duplicate record”
                             Get_Next_Trans
                        ‘C’: make a change in the master record
                               Get_Next_Trans
                         Default: print “invalid update code”
                               Get_Next_Trans
                }
             else /* no matching record in the master file */
                 { print “no matching record in the master file”
                    Get_Next_Trans
                  }

                                   Prepared by Perla P. Cosme      9
Justification why the Answer to the
       previous Question is (c)
• It is in the third case (i.e., master key >
  transaction key) where we are allowed to add
  a new record. Hence, it will be in such section
  of the algorithm where we are going to
  concentrate making the modifications to
  Algorithm #2 to fit to our new requirements –
  CHANGE and ADD transactions with multiple
  transactions per master record.

                   Prepared by Perla P. Cosme   10
This is the Algorithm
Get_Next_Master                                                          #3 that explicitly
Get_Next_Trans                                                          includes the error-
While NOT (master_key==sentinel AND trans_key==sentinel)                 handling routine
  if (master_key < trans_key)                                           when master key is
      {     output master record to new master file                    equal to transaction
            Get_Next_master                                                      key
       }
       else if (master_key == trans_key)
                {Case update_code
                       ‘A’: print “duplicate record”
                            Get_Next_Trans
                       ‘C’: make a change in the master record
                              Get_Next_Trans
                        Default: print “invalid update code”
                              Get_Next_Trans
                }
             else
                 {     // no matching record in the master file
                       print “no matching record in the master file”
                       Get_Next_Trans
                  }
                                    Prepared by Perla P. Cosme                          11
Get_Next_Master
Get_Next_Trans
While NOT (master_key==sentinel AND trans_key==sentinel)
  if (master_key < trans_key)
      {     output master record to new master file
            Get_Next_master
       }
       else if (master_key == trans_key)
                {Case update_code
                       ‘A’: print “duplicate record”
                                                                       These two (2) lines
                            Get_Next_Trans
                                                                           will still be
                       ‘C’: make a change in the master record
                                                                       maintained but only
                              Get_Next_Trans
                                                                        when the update
                        Default: print “invalid update code”
                                                                           code is C.
                              Get_Next_Trans
                }
             else
                 {     // no matching record in the master file
                       print “no matching record in the master file”
                       Get_Next_Trans
                  }
                                    Prepared by Perla P. Cosme                         12
Get_Next_Master
Get_Next_Trans
While NOT (master_key==sentinel AND trans_key==sentinel)
  if (master_key < trans_key)
      {     output master record to new master file
            Get_Next_master
       }
       else if (master_key == trans_key)
                {Case update_code
                       ‘A’: print “duplicate record”
                            Get_Next_Trans
                                                                   We shall introduce a
                       ‘C’: make a change in the master record
                                                                function called NOMATCH
                              Get_Next_Trans
                                                                    to handle the ADD
                        Default: print “invalid update code”
                                                                   transaction and the
                              Get_Next_Trans
                                                                 succeeding ADD and/or
                }
                                                                 CHANGE transactions on
             else
                                                                 the same newly created
                 {     // no matching record in the master file
                                                                          record.
                       NOMATCH
                  }

                                 Prepared by Perla P. Cosme                       13
Function NOMATCH
Case update_code
 ‘A’: Build new record from transaction record
       new_key = trans_key
       Get_Next_Trans
       while (trans_key != sentinel AND trans_key == new_key)
            Case update_code
               ‘A’: print “duplicate add”                        These are the
                                                                lines that were
               ‘C’: make change in the newly created record
                                                                 retained from
                Default: print “invalid update code”             Algorithm #2.
            Get_Next_Trans
       output new record to new master file
 ‘C’: print “no matching master record for transaction key”
      Get_Next_Trans
  Default : print “invalid update code”
       Get_Next_Trans
                              Prepared by Perla P. Cosme                    14
Let’s simulate the SFO using
            Algorithm #3

We shall use the same example as what we
 presented previously.




                 Prepared by Perla P. Cosme   15
The Third Algorithm
        CHANGE and ADD transactions;
     several transactions per master record



MF     3        6               10            11


TF 3        3        11            11         11   11   18
   C        A        A             C          C    A    A


                 Prepared by Perla P. Cosme                  16
????
     Questions?
     Comments?
Suggestions?  and 
     Open Forum


       Prepared by Perla P. Cosme          17

More Related Content

Viewers also liked

Fourth Quarter 2015 Investor Presentation
Fourth Quarter 2015 Investor PresentationFourth Quarter 2015 Investor Presentation
Fourth Quarter 2015 Investor PresentationCNOServices
 
Algorithm 1
Algorithm  1Algorithm  1
Algorithm 1gwsy93
 
Algorithm 1
Algorithm  1Algorithm  1
Algorithm 1gwsy93
 
Algorithm 3
Algorithm  3Algorithm  3
Algorithm 3gwsy93
 
Wave of Women Ambassadors campaign launch March 23, 2012
Wave of Women Ambassadors campaign launch March 23, 2012Wave of Women Ambassadors campaign launch March 23, 2012
Wave of Women Ambassadors campaign launch March 23, 2012Wave of Women Ambassadors
 
Algorithm 2
Algorithm  2Algorithm  2
Algorithm 2gwsy93
 
Why Do You Lead? What Are You Trying to Accomplish?
Why Do You Lead? What Are You Trying to Accomplish?Why Do You Lead? What Are You Trying to Accomplish?
Why Do You Lead? What Are You Trying to Accomplish?Charles Brewer
 
Inv pres q32016_final
Inv pres q32016_finalInv pres q32016_final
Inv pres q32016_finalCNOServices
 

Viewers also liked (12)

AICRC
AICRCAICRC
AICRC
 
Fourth Quarter 2015 Investor Presentation
Fourth Quarter 2015 Investor PresentationFourth Quarter 2015 Investor Presentation
Fourth Quarter 2015 Investor Presentation
 
Algorithm 1
Algorithm  1Algorithm  1
Algorithm 1
 
Algorithm 1
Algorithm  1Algorithm  1
Algorithm 1
 
Algorithm 3
Algorithm  3Algorithm  3
Algorithm 3
 
Wave of Women Ambassadors campaign launch March 23, 2012
Wave of Women Ambassadors campaign launch March 23, 2012Wave of Women Ambassadors campaign launch March 23, 2012
Wave of Women Ambassadors campaign launch March 23, 2012
 
AICRC
AICRCAICRC
AICRC
 
Hiprevínculos
HiprevínculosHiprevínculos
Hiprevínculos
 
Synfig
SynfigSynfig
Synfig
 
Algorithm 2
Algorithm  2Algorithm  2
Algorithm 2
 
Why Do You Lead? What Are You Trying to Accomplish?
Why Do You Lead? What Are You Trying to Accomplish?Why Do You Lead? What Are You Trying to Accomplish?
Why Do You Lead? What Are You Trying to Accomplish?
 
Inv pres q32016_final
Inv pres q32016_finalInv pres q32016_final
Inv pres q32016_final
 

Recently uploaded

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 

Recently uploaded (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 

Algorithm 3

  • 1. Algorithm #3 CHANGE and ADD transactions; Several transactions per master record Prepared by Perla P. Cosme 1
  • 2. Recall Algorithm #1 Get_Next_Master Get_Next_Trans While NOT (master_key==sentinel AND trans_key==sentinel) if (master_key < trans_key) { output master record to new master file Get_Next_master } else if (master_key == trans_key) { make a change in the master record output master record in new master file Get_Next_Trans Get_Next_Master } else { print “no matching record in the master file” Get_Next_Trans } Prepared by Perla P. Cosme 2
  • 3. Recall Algorithm #2 Get_Next_Master Get_Next_Trans While NOT (master_key==sentinel AND trans_key==sentinel) if (master_key < trans_key) { output master record to new master file Get_Next_master } else if (master_key == trans_key) { make a change in the master record // output master record in new master file Get_Next_Trans //Get_Next_Master } else { print “no matching record in the master file” Get_Next_Trans } Prepared by Perla P. Cosme 3
  • 4. Think about this …. If Algorithm #3 is to include ADD transaction on the existing CHANGE transaction in the Algorithm #2, then when are we allowed to ADD or create a record? b.Master key < transaction key c. Master key = transaction key d.Master key > transaction key Prepared by Perla P. Cosme 4
  • 5. Think about this …. If Algorithm #3 is to include ADD transaction on the existing CHANGE transaction in Algorithm #2, then when are we allowed to ADD or create a record? b.Master key < transaction key c. Master key = transaction key d.Master key > transaction key Why (c)? Justify. Prepared by Perla P. Cosme 5
  • 6. Justification why the Answer to the previous Question cannot be (a) Let us prove by citing an example: MF: 6 7 8 TF 8 A Note: if master key (7) < transaction key (8), and the transaction is ADD, you might add a record whose primary key is the same as the one you are about to create/add. Prepared by Perla P. Cosme 6
  • 7. Justification why the Answer to the previous Question cannot be (b) Let us show one typical example: MF: 3 6 11 TF: 3 3 C A Note: if master key (3) is equal to transaction key (3), you will be creating duplicate records in the master file. (The master file should never have duplicates.) Prepared by Perla P. Cosme 7
  • 8. Question: How should Algorithm #2 look like now to reflect the error in adding a record when master key = transaction key? Prepared by Perla P. Cosme 8
  • 9. Get_Next_Master Get_Next_Trans While NOT (master_key==sentinel AND trans_key==sentinel) if (master_key < trans_key) { output master record to new master file Get_Next_master } else if (master_key == trans_key) {Case update_code ‘A’: print “duplicate record” Get_Next_Trans ‘C’: make a change in the master record Get_Next_Trans Default: print “invalid update code” Get_Next_Trans } else /* no matching record in the master file */ { print “no matching record in the master file” Get_Next_Trans } Prepared by Perla P. Cosme 9
  • 10. Justification why the Answer to the previous Question is (c) • It is in the third case (i.e., master key > transaction key) where we are allowed to add a new record. Hence, it will be in such section of the algorithm where we are going to concentrate making the modifications to Algorithm #2 to fit to our new requirements – CHANGE and ADD transactions with multiple transactions per master record. Prepared by Perla P. Cosme 10
  • 11. This is the Algorithm Get_Next_Master #3 that explicitly Get_Next_Trans includes the error- While NOT (master_key==sentinel AND trans_key==sentinel) handling routine if (master_key < trans_key) when master key is { output master record to new master file equal to transaction Get_Next_master key } else if (master_key == trans_key) {Case update_code ‘A’: print “duplicate record” Get_Next_Trans ‘C’: make a change in the master record Get_Next_Trans Default: print “invalid update code” Get_Next_Trans } else { // no matching record in the master file print “no matching record in the master file” Get_Next_Trans } Prepared by Perla P. Cosme 11
  • 12. Get_Next_Master Get_Next_Trans While NOT (master_key==sentinel AND trans_key==sentinel) if (master_key < trans_key) { output master record to new master file Get_Next_master } else if (master_key == trans_key) {Case update_code ‘A’: print “duplicate record” These two (2) lines Get_Next_Trans will still be ‘C’: make a change in the master record maintained but only Get_Next_Trans when the update Default: print “invalid update code” code is C. Get_Next_Trans } else { // no matching record in the master file print “no matching record in the master file” Get_Next_Trans } Prepared by Perla P. Cosme 12
  • 13. Get_Next_Master Get_Next_Trans While NOT (master_key==sentinel AND trans_key==sentinel) if (master_key < trans_key) { output master record to new master file Get_Next_master } else if (master_key == trans_key) {Case update_code ‘A’: print “duplicate record” Get_Next_Trans We shall introduce a ‘C’: make a change in the master record function called NOMATCH Get_Next_Trans to handle the ADD Default: print “invalid update code” transaction and the Get_Next_Trans succeeding ADD and/or } CHANGE transactions on else the same newly created { // no matching record in the master file record. NOMATCH } Prepared by Perla P. Cosme 13
  • 14. Function NOMATCH Case update_code ‘A’: Build new record from transaction record new_key = trans_key Get_Next_Trans while (trans_key != sentinel AND trans_key == new_key) Case update_code ‘A’: print “duplicate add” These are the lines that were ‘C’: make change in the newly created record retained from Default: print “invalid update code” Algorithm #2. Get_Next_Trans output new record to new master file ‘C’: print “no matching master record for transaction key” Get_Next_Trans Default : print “invalid update code” Get_Next_Trans Prepared by Perla P. Cosme 14
  • 15. Let’s simulate the SFO using Algorithm #3 We shall use the same example as what we presented previously. Prepared by Perla P. Cosme 15
  • 16. The Third Algorithm CHANGE and ADD transactions; several transactions per master record MF 3 6 10 11 TF 3 3 11 11 11 11 18 C A A C C A A Prepared by Perla P. Cosme 16
  • 17. ???? Questions? Comments? Suggestions?  and  Open Forum Prepared by Perla P. Cosme 17