Using Locate Statement
Posted: Tue Feb 10, 2009 12:28 am
Hi All,
I am building a dynamic array, by reading a flatfile. My Flatfile will have the values like
So i am building the dynamic array (JOBLIST) also in the same manner.
So my dynamic array will look like
And inside the jobcontrol, i am reading the job names from DS_JOBS, so based on the jobname, i need to fetch the corresponding settings. So when i read the name JOB1 from DS_JOBS , i need the retrive the values Y,N from the dynamic array.
So I am using Locate statement, as it will be Very fater than For ... Next loop, and i can avoid running loop for every job.
I am using the Locate Statement like
Here JobName will contain the value from DS_JOBS. The above Locate is not working because the actual string in the dynamic array looks like "JOB1,Y,N", where as i am searching the dynamic array only with a part of String. (with JOB1 alone). It is guranteed that each job will have a single row in the dynamic array.
How to achieve this with the Locate Statement itself?
Or is there I can change while building the dynamic array itself, because i am creating the dynamic array.
I am building a dynamic array, by reading a flatfile. My Flatfile will have the values like
Code: Select all
JOB1,Y,N
JOB2,N,N
JOB3,Y,Y
So my dynamic array will look like
Code: Select all
JOB1,Y,N:@AM:
JOB2,N,N:@AM:
JOB3,Y,Y:@AM:
So I am using Locate statement, as it will be Very fater than For ... Next loop, and i can avoid running loop for every job.
I am using the Locate Statement like
Code: Select all
Locate JobName IN JOBLIST Setting POS Then
JobSettings = Field(JOBLIST<POS>,",",2,2)
End Else
JobSettings = ""
End
How to achieve this with the Locate Statement itself?
Or is there I can change while building the dynamic array itself, because i am creating the dynamic array.