*******************************************************. * ! * * D:\KURS_SPSS\VH_FILES. ******************************************************. ** . ********************************************************************************. * DEFINE !InPath() 'E:\Users_dir\IKT\Com_Res\' !ENDDEFINE. DEFINE !InPath() 'D:\KURS_SPSS\VH_FILES\' !ENDDEFINE. *** ***. ********************************************************************************. * DEFINE !NomPath() 'E:\Users_dir\IKT\Com_Res\NOMS\' !ENDDEFINE. DEFINE !NomPath() 'D:\KURS_SPSS\VH_FILES\' !ENDDEFINE. *** ***. ********************************************************************************. * DEFINE !Path() 'E:\Users_dir\IKT\IS\GVaseva\' !ENDDEFINE. DEFINE !Path() 'D:\KURS_SPSS\WORK_DIR\' !ENDDEFINE. *** ***. ********************************************************************************. * DEFINE !OutDPath() 'E:\Users_dir\IKT\Com_Res\D_Files\' !ENDDEFINE. DEFINE !OutDPath() 'D:\KURS_SPSS\OSN_POK\' !ENDDEFINE. * DEFINE !OutPath() 'E:\Users_dir\IKT\Com_Res\VB_ADDAnts\Tables\MSP\' !ENDDEFINE. DEFINE !OutPath() 'D:\KURS_SPSS\OSN_POK\' !ENDDEFINE. *** ***. ********************************************************************************. * DEFINE !SyntPath() 'E:\Users_dir\IKT\Com_Res\SYNTAX_2009\IZHODI\MSP\' !ENDDEFINE. *Sort _Nomenklaturi. ***************************. GET FILE=!NomPath+'KID1_08_gal.sav'. SORT CASES BY CODE5 (A). SAVE OUTFILE=!NomPath+'KID1_08_gal.sav' /COMPRESSED. GET FILE=!NomPath+'NOM_OBJ_gal.sav'. SORT CASES BY OBL_ACT (A) OBJ_ACT (A). SAVE OUTFILE=!NomPath+'NOM_OBJ_gal.sav' /COMPRESSED. * 1- 21 - obj. *****************************************************************. GET FILE = !OutDPath+'D08_OsnPok.sav'. VARIABLE LEVEL BrPr TO aDMA (SCALE) . OMS /Select TABLES /If INSTANCES=LAST /DESTINATION Format=SAV OUTFILE=!Path+'Opok_08_T1_A21_obj.sav'. * Custom Tables. CTABLES /VLABELS VARIABLES=OBL_ACT OBJ_ACT KID1_08 BrPr PrProd PrihDn NetPrih RazhDn Pech Zag Zaeti Naeti RarhRz DMA aBrPr aPrProd aPrihDn aNetPrih aRazhDn aPech aZag aZaeti aNaeti aRarhRz aDMA DISPLAY=LABEL /TABLE OBL_ACT > OBJ_ACT > KID1_08 [C] BY BrPr [SUM, MAXIMUM, VALIDN F40.0] + PrProd [SUM, MAXIMUM, VALIDN F40.0] + PrihDn [SUM, MAXIMUM, VALIDN F40.0] + NetPrih [SUM, MAXIMUM, VALIDN F40.0] + RazhDn [SUM, MAXIMUM, VALIDN F40.0] + Pech [SUM, MAXIMUM, VALIDN F40.0] + Zag [SUM, MAXIMUM, VALIDN F40.0] + Zaeti [SUM, MAXIMUM, VALIDN F40.0] + Naeti [SUM, MAXIMUM, VALIDN F40.0] + RarhRz [SUM, MAXIMUM, VALIDN F40.0] + DMA [SUM, MAXIMUM, VALIDN F40.0] + aBrPr [SUM] + aPrProd [SUM] + aPrihDn [SUM] + aNetPrih [SUM] + aRazhDn [SUM] + aPech [SUM] + aZag [SUM] + aZaeti [SUM] + aNaeti [SUM] + aRarhRz [SUM] + aDMA [SUM] /CATEGORIES VARIABLES=OBL_ACT OBJ_ACT KID1_08 ORDER=A KEY=VALUE EMPTY=EXCLUDE TOTAL=YES POSITION=BEFORE. OMSEND. GET FILE=!Path+'Opok_08_T1_A21_obj.sav' /DROP Command_ Subtype_ Label_ . * INCLUDE FILE =!SyntPath+'D_OsnPok_T3_conf.sps'. * !. ***************************************************. RENAME VARIABLES (SUM TO SUM_U= BrPr, mBrPr, brBrPr, PrProd, mPrProd, brPrProd, PrihDn, mPrihDn, brPrihDn, NetPrih, mNetPrih, brNetPrih, RazhDn, mRazhDn, brRazhDn, Pech, mPech, brPech, Zag, mZag, brZag, Zaeti, mZaeti, brZaeti, Naeti, mNaeti, brNaeti, RarhRz, mRarhRz, brRarhRz, DMA , mDMA, brDMA, aBrPr, aPrProd, aPrihDn, aNetPrih, aRazhDn, aPech, aZag, aZaeti, aNaeti, aRarhRz, aDMA). DO REPEAT Var= BrPr PrProd PrihDn NetPrih RazhDn Pech Zag Zaeti Naeti RarhRz DMA / aVar= aBrPr aPrProd aPrihDn aNetPrih aRazhDn aPech aZag aZaeti aNaeti aRarhRz aDMA / cVar=brBrPr brPrProd brPrihDn brNetPrih brRazhDn brPech brZag brZaeti brNaeti brRarhRz brDMA / mVar=mBrPr mPrProd mPrihDn mNetPrih mRazhDn mPech mZag mZaeti mNaeti mRarhRz mDMA / cnfVar=cnfBrPr cnfPrProd cnfPrihDn cnfNetPrih cnfRazhDn cnfPech cnfZag cnfZaeti cnfNaeti cnfRarhRz cnfDMA / pVar= pBrPr pPrProd pPrihDn pNetPrih pRazhDn pPech pZag pZaeti pNaeti pRarhRz pDMA. STRING cnfVar (A1). IF cVar>0 and cVar<3 cnfVar='A'. *EXECUTE. DO IF Var>0. COMPUTE pVar=mVar*100/aVar. END IF. *EXECUTE. IF cnfVar<>'A' AND pVar>=85 cnfVar='B'. DO IF (cnfVar<>'B') . RECODE pVar (ELSE=SYSMIS) . END IF . FORMATS Var pVar (f11). COMPUTE Varr=RND(Varr). END REPEAT. EXECUTE . * DO REPEAT Varr=V11110 V11210 V12110 V12120 V12150 V12170 V13110 V13120 V13131 V13310 V13320 V13330 V15110 V16110 V16130 V16140 pV12110 pV12120 pV12150 pV12170 pV13110 pV13120 pV13131 pV13310 pV13320 pV13330 pV15110 pV16110 pV16130 pV16140 . * COMPUTE Varr=RND(Varr). * END REPEAT. RENAME VARIABLES (Var2=OBL_ACT). RENAME VARIABLES (Var4=OBJ_ACT). RENAME VARIABLES (Var6=CODE5). COMPUTE SortCol=$casenum. EXECUTE. FORMATS SortCol (F5.0). SAVE OUTFILE=!Path+'Opok_08_T1_A21_obj_r.sav' /COMPRESSED. *Zalepiane danni ot Nomenklaturi. ***************************************. GET FILE=!Path+'Opok_08_T1_A21_obj_r.sav'. SORT CASES BY CODE5 (A). MATCH FILES /FILE=* /TABLE=!NomPath+'KID1_08_gal.sav' /BY CODE5. EXECUTE. SORT CASES BY OBL_ACT (A) OBJ_ACT (A). MATCH FILES /FILE=* /TABLE=!NomPath+'NOM_OBJ_gal.sav' /BY OBL_ACT OBJ_ACT. EXECUTE. * SORT CASES BY OBL_ACT (A). * MATCH FILES /FILE=* /TABLE=!NomPath+'TSB_gal.sav' /BY OBL_ACT. * EXECUTE. SORT CASES BY SortCol (A). DO REPEAT Var = BrPr, pBrPr, PrProd, pPrProd, PrihDn, pPrihDn, NetPrih, pNetPrih, RazhDn, pRazhDn, Pech, pPech, Zag, pZag, Zaeti, pZaeti, Naeti, pNaeti, RarhRz, pRarhRz, DMA , pDMA . COMPUTE Var=RND(Var). END REPEAT. EXECUTE. *T3 - . ******************************. SAVE OUTFILE=!Path+'Opok_08_T1_A21_obj_l.sav' /KEEP SortCol, OBL_ACT, OBL_IME, OBJ_ACT, OBJ_IME, CODE5, IME_K1, BrPr, cnfBrPr, pBrPr, PrProd, cnfPrProd, pPrProd, PrihDn, cnfPrihDn, pPrihDn, NetPrih, cnfNetPrih, pNetPrih, RazhDn, cnfRazhDn, pRazhDn, Pech, cnfPech, pPech, Zag, cnfZag, pZag, Zaeti, cnfZaeti, pZaeti, Naeti, cnfNaeti, pNaeti, RarhRz, cnfRarhRz, pRarhRz, DMA , cnfDMA, pDMA /COMPRESSED. *T1 - . *********************. GET FILE=!Path+'Opok_08_T1_A21_obj_l.sav'. * SORT CASES BY CODE55 (A). FILTER OFF. USE ALL. SELECT IF (OBL_ACT='Total' and OBJ_ACT= 'Total'). EXECUTE. SAVE TRANSLATE OUTFILE=!OutPath+'Opok_BG_08_T1_A21_obj.xls' /TYPE=XLS /VERSION=8 /KEEP OBJ_IME, IME_K1, BrPr, cnfBrPr, pBrPr, PrProd, cnfPrProd, pPrProd, PrihDn, cnfPrihDn, pPrihDn, NetPrih, cnfNetPrih, pNetPrih, RazhDn, cnfRazhDn, pRazhDn, Pech, cnfPech, pPech, Zag, cnfZag, pZag, Zaeti, cnfZaeti, pZaeti, Naeti, cnfNaeti, pNaeti, RarhRz, cnfRarhRz, pRarhRz, DMA , cnfDMA, pDMA /FIELDNAMES /MAP /REPLACE /CELLS=VALUES . ******************************. GET FILE=!Path+'Opok_08_T1_A21_obj_l.sav'. * FILTER OFF. * USE ALL. * SELECT IF (OBL_ACT='Total' and OBJ_ACT= 'Total'). * EXECUTE. DEFINE !REG (BREAKVAR = !TOKENS(1)). !DO !OBL = 1 !TO 9. -GET FILE=!Path+'Opok_08_T1_A21_obj_l.sav'. - ALTER TYPE OBL_ACT(F2). - FILTER OFF. - USE ALL. - SELECT IF(OBL_ACT=!OBL). - EXECUTE. - !LET !LIST = !CONCAT('OBL0',!OBL,'_08_T1_',!BREAKVAR,'.xls'). - CD 'D:\KURS_SPSS\OSN_POK\'. - SAVE TRANSLATE OUTFILE=!LIST /TYPE=XLS /VERSION=8 /KEEP OBJ_IME, IME_K1, BrPr, cnfBrPr, pBrPr, PrProd, cnfPrProd, pPrProd, PrihDn, cnfPrihDn, pPrihDn, NetPrih, cnfNetPrih, pNetPrih, RazhDn, cnfRazhDn, pRazhDn, Pech, cnfPech, pPech, Zag, cnfZag, pZag, Zaeti, cnfZaeti, pZaeti, Naeti, cnfNaeti, pNaeti, RarhRz, cnfRarhRz, pRarhRz, DMA , cnfDMA, pDMA /FIELDNAMES /MAP /REPLACE /CELLS=VALUES. !DOEND. !ENDDEFINE. !REG BREAKVAR = A21_obj. DEFINE !REG (BREAKVAR = !TOKENS(1)). !DO !OBL = 10 !TO 28. -GET FILE=!Path+'Opok_08_T1_A21_obj_l.sav'. - ALTER TYPE OBL_ACT(F2). - FILTER OFF. - USE ALL. - SELECT IF(OBL_ACT=!OBL). - EXECUTE. - !LET !LIST = !CONCAT('OBL',!OBL,'_08_T1_',!BREAKVAR,'.xls'). - CD 'D:\KURS_SPSS\OSN_POK\'. - SAVE TRANSLATE OUTFILE=!LIST /TYPE=XLS /VERSION=8 /KEEP OBJ_IME, IME_K1, BrPr, cnfBrPr, pBrPr, PrProd, cnfPrProd, pPrProd, PrihDn, cnfPrihDn, pPrihDn, NetPrih, cnfNetPrih, pNetPrih, RazhDn, cnfRazhDn, pRazhDn, Pech, cnfPech, pPech, Zag, cnfZag, pZag, Zaeti, cnfZaeti, pZaeti, Naeti, cnfNaeti, pNaeti, RarhRz, cnfRarhRz, pRarhRz, DMA , cnfDMA, pDMA /FIELDNAMES /MAP /REPLACE /CELLS=VALUES. !DOEND. !ENDDEFINE. !REG BREAKVAR = A21_obj. *KRAI.