Associated fields question

Jaime Perry jaime at hoovercs.com
Thu Mar 30 12:16:11 PST 2006


I am still not sure what you mean by using just the first field.  I am 
obviously missing something and I think you may be on the right track 
but I am just missing what you mean.  I appreciate everyones help by the 
way.

Let me give you as much info as I can:

My menu line:

/appl/dreport bbpr -f stamps -v selstamps -ig -a -u

My index definition (Index G):
 
 Sort Field:  J1)¦     ¦     ¦     ¦     ¦     ¦     ¦     ¦
       Length:    7¦     ¦     ¦     ¦     ¦     ¦     ¦     ¦
 Descending:     ¦     ¦     ¦     ¦     ¦     ¦     ¦     ¦

File structure:
30 -   j1) JOB #                               ¦     7¦  rj     ¦
31 -   j1) JOB #                               ¦     7¦  rj     ¦
32 -   j1) JOB #                               ¦     7¦  rj     ¦
33 -   j1) JOB #                               ¦     7¦  rj     ¦
34 -   j1) JOB #                               ¦     7¦  rj     ¦
35 -   j1) JOB #                               ¦     7¦  rj     ¦
36 -   j1) JOB #                               ¦     7¦  rj     ¦
37 -   j1) JOB #                               ¦     7¦  rj     ¦
38 -   j1) JOB #                               ¦     7¦  rj     ¦
39 -   j1) JOB #                               ¦     7¦  rj     ¦

If I go into the file in question by index G and set up a browse, it 
looks like this:

 Job# 1    Job# 2       Job# 3       Job# 4         *Job# 5         
@AF     
-----------------------------------------------------------------------------
 100000     100000       349000       349000                           
    2      
 100000     100000       352000       364000         364000          
1      
 100000     100000       352000       364000         364000          
2      
 100000     100000                                                       
              1      
 100000     100000                                                      
               2      
 100000     349000       349000                                         
         1      
 000000     100000       349000       349000         364000          
2      
 000000     100000       100000       349000         352000          
2      
 000000     100000       100000       349000         352000          
3      
 000000     000000       100000       100000         349000          
3      
 000000     000000       100000       100000         349000          
4      
 000000     100000       100000       200000         200000          
2      
 000000     100000       100000       200000         200000          
3      
 000000     100000       352000       389000                            
   2      
 000000     100000                                                      
               2      
 000000     000000       100000       100000         200000          
3      
 000000     000000       100000       100000         200000          
4      
 000000     000000       100000       352000         364000          
3      


As you can see, at least in input processing, @af is reporting what I/we 
would expect.  In my selection processing however, @af is always "1" for 
EVERY record. I put in a show "@"<@af to test this.  I have attached my 
selection processing in case it will help.  I have to be missing 
something and maybe this will help.
-------------- next part --------------
:'bbpr/prc.selstamps:'sel proc for union stamp report::/mnt1/usr/acc:
:'cd  02/17/99 mjh:'lr  03/27/06 jgp rewrote (old in selstamps.bak):
:on ne "Y"               'DO ONE TIME PROCESSING:gosub ONCE:
:                        'RUN RECORD THROUGH SELECTION CRITERIA:gosub SELCRIT:
:                        'END OF MAIN PROCESSING:END:
:                        'ONE TIME PROCESSING FLAG:on(1,yesno,g):
:                        'OKAY TO SELECT FLAG:ok(1,yesno):
:                        'UNION CODE:un(3,allup):
:                        'TEMP DEPT VAR:de(6,allup):
:                        'DEPARTMENTS:dim dept[10](6,allup)170:
:                        'JOBS ARRAY:dim jobs[10](7,rj)30:
ONCE:'ONE TIME PROCESSING::
:                        'SET FLAG TO BEEN HERE:on="Y":
:                        'HEADER:show("10","10") "\r SELECTION FOR UNION STAMP REPORT \r":
:                        'GET BEGINNING DATE:input("12","10") bd "ENTER BEGINNING PERIOD DATE OR \KZ FOR ALL  ":
:bd eq ""                'SET TO LOWEST VALUE IF BLANK:bd=GETENV("PFBD"):
:                        'GET ENDING DATE:input("13","13") ed "ENTER ENDING PERIOD DATE OR \KZ FOR ALL  ":
:ed eq ""                'SET TO HIGHEST VALUE IF BLANK:ed=GETENV("PFED"):
:                        'CLEAR THE SCREEN:cls:
::'lookup -  K=bd   i=G -ng:
:                        'END OF ONCE PROCESSING:return:
SELCRIT:'SELECTION CRITERIA::
:2 ne "109":return:
:4 lt bd                 'IF BEFORE OUR DATE, THEN DONE:return:
:4 gt ed                 'IF PAST OUR DATE, THEN GOTO END OF FILE:return:
:                        'SEE IF THIS EMPL HAS STAMPABLE UNIONS:gosub CHKUNI:
:ok ne "Y"               'IF NO STAMPS, THEN DONE:return:
::debug on:
:                        'SELECT THE RECORD:select:
::sort1=un; sort2=jobs[@af]&un; sort3=2:
:                        'END OF SELCRIT PROCESSING:return:
CHKUNI:'SEE IF THIS EMPL HAS STAMPABLE UNIONS ON THIS CARD::
:                        'SET TO FAIL THE CHECK:ok="N":
:                        'INITIALIZE THE COUNTER:x="1":
uniloop:                        'START OF UNION CHECK LOOP::
:x gt "10"               'IF PAST MAX SIZE OF ARRAY, THEN DONE:return:
:                        'STORE THE DEPARTMENT:de=dept[x]:
:                        'LAST 3 CHARS OF DEPT = UNION CODE:un=mid(de,"4","3"):
:                        'KEY IS UNION CODE:lookup uni = bbunion  k=un   i=A -nx:
:not uni                 'IF NOT IN UNION FILE, SKIP TO RELOOP:goto bypass:
:uni(4) eq "Y"           'UNION FOUND, AND SUPPORTS STAMPAGE:ok="Y"; return:
bypass:                        'RELOOP MARK::
:                        'INCREMENT AND RELOOP:x=x+"1"; goto uniloop:
ENDING:'GOTO END OF FILE ROUTINE::
:                        'SET TO HIGHEST VALUE:wd=GETENV("PFED"):
:                        'GOTO END OF FILE:lookup -  k=wd   i=E -nl:
:                        'END OF ENDING PROCESISNG:end:



More information about the Filepro-list mailing list