[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] Stuck in array He!!



Thanks for the help. 

>>> Roger.Harris@certegy.com 7/13/2006 10:42:01 AM >>>
There is a read at the end of the While. I think that the problem is in
While loop in the procedure Check_If_ID_Printed. The index in this loop,
#Start, will only get incremented if the first time that If
IDPrinted.emplid(#Start) = $EMPLID is test yields true so you keep testing
the same value over and over in an endless loop. Try moving add 1 to #Start
to after the end-if in that loop.


Roger L. Harris
Programmer Analyst Sr
Product Development
Certegy Check Services
Fidelity National Information Services, Inc
11601 N. Roosevelt Blvd
St Petersburg, FL 33716

(727) 227-5850 direct
(800) 215-6280 x75850 toll free
(727) 570-4917  Fax



|---------+---------------------------------------------------->
|         |           "Laura Mayer"                            |
|         |           <lmayer@gw.housing.umass.edu>            |
|         |           Sent by:                                 |
|         |           sqr-users-bounces+roger.harris=certegy.co|
|         |           m@sqrug.org                              |
|         |                                                    |
|         |                                                    |
|         |           07/13/2006 10:31 AM                      |
|         |           Please respond to "This list is for      |
|         |           discussion about the SQR database        |
|         |           reporting  language from Hyperion        |
|         |           Solutions."                              |
|         |                                                    |
|---------+---------------------------------------------------->
  
>---------------------------------------------------------------------------------------------|
  |                                                                             
                |
  |       To:       karunp@hexaware.com, sqr-users@sqrug.org                    
                |
  |       cc:                                                                   
                |
  |       Subject:  RE: [sqr-users] Stuck in array He!!                         
                |
  
>---------------------------------------------------------------------------------------------|




Thanks I'll try that.

>>> karunp@hexaware.com 7/13/2006 10:28 AM >>>
Laura...



I guess, you should have the "Read" inside the while loop. So it is just
iterating in the first line of the file. There would be an infinite loop
if more than one record is present in a file.



Just try making the change!!!



Regards...

Karun



-----Original Message-----
From: Laura Mayer [mailto:lmayer@gw.housing.umass.edu] 
Sent: Thursday, July 13, 2006 7:36 PM
To: sqr-users@sqrug.org 
Subject: [sqr-users] Stuck in array He!!



Morning,



I inherited this code from a prior employee and from what I can discern
it creates an infinite loop that keeps iterating through all the records
in a text file over and over again. I can't seem to fix it. I've even
made it so there are only 9 records in the text file.



Be advised it is the crudest code I have ever come across. What its
supposed to do is read a text file into an array and process the data.
It never seems to finish.



Is there a better way to write this mess?



Thanks for any and all help you can offer



Laura



!***********************************************************************
*

 Begin-Procedure Select_Records

!***********************************************************************
*

! Reads input file.  Selects Roommate data from Preference file

! Searches Roommate1 Array and Roommate2 Array for Roommate Matches

! Decides if the record needs to be printed

! Decides which report the record should be placed in

! Write data to Array (Prefer)

! For each inputID, if it is not in proccessing id array, put it in
array.

! Then find its roommates. If found (Match), put its roommate's id into
array.

!***********************************************************************
*

Read 1 into $Input_Str:8

let #index=0

While not #End-File

      let $InputEmplid = substr($Input_Str, 1, 8)

      let $EMPLID = $InputEmplid



      Do Check_If_ID_Printed  !if input Id has been proceed

  if $ID_Printed='N'  ! not processed

             let IDPrinted.emplid(#Index) = $EMPLID      !add id to
array. ID processed

     add 1 to #index

     let $PrintFlag = 'Y'

     let $period = $parm_proc_cd ! only run period

     Do Get_Roommate    ! find input id's pref record (building

     if $Preference_Found='Y'   ! found row in perf table

        if $RoomMateFound='N' ! but both rm1 and rm2 empty

           let $prType = 'S'

        else   !Has rmts

           let $InputIdRM1=    &A.UMH_PREF_ROOMMATE1

           let $InputIdRM2=    &A.UMH_PREF_ROOMMATE2

           let $EMPLID= &A.UMH_PREF_ROOMMATE1      ! input id' roommate1

           Do Get_Roommate !find rmt1'rmts for run period

                if $Preference_Found='Y'

       Do Get_Mutual_Type

       else !no perf in run period, may try another period

       !show 'not perf rmt1= ' $EMPLID

        if $RunPeriod='2' or $RunPeriod='3'    !105720 or 105730

         Do Look_Next_Period

         else  ! run period is not 20 or 30

         let $prType = 'N'

         let $PrintFlag ='Y'

         end-if

             end-if

            end-if

        Do Fill_Array

     end-if

end-if  !end of no processed

Read 1 into $Input_Str:8

end-while



Do Show_Array



End-Procedure





!***********************************************************************
******

! Check arry to find if this id already processed.

Begin-Procedure Check_If_ID_Printed

!***********************************************************************
******

let $ID_Printed ='N'

Let #Start = 0



While (#Start <= #Index) and $ID_Printed = 'N'

      If IDPrinted.emplid(#Start) = $EMPLID

         let $ID_Printed = 'Y'

         add 1 to #Start

  end-if

end-while



End-Procedure







_______________________________________________

sqr-users mailing list

sqr-users@sqrug.org 

http://www.sqrug.org/mailman/listinfo/sqr-users 






***************************************************************************************************************************

This e-mail communication and any attachments may be privileged and
confidential to Hexaware and are intended only for the
use of the recipients named above. If you are not the intended recipient,
please do not review, disclose, disseminate,
distribute or copy this e-mail and attachments. If you have received this
email in error, please delete the same alongwith
all attachments thereto and notify us immediately at mailadmin@hexaware.com 
.
***************************************************************************************************************************



_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org 
http://www.sqrug.org/mailman/listinfo/sqr-users 

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org 
http://www.sqrug.org/mailman/listinfo/sqr-users 






------------------------------------------------------------------------------
This message contains information from Certegy, Inc which may be confidential 
and privileged.  If you are not an intended recipient, please refrain from any 
disclosure, copying, distribution or use of this information and note that such 
actions are prohibited.  If you have received this transmission in error, 
please notify by e:mail postmaster@certegy.com.
==============================================================================


_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org 
http://www.sqrug.org/mailman/listinfo/sqr-users

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users