Title: | FOCUS, from INFORMATION BUILDERS |
Moderator: | ZAYIUS::BROUILLETTE |
Created: | Thu Feb 19 1987 |
Last Modified: | Mon May 05 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 615 |
Total number of notes: | 1779 |
I need some help in a modify procedure and I can't find a *clear* answer in the book. Here's the problem. I have a cost_center database. A child segment within the cost_center is for function codes. I have a transaction file of function codes. I want to update *all* cost centers with the function code. This means reading every cost center and seeing if any function code in the transaction file is a match. I tried this: FILEDEF REXDATA DISK [USMANDR.OGRADY]REXOUT.DAT MODIFY FILE CCREF FIXFORM L60F/2 CC/3 RT/1 RLIN/2 RG/2 RS/3 RPCT/5 NEXT CC ON NEXT GOTO HOPE ON NONEXT GOTO EXIT CASE HOPE MATCH L60F ON MATCH INCLUDE ON NOMATCH REJECT ENDCASE DATA ON REXDATA END but I only get the first occurrance of L60F to be updated. There is still many other cost centers with that function that should be updated. Any help would be greatful! gog
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
245.1 | Need 2 more cases | NRPUR::CUSACK | Wed Jul 26 1989 17:31 | 33 | |
It appears to me that after it does 'CASE HOPE' once, that it is just going to go back to the TOP and read the next transaction from REXDATA. I would think that you need to do something more like this MODIFY FILE CCREF FIXFORM L60F/2 CC/3 RT/1 RLIN/2 RG/2 RS/3 RPCT/5 GOTO WALK_CC CASE WALK_CC NEXT CC ON NEXT GOTO HOPE ON NONEXT GOTO STOP_CC ENDCASE CASE HOPE MATCH L60F ON MATCH INCLUDE ON NOMATCH REJECT GOTO WALK_CC ENDCASE CASE STOP_CC GOTO TOP ENDCASE DATA ON REXDATA END It's been awhile since I've been doing MODIFY Procedures, so this may be completely offbase, but it might have a shot. Let me know. Good Luck! Mike | |||||
245.2 | TP | MILPND::MADDEN | Thu Jul 27 1989 15:13 | 10 | |
It appears that Cost_ctr and function code (L60F) are in the transaction file, so can you MATCH CC ON NOMATCH INCLUDE (OR REJECT IF YOU DON'T WANT NEW CC'S) ON MATCH CONTINUE MATCH CHILDKEY ON NOMATCH INCLUDE ON MATCH UPDATE L60F | |||||
245.3 | No luck yet.... | FDCV06::OGRADY | George - ISWS - 262-8665/223-3890 | Thu Jul 27 1989 15:58 | 17 |
.1 I tried it, the results is the 1st transaction is posted/rejected to all cost centers. Closer then I ever got! .2 I can't match on cost center. Its blank. These functions need to be applied to all cost centers with the child segment having that function. The problem can be worked around by associating a cost center with each function record. This will cause my file to enlarge a bit. There are logical work arounds *but* I'm a stubborn SOB and I *want* FOCUS to handle the problem. Well, we'll keep on plodding along. Keep the ideas coming! gog | |||||
245.4 | I pick 2 | FEISTY::TILLERY | Fri Jul 28 1989 13:29 | 10 | |
I agree with .2. If this is a cost center file, then there must be a field populated with cost centers (or are you just now populating the file?). If you are just now pop., then match on cost center and include. If I am way off base, how about posting one record and .mas of cc file. Jim | |||||
245.5 | Offbase, I think :-) | FDCV06::OGRADY | George - ISWS - 262-8665/223-3890 | Mon Jul 31 1989 12:13 | 50 |
OK, here's the transactions: 0H 41ZT211001.2 0H 41ZT212000.2 0H 41ZT213009.7 FIXFORM L60F/2 CC/3 RT/1 RLIN/2 RG/2 RS/3 RPCT/5 Notice, I have blank cost centers. Logic says, post this data to *all* cost centers with a function "0H". So, if I have 20 cost centers with function "0H", I will post 60 transactions. The cost center reference master: FILENAME=CCREF ,SUFFIX=FOC,$ SEGNAME=CCSEG, SEGTYPE=S1,$ FIELDNAME=COST_CENTER ,ALIAS=CC ,FORMAT=A3 ,FIELDTYPE=I,$ FIELDNAME=REDBOOK_CODE ,ALIAS=RB ,FORMAT=A4 ,$ FIELDNAME=XL19_REGION ,ALIAS=XR ,FORMAT=A4 ,$ FIELDNAME=XL19_DIST ,ALIAS=XD ,FORMAT=A4 ,$ FIELDNAME=CCNAME ,ALIAS=NAME ,FORMAT=A20 ,$ FIELDNAME=CC_MANAGER ,ALIAS=MGR ,FORMAT=A20 ,$ FIELDNAME=L60_ROLLLOC ,ALIAS=RL ,FORMAT=A1 ,$ FIELDNAME=PLF_FUNCTION ,ALIAS=PF ,FORMAT=A1 ,$ FIELDNAME=PLF_DEPT ,ALIAS=PDPT ,FORMAT=A1 ,$ GROUP =BUS_DIST ,ALIAS=KEY ,FORMAT=A2 ,$ FIELDNAME=PLF_REG ,ALIAS=PR ,FORMAT=A1 ,$ FIELDNAME=PLF_DIS ,ALIAS=PDIS ,FORMAT=A1 ,$ FIELDNAME=SALES_AREA ,ALIAS=SA ,FORMAT=A1 ,$ FIELDNAME=ACT_INACT ,ALIAS=AIC ,FORMAT=A1 ,$ FIELDNAME=DEACT_D ,ALIAS=DACT ,FORMAT=A6MDY ,$ FIELDNAME=BOOK_CODE ,ALIAS=BKC ,FORMAT=A1 ,$ FIELDNAME=EXP_CODE ,ALIAS=EXPC ,FORMAT=A1 ,$ FIELDNAME=FAC_CODE ,ALIAS=FC ,FORMAT=A1 ,$ FIELDNAME=COST_OF_SAL ,ALIAS=CCSF ,FORMAT=A1 ,$ FIELDNAME=LEDGERCODE ,ALIAS=LED ,FORMAT=A3 ,$ SEGNAME=CCREX, SEGTYPE=S1 ,$ FIELDNAME=L60_FUNCT ,ALIAS=L60F ,FORMAT=A2 ,FIELDTYPE=I,$ FIELDNAME=REX_SEG ,ALIAS=RS ,FORMAT=A3 ,$ FIELDNAME=REX_LINE ,ALIAS=RLIN ,FORMAT=A2 ,$ FIELDNAME=REX_GEOG ,ALIAS=RG ,FORMAT=A2 ,$ FIELDNAME=REX_PCT ,ALIAS=RPCT ,FORMAT=D5.1 ,$ FIELDNAME=REX_TYPE ,ALIAS=RT ,FORMAT=A1 ,$ -gog | |||||
245.6 | Not in my dictionary | FEISTY::TILLERY | Tue Aug 01 1989 09:44 | 6 | |
You can only have one occurance of L60_FUNCT per L60_FUNCT. (ie. one 0H per CC) In order to have more RPCT per a 0H function, you would have to change your file desc. Jim | |||||
245.7 | FDCV06::OGRADY | George - ISWS - 262-8665/223-3890 | Wed Aug 02 1989 10:23 | 9 | |
�In order to have more RPCT per a 0H function, you �would have to change your file desc. How? Could you give me an example? gog | |||||
245.8 | change sequence of fields | FEISTY::TILLERY | Wed Aug 02 1989 10:55 | 10 | |
You could change the sequence of fields within the second seg. and get what you want. I don't know what would make sense to you, but an examply would be to make REX_SEG the primary key with L60_FUNCT as the alternate. If REX_SEG is unique for each RPCT within each L60_FUNCT, that's the monster you want. Hope this helps, jt |