**************************************************************** This is the program file for "Job Creation and Destruction: The Dominance of Manufacturing" by Joseph A. Ritter in the September/October 1994 Review. The data used in these files will be available upon request. **************************************************************** The following programs create the data set that is used to create the data for each sector. Any programs with a .G extension are written for GAUSS v.3.0. 1) MAKECOL.BAT (need RAW2COL.EXE) 2) COUNTLN (need COUNTLN.EXE) 3) COL2GDS.G 4) ZEROS.G 5) DROP_1.G 6) DROP_2.G 7) DROP_3.G 8) DROP_4.G ************************MAKECOL.BAT**************************** raw2col c:\temp\ee1 allraw raw2col c:\temp\ee2 allraw raw2col c:\temp\ee3 allraw raw2col c:\temp\ee4 allraw raw2col c:\temp\ee5 allraw raw2col c:\temp\ee6 allraw raw2col c:\temp\ee7 allraw raw2col c:\temp\ee8 allraw raw2col c:\temp\ee9 allraw raw2col c:\temp\ee10 allraw raw2col c:\temp\ee11 allraw raw2col c:\temp\ee12 allraw raw2col c:\temp\ee13 allraw raw2col c:\temp\ee14 allraw raw2col c:\temp\ee15 allraw raw2col c:\temp\ee16 allraw raw2col c:\temp\ee17 allraw raw2col c:\temp\ee18 allraw raw2col c:\temp\ee19 allraw raw2col c:\temp\ee20 allraw raw2col c:\temp\ee21 allraw raw2col c:\temp\ee22 allraw raw2col c:\temp\ee23 allraw raw2col c:\temp\ee24 allraw raw2col c:\temp\ee25 allraw raw2col c:\temp\ee26 allraw raw2col c:\temp\ee27 allraw echo off echo NOW: echo 1. Calculate total number of series. echo 2. Multiply by number of obs. per series. echo 3. Run COUNTLN on ALLRAW.COL. echo 4. Change number of series in COL2GDS.G, then run it. ************************COL2GDS.G******************************* * Program to transform ASCII file with a single column of data into a GAUSS data set. ASCII file looks like: X_1 ¿ X_2 ³ . ³ 1st series . ³ . ³ X_T Ù Y_1 ¿ Y_2 ³ . ³ 2nd series . ³ . ³ Y_T Ù */ /* -------- Only this stuff needs to be modified for different file --------- */ bigT = 672 ; @ number of time series observations @ bigN = 661 ; @ number of series @ colfile = "allraw.col" ; @ ASCII file @ namefile = "allraw.nam" ; @ File containing names @ ; gdsfile = "alldata" ; @ GAUSS will attach .DAT and .DHT extensions. @ /* -------------------------------------------------------------------------- */ load alldata[bigN,bigT] = ^colfile ; @ Data is loaded row by row. @ alldata = alldata' ; @ So transpose it before writing. @ load allnames[] = ^namefile ; if not saved( alldata, gdsfile, allnames ) ; print "Error writing data set." ; endif ; print "Next run ZEROS.G." *************************ZEROS.G******************************** @Turns missing values from original data set to zeros and creates date and line number.@ new; OPEN INFILE = ALLDATA.DAT FOR READ; INNAMES = GETNAME("ALLDATA"); VNAMES = { COUNT, MDATE }; NNAMES = VNAMES | INNAMES ; CREATE OUTFILE = ALLDATA2.DAT WITH ^NNAMES, 0, 8; BASE=1; STOPTHIS = 0 ; DO UNTIL EOF(INFILE) ; X = 0 ; X = READR(INFILE,61); IF STOPTHIS == 0 ; /* The following line checks to see if any row of X adds up to something other than a missing, i.e., whether all data have started. */ STOPTHIS = NOT SCALMISS(PACKR(SUMC(X'))) ; IF STOPTHIS == 1 ; PRINT "STOPPING MISSING REPLACEMENT" ; ENDIF ; X = MISSRV(X,0) ; ENDIF ; COUNT = SEQA(BASE,1,ROWS(X)); MDATE = 1939 + (COUNT-1)/12; BASE = BASE + ROWS(X); X = COUNT~MDATE~X; ROWSRIT = WRITER(OUTFILE,X) ; ENDO ; CLOSEALL INFILE OUTFILE; PRINT "Now run DROP_1.G." ***************************DROP_1.G***************************** DROP_1.G, 6/94 vintage @ @Drops all unneeded series and creates residual SICs and creates residual series. @ @ NOTE: Two special cases are EU53510R and EU80870R end up being all 0. We dropped them in previous versions. These exceptions were still built into succeeding programs, but now as of 10/93 they are not treated specially. @ @ Industries with no subindustries that will appear in the sample do not appear in DROP_1 .. DROP_4 (no reason to do so). @ NEW 1500 150000 ; et1 = hsec ; DATALOOP ALLDATA2 DROP1 ; @ EEU@ DROP EU000000 EU005000 EU005100 @ EU535100 EU808700 <-- 10/93 changes @ EU900000 EU910000 EU919100 EU919110 EU919120 EU919130 EU919500 EU919600 EU923000 EU923730 EU924000 EU928000 EU928060 EU930000 EU940000 EU948060 EU948200 EU949000 EU950000 EU954000 EU958060 EU958200 EU959000; @ ADDED IN 6/94@ DROP EU941000 EU951000; @EE1@ MAKE EU10100R = EU101000-EU101010-EU101020; MAKE EU10120R = EU101200-EU101220; MAKE EU10130R = EU101300-EU101310-EU101380; MAKE EU10140R = EU101400-EU101420-EU101440-EU101470; @EE2@ MAKE EU20150R = EU201500-EU201520-EU201530-EU201540; MAKE EU20160R = EU201600-EU201610-EU201620; MAKE EU20170R = EU201700-EU201710-EU201720-EU201730-EU201740- EU201750-EU201760; ENDATA ; @ DROP1 @ et2 = hsec ; (et2-et1)/100 ; run drop_2.g ; **************************DROP_2.G****************************** DROP_2.G, 6/94 vintage @ NEW 1500 150000 ; et1 = hsec ; DATALOOP DROP1 DROP2 ; @EE3@ MAKE EU31242R = EU312420-EU312421-EU312426; MAKE EU31243R = EU312430-EU312431-EU312434-EU312435-EU312436; MAKE EU31245R = EU312450-EU312451; MAKE EU31240R = EU312400-EU312410-EU312420-EU312430-EU312440-EU312450- EU312490; MAKE EU31322R = EU313220-EU313221-EU313229; MAKE EU31327R = EU313270-EU313271-EU313272-EU313273; MAKE EU31331R = EU313310-EU313312-EU313317; MAKE EU31332R = EU313320-EU313321-EU313322-EU313325; MAKE EU31333R = EU313330-EU313334; MAKE EU31335R = EU313350-EU313351-EU313353-EU313357; MAKE EU31336R = EU313360-EU313365; MAKE EU31330R = EU313300-EU313310-EU313320-EU313330-EU313350-EU313360; MAKE EU31342R = EU313420-EU313425-EU313429; MAKE EU31343R = EU313430-EU313432-EU313433; @ Turns out to be zero: @ MAKE EU31345R = EU313450-EU313451-EU313452; MAKE EU31347R = EU313470-EU313471-EU313479; MAKE EU31349R = EU313490-EU313494-EU313496; @ Turns out to be zero: @ MAKE EU31351R = EU313510-EU313511-EU313519; MAKE EU31352R = EU313520-EU313523; MAKE EU31353R = EU313530-EU313531-EU313532-EU313533-EU313535-EU313537; MAKE EU31354R = EU313540-EU313541-EU313542-EU313544-EU313545-EU313546; MAKE EU31355R = EU313550-EU313552-EU313555-EU313556; MAKE EU31357R = EU313570-EU313571-EU313579; MAKE EU31358R = EU313580-EU313585; MAKE EU31359R = EU313590-EU313592-EU313599; @ Turns out to be zero: @ MAKE EU31361R = EU313610-EU313612-EU313613; MAKE EU31362R = EU313620-EU313621-EU313625; MAKE EU31363R = EU313630-EU313632-EU313633-EU313634; MAKE EU31364R = EU313640-EU313641-EU313643-EU313644-EU313645; MAKE EU31365R = EU313650-EU313651; MAKE EU31366R = EU313660-EU313661; MAKE EU31367R = EU313670-EU313671-EU313674-EU313679; MAKE EU31371R = EU313710-EU313711-EU313713-EU313714-EU313715; MAKE EU31372R = EU313720-EU313721-EU313724-EU313728; MAKE EU31379R = EU313790-EU313792; MAKE EU31391R = EU313910-EU313911; MAKE EU31394R = EU313940-EU313944-EU313949; MAKE EU31399R = EU313990-EU313993; MAKE EU32201R = EU322010-EU322011-EU322013-EU322015; MAKE EU32202R = EU322020-EU322022-EU322026; MAKE EU32203R = EU322030-EU322032-EU322033-EU322037; MAKE EU32204R = EU322040-EU322041-EU322048; MAKE EU32206R = EU322060-EU322061-EU322062-EU322063-EU322064; MAKE EU32208R = EU322080-EU322082-EU322086; MAKE EU32210R = EU322100-EU322110; MAKE EU32225R = EU322250-EU322251-EU322252-EU322253-EU322254-EU322257; MAKE EU32226R = EU322260-EU322261-EU322262; MAKE EU32228R = EU322280-EU322281-EU322282; MAKE EU32220R = EU322200-EU322210-EU322220-EU322230-EU322240-EU322250- EU322260-EU322270-EU322280-EU322290; MAKE EU32232R = EU322320-EU322321-EU322325-EU322326; MAKE EU32233R = EU322330-EU322331-EU322335-EU322337-EU322339; MAKE EU32234R = EU322340-EU322341-EU322342; MAKE EU32236R = EU322360-EU322361; MAKE EU32239R = EU322390-EU322391-EU322392-EU322396; MAKE EU32230R = EU322300-EU322310-EU322320-EU322330-EU322340-EU322360- EU322380-EU322390; MAKE EU32265R = EU322650-EU322653-EU322656-EU322657; MAKE EU32267R = EU322670-EU322672-EU322673-EU322677; MAKE EU32260R = EU322600-EU322620-EU322630-EU322650-EU322670; MAKE EU32273R = EU322730-EU322731-EU322732; MAKE EU32275R = EU322750-EU322752-EU322759; MAKE EU32270R = EU322700-EU322710-EU322720-EU322730-EU322740-EU322750- EU322760-EU322780-EU322790; MAKE EU32281R = EU322810-EU322819; MAKE EU32282R = EU322820-EU322821-EU322824; MAKE EU32283R = EU322830-EU322834; MAKE EU32284R = EU322840-EU322841-EU322843-EU322844; MAKE EU32286R = EU322860-EU322865-EU322869; MAKE EU32280R = EU322800-EU322810-EU322820-EU322830-EU322840-EU322850- EU322860-EU322870-EU322890; MAKE EU32290R = EU322900-EU322910-EU322950; MAKE EU32305R = EU323050-EU323052; MAKE EU32300R = EU323000-EU323010-EU323020-EU323050-EU323060-EU323080; MAKE EU32314R = EU323140-EU323143-EU323144; MAKE EU32310R = EU323100-EU323110-EU323140-EU323160-EU323170; ENDATA ; @ DROP2 @ (hsec - et1)/100 ; run drop_3.g ; ***************************DROP_3.G***************************** @ DROP_3.G, 6/94 vintage @ NEW 1500 150000 ; et1 = hsec ; DATALOOP DROP2 DROP3 ; @EE4@ MAKE EU41400R = EU414000-EU414011; MAKE EU41410R = EU414100-EU414110-EU414120-EU414130-EU414150; MAKE EU41420R = EU414200-EU414210-EU414220; MAKE EU41440R = EU414400-EU414440-EU414490; MAKE EU41450R = EU414500-EU414510-EU414580; MAKE EU41472R = EU414720-EU414724; MAKE EU41470R = EU414700-EU414720-EU414730; MAKE EU42483R = EU424830-EU424832-EU424833; MAKE EU42480R = EU424800-EU424810-EU424830-EU424840; MAKE EU42490R = EU424900-EU424910-EU424920-EU424930-EU424950; @EE5@ MAKE EU52501R = EU525010-EU525012-EU525013; MAKE EU52502R = EU525020-EU525021-EU525023; MAKE EU52503R = EU525030-EU525031-EU525039; /* Modified below in 10/93 revision: MAKE EU52504R = EU525040-EU525045-EU525047; */ MAKE EU52506R = EU525060-EU525063-EU525064-EU525065; MAKE EU52507R = EU525070-EU525072-EU525074; MAKE EU52508R = EU525080-EU525082-EU525083-EU525084-EU525085; MAKE EU53514R = EU535140-EU535141-EU535147-EU535148; MAKE EU53517R = EU535170-EU535171-EU535172; MAKE EU53518R = EU535180-EU535181-EU535182; MAKE EU53519R = EU535190-EU535191; @ Added 10/93 to integrate treatment of 808700 and 535100: @ @ It will be all zeros. Starts in 1972. @ MAKE EU53510R = EU535100 - EU535110 - EU535120 - EU535130 - EU535140 - EU535150 - EU535160 - EU535170 - EU535180 - EU535190 ; @EE6@ /* Modified below for 10/93 revision: MAKE EU60520R = EU605200-EU605210-EU605250-EU605260; */ MAKE EU60530R = EU605300-EU605310-EU605330-EU605390; MAKE EU60540R = EU605400-EU605410-EU605420-EU605450-EU605460; MAKE EU60550R = EU605500-EU605510-EU605530-EU605540-EU605590; MAKE EU60560R = EU605600-EU605610-EU605620-EU605650-EU605660; MAKE EU60571R = EU605710-EU605712; MAKE EU60573R = EU605730-EU605731-EU605735; MAKE EU60570R = EU605700-EU605710-EU605720-EU605730; MAKE EU60594R = EU605940-EU605941-EU605942-EU605943-EU605944-EU605947- EU605949; MAKE EU60596R = EU605960-EU605961-EU605962; MAKE EU60590R = EU605900-EU605910-EU605920-EU605930-EU605940-EU605960- EU605980-EU605990; @EE7@ /* Modified below for 10/93 revision: MAKE EU71602R = EU716020-EU716022; */ MAKE EU71600R = EU716000-EU716020-EU716030-EU716060; @ Added 10/93: @ MAKE EU71603R = EU716030 - EU716035 - EU716036 ; MAKE EU71610R = EU716100-EU716140-EU716150-EU716160; MAKE EU71620R = EU716200-EU716210-EU716230-EU716280; MAKE EU71670R = EU716700-EU716710; MAKE EU72630R = EU726300-EU726310-EU726320-EU726330-EU726360; MAKE EU73650R = EU736500-EU736510-EU736530-EU736550; @EE8@ MAKE EU80700R = EU807000-EU807010; MAKE EU80720R = EU807200-EU807210-EU807220-EU807230-EU807260-EU807290; MAKE EU80731R = EU807310-EU807311; MAKE EU80733R = EU807330-EU807334; @CHANGED IN 6/94 ADDED EU807352 AND EU807359@ MAKE EU80735R = EU807350-EU807353-EU807352-EU807359; MAKE EU80736R = EU807360-EU807361-EU807363; MAKE EU80737R = EU807370-EU807371-EU807372-EU807373-EU807374-EU807375- EU807378; /* Modified below for 10/93 revision: MAKE EU80750R = EU807500-EU807510-EU807520-EU807530; */ MAKE EU80760R = EU807600-EU807620; @CHANGED IN 6/94 ADDED EU8087840 @ MAKE EU80780R = EU807800-EU807810-EU807830-EU808740; MAKE EU80799R = EU807990-EU807991-EU807997; MAKE EU80790R = EU807900-EU807930-EU807990; MAKE EU80805R = EU808050-EU808051-EU808052-EU808059; MAKE EU80806R = EU808060-EU808062-EU808063-EU808069; MAKE EU80800R = EU808000-EU808010-EU808020-EU808040-EU808050-EU808060- EU808070-EU808080; MAKE EU80820R = EU808200-EU808210-EU808220-EU808240; /* Modified below for 10/93 revision: MAKE EU80830R = EU808300-EU808320-EU808330-EU808350-EU808360; */ MAKE EU80860R = EU808600-EU808610-EU808620-EU808630-EU808640; MAKE EU80871R = EU808710-EU808711-EU808712-EU808713; @CHANGED IN 6/94 ADDED EU808741 AND EU808742@ MAKE EU80874R = EU808740-EU808743-EU808741-EU808742; @ Added 10/93 to integrate treatment of 808700 and 535100: @ @ It will be all zeros. Doesn't start until 1988 anyway. @ MAKE EU80870R = EU808700 - EU808710 - EU808720 - EU808730 - EU808740 ; @ New in second update 10/93: @ MAKE EU41451R=EU414510-EU414512; MAKE EU42481R=EU424810-EU424813; MAKE EU52504R=EU525040-EU525044-EU525045-EU525047; MAKE EU53511R=EU535110-EU535112; MAKE EU60520R=EU605200-EU605210-EU605230-EU605250-EU605260; @CHANGED IN 6/94 ADDED EU605995 AND EU605999@ MAKE EU60599R=EU605990-EU605994-EU605995-EU605999; MAKE EU71602R=EU716020-EU716022-EU716029; MAKE EU72632R=EU726320-EU726324; MAKE EU80070R=EU800700-EU800740-EU800780; MAKE EU80751R=EU807510-EU807514; MAKE EU80753R=EU807530-EU807534-EU807538; MAKE EU80754R=EU807540-EU807542; MAKE EU80750R=EU807500-EU807510-EU807520-EU807530-EU807540; MAKE EU80804R=EU808040-EU808042; MAKE EU80830R=EU808300-EU808320-EU808330-EU808350-EU808360-EU808390; @The following equations transform 2-digit SICs with no sub-industries to 2-digit residuals. This will allow those SICs to be recognized in following programs.@ MAKE EU41460R = EU414600; MAKE EU60580R = EU605800; MAKE EU72640R = EU726400; MAKE EU80810R = EU808100; MAKE EU80840R = EU808400; MAKE EU80890R = EU808900; DROP EU414600 EU605800 EU726400 EU808100 EU808400 EU808900; @This set of equations was restructured due to startdate differences. In all of these cases, 4-digit industries began before their 3-digit parents, but after or at the same time as their 2-digit grandparents. When the 3-digit residuals are created below, negative values appear when the 4-digit industry exists, but not the 3-digit. In the next dataloop, those negative values are converted to zeros so that the 3-digit residuals can be subtracted from their 2-digit parents without distorting the 2-digit residuals. @ MAKE EU31251R = EU312510-EU312515-EU312511-EU312512-EU312514; MAKE EU31329R = EU313290-EU313291-EU313292-EU313296; MAKE EU31341R = EU313410-EU313411; MAKE EU31344R = EU313440-EU313441-EU313442-EU313443-EU313444-EU313446; MAKE EU31346R = EU313460-EU313462-EU313465-EU313469; MAKE EU31348R = EU313480-EU313483; MAKE EU31356R = EU313560-EU313561-EU313562-EU313563-EU313564-EU313566- EU313568; MAKE EU31369R = EU313690-EU313691-EU313694; @ Turns out to be zero: @ MAKE EU31373R = EU313730-EU313731-EU313732; MAKE EU31376R = EU313760-EU313761; MAKE EU31382R = EU313820-EU313822-EU313823-EU313825; MAKE EU31384R = EU313840-EU313841-EU313842; MAKE EU31396R = EU313960-EU313961; MAKE EU32205R = EU322050-EU322051-EU322053; MAKE EU52509R = EU525090-EU525093; MAKE EU80738R = EU807380-EU807381-EU807382-EU807384; @ Revised 10/93: MAKE EU80873R = EU808730-EU808731-EU808733; @ MAKE EU80873R=EU808730-EU808731-EU808733-EU808732; @ADDED IN 6/94@ MAKE EU80734R=EU807340-EU807342-EU807349; ENDATA; @ DROP3 @ (hsec-et1)/100 ; run drop_4.g ; ****************************DROP_4.G**************************** @ DROP_4.G, 6/94 vintage @ NEW 1500 150000 ; et1 = hsec ; OPEN INFILE = "DROP3" FOR READ; NNAMES = GETNAME("DROP3"); CREATE OUTFILE = DROP4 WITH ^NNAMES, 0, 8 ; do until eof(infile) ; X = 0 ; X = readr(infile, 50) ; X = (X .> 0) .* X ; rowsrit = writer(outfile, X) ; endo ; infile = close(infile) ; outfile = close(outfile) ; /* Creates final residuals after the negatives have been converted to zeros. In these formulas, the remaining 2-digit residuals are created which were affected by the 3-digit/4-digit startdate differences. The residuals are formed by subtracting the unaffected 3-digit industries, the affected 3-digit residuals, and the affected 4-digit industries from their 2-digit parents. */ DATALOOP DROP4 DROP5; MAKE EU31250R = EU312500-EU31251R-EU312515-EU312511-EU312512-EU312514- EU312520-EU312530-EU312540-EU312590; MAKE EU31320R = EU313200-EU313210-EU313220-EU313230-EU313240-EU313250- EU313260-EU313270-EU31329R-EU313291-EU313292-EU313296; MAKE EU31340R = EU313400-EU31341R-EU313411-EU313420-EU313430-EU31344R- EU313441-EU313442-EU313443-EU313444-EU313446-EU313450- EU31346R-EU313462-EU313465-EU313469-EU313470-EU31348R- EU313483-EU313490; MAKE EU31350R = EU313500-EU313510-EU313520-EU313530-EU313540-EU313550- EU31356R-EU313561-EU313562-EU313563-EU313564-EU313566- EU313568-EU313570-EU313580-EU313690; MAKE EU31360R = EU313600-EU313610-EU313620-EU313630-EU313640-EU313650- EU313660-EU313670-EU31369R-EU313691-EU313694; MAKE EU31370R = EU313700-EU313710-EU313720 @-EU31373R@ -EU313731-EU313732- EU313740-EU31376R-EU313761-EU313790; MAKE EU31380R = EU313800-EU313810-EU31382R-EU313822-EU313823-EU313825- EU31384R-EU313841-EU313842-EU313850-EU313860-EU313870; MAKE EU31390R = EU313900-EU313910-EU313930-EU313940-EU313950-EU31396R- EU313961-EU313990; MAKE EU32200R = EU322000-EU322010-EU322020-EU322030-EU322040-EU32205R- EU322051-EU322053-EU322060-EU322070-EU322080-EU322090; MAKE EU52500R = EU525000-EU525010-EU525020-EU525030-EU525040-EU525050- EU525060-EU525070-EU525080-EU52509R-EU525093; @CHANGED IN 6/94 ADDED EU80734R@ MAKE EU80730R = EU807300-EU807310-EU807320-EU807330-EU807350- EU807360-EU807370-EU80738R-EU807381-EU807382-EU807384- EU80734R-EU807342-EU807349; DROP EU312510 EU313290 EU313410 EU313440 EU313460 EU313480 EU313560 EU313690 EU313730 EU313760 EU313820 EU313840 EU313960 EU525090 EU807380 EU808730 EU312500 EU313200 EU313400 EU313500 EU313600 EU313700 EU313800 EU313900 EU525000 EU807300 EU322050 EU322000 EU716030 EU100000 EU101000 EU101200 EU101300 EU101400 EU200000 EU201500 EU201600 EU201700 EU300000 EU310000 EU312400 EU312420 EU312430 EU312450 EU313220 EU313270 EU313300 EU313310 EU313320 EU313330 EU313350 EU313360 EU313420 EU313430 EU313450 EU313470 EU313490 EU313510 EU313520 EU313530 EU313540 EU313550 EU313570 EU313580 EU313590 EU313610 EU313620 EU313630 EU313640 EU313650 EU313660 EU313670 EU313710 EU313720 EU313790 EU313910 EU313940 EU313990 EU320000 EU322010 EU322020 EU322030 EU322040 EU322060 EU322080 EU322100 EU322200 EU322250 EU322260 EU322280 EU322300 EU322320 EU322330 EU322340 EU322360 EU322390 EU322600 EU322650 EU322670 EU322700 EU322730 EU322750 EU322800 EU322810 EU322820 EU322830 EU322840 EU322860 EU322900 EU323000 EU323050 EU323100 EU323140 EU390000 EU391000 EU400000 EU410000 EU420000 EU414000 EU414100 EU414200 EU414400 EU414500 EU414700 EU414720 EU424800 EU424830 EU424900 EU500000 EU510000 EU525010 EU525020 EU525030 EU525040 EU525060 EU525070 EU525080 EU535140 EU535170 EU535180 EU535190 EU600000 EU605200 EU605300 EU605400 EU605500 EU605600 EU605700 EU605710 EU605730 EU605900 EU605940 EU605960 EU700000 EU710000 EU720000 EU730000 EU716000 EU716020 EU716100 EU716200 EU716700 EU726300 EU736500 EU800000 EU807000 EU807200 EU807310 EU807330 EU807350 EU807360 EU807370 EU807500 EU807600 EU807800 EU807900 EU807990 EU808000 EU808050 EU808060 EU808200 EU808300 EU808600 EU808710 EU808740; @ New drops in second update. 10/93 @ DROP EU414510 EU424810 EU535110 EU605990 EU726320 EU807510 EU807530 EU807540 EU808040 EU800700 EU535100 EU808700; @ADDED IN 6/94@ DROP EU807340; @ KILL OFF ROWS BEFORE 1947 AND AFTER 1994. @ DELETE MDATE >= 1995 OR MDATE < 1947 ; DROP COUNT MDATE ; ENDATA; @This final pass corrects a mysterious problem with the ascii data. When one or more numbers are subtracted from another number and the outcome should equal zero, the result about half of the time is essentially zero, but not zero. This throws off the START program which looks for startdates by testing for zeros. To correct for this, the following commands convert all numbers that are less than one to zeros.@ OPEN INFILE = "DROP5" FOR READ; NAMES = GETNAME("DROP5"); CREATE OUTFILE = MAIN WITH ^NAMES, 0, 8 ; do until eof(infile) ; X = 0 ; X = readr(infile, 50) ; X = (X .> 1) .* X ; rowsrit = writer(outfile, X) ; endo ; infile = close(infile) ; outfile = close(outfile) ; print "Now copy MAIN.DAT, MAIN.DHT to version directory and" ; print "run MAIN_ST.G." ; (hsec-et1)/100 ; **************************************************************** The following programs use MAIN.DAT and MAIN.DHT (created in the above programs). These programs are written for GAUSS v.3.0. The CODES= line in DUMP.G is the only line that needs to be changed to create data for the different sectors of the economy. CODES=10203132 >> GOODS PRODUCING 525360 >> TRADE 414271727380 >> SERVICE PRODUCING WITHOUT TRADE 414252536071727380 >> SERVICE PRODUCING WITH TRADE 3132 >> MANUFACTURING 1) 1DUMP.G 2) 2STDATES.G 3) 3START.G 4) 4MADEFR.G 5) 5C&D.G *************************1DUMP.G********************************* /* This program follows MAIN.G and results in a dataset with only sector industries included. Change the lines following the new command. The VERSION string names the output dataset. The CODES string is a list of the BLS 2-digit sector codes run together, e.g., CODES="3132" for durable (31) and nondurable (32) manufacturing. startdat is used to kill off unneeded observations. */ new ; CODES = "10203132" ; startdat = 1972.0 ; BOT = 1947.0 ; @ Beginning Of Time = start of series in MAIN.DAT @ VERSION = "sector1"; mainame = "main" ; COLNAMES = GETNAME( mainame ) ; COLUMNS = ROWS(COLNAMES); DROPS = { BEGIN }; COUNTER = 1; DO WHILE COUNTER <= COLUMNS; NAME = CVTOS(COLNAMES[COUNTER]); POS3A4 = STRSECT(NAME,3,2); @ the sector code of this industry @ Q = STRINDX(CODES,POS3A4,1) ; @ Q = 0 if POS3A4 not found. Otherwise we want to make sure it is odd since all sector codes are 2-digit. @ IF NOT ((Q > 0) AND (Q % 2 == 1)) ; DROPS = DROPS|COLNAMES[COUNTER] ; ENDIF; COUNTER = COUNTER +1; ENDO; @ Kill data before STARTDAT. @ open mfile = ^mainame for read ; mdate = seqa(bot,1/12,rowsf(mfile)) ; mfile = close(mfile) ; dropmask = (mdate .< startdat) ; droprows(mainame,"droprows",dropmask); IF ROWS(DROPS) > 1; DROPS = DROPS[2:ROWS(DROPS)]; SAVE DROPS; IF NOT DROPLIST( "droprows", VERSION, DROPS); PRINT "PROBLEM DROPPING VARIABLES IN DROPS VECTOR."; ENDIF; ELSE; PRINT "NO DROPS."; ENDIF; print "Next..."; print "Run 2STDATES.G ;" ; **************************2STDATES.G***************************** * Run AFTER 1dump.g and BEFORE 3start.g. Creates a vector of startdates, one for each column of SECTOR1.DAT. The only line that needs to be changed for different sectors is the startdat = line. */ @ THIS ASSUMES THAT SECTOR.DAT DOES NOT HAVE THE MDATE AND COUNTER VARIABLES IN IT! @ new ; startdat = 1972.0 ; readrows = 50 ; @ Rows to read at one time. @ open sectdata = sector1.dat for read; sectcols = colsf(sectdata) ; sect_st = zeros(1,sectcols) ; newstart = zeros(1,sectcols) ; started = zeros(1,sectcols) ; lrly = ones(1,sectcols) ; @ Ones indicate no industries started before loop. @ basedate = startdat ; do until eof(sectdata) ; x = 0 ; x = readr(sectdata,readrows) ; rowsx = rows(x) ; @ Rows actually read. May be < readrows at eof. @ y = (x .== 0) ; @ 1s in y where there are 0s in x @ z = sumc(y)' ; @ z=rowsx if doesn't exist yet, 0 0) ; @ Now pick up industries that fall through the cracks between reads. @ @ Also picks up industries that are already going on first iteration. @ newstart = newstart + (y[1,.] ./= lrly) ; @ Toss out the ones already started that got in b/c they went back to zero employment. @ newstart = newstart .and .not started ; started = started + newstart ; @ Now update sect_st for new industries: @ sect_st = sect_st + newstart .* ( basedate + (z / 12) ) ; lrly = y[rowsx,.] ; basedate = basedate + rowsx/12 ; endo ; sectdata = close(sectdata) ; round_st = round(sect_st) ; if sumc(abs(round_st - sect_st) .> 0.00001) > 0 ; print "SECT_ST is not behaving. Left unrounded." ; else ; sect_st = round_st ; endif ; sect_st = sect_st' ; save sect_st ; print "Next..." ; print "Run 3START.G ;" ; ***************************3START.G****************************** * Run AFTER 2stdates.g and BEFORE 4madefr.g. Lines that need to be changed are: YEAR = Drops 2-digit industries that start after the startdate (YEAR and MONTH). Drops 3-digit industries that start after the startdate and are components of the 2-digit industries that are dropped. Outputs a list of all dropped industries. Strategy: Loop i over industries. If i starts after startdate then begin If i is a 2-digit then drop. If i is a 3-digit then look at its parent 2-digit. If that is to be dropped, then drop the 3-digit also. If i is a 4-digit then look at its parent 3-digit. If that is to be dropped, then drop the 4-digit also. end */ new ; YEAR = 1972.0000; @ START YR OF THIS RUN @ MONTH = 0; @ START MO OF THIS RUN @ INVER = "SECTOR1" ; @ NAME OF INPUT DATASET @ OUTVER = "SECTOR3" ; @ NAME OF OUTPUT DATASET @ MODATE = YEAR + MONTH/12; @ START DATE OF THIS RUN @ COLNAMES = GETNAME(INVER); COLUMNS = ROWS(COLNAMES); COUNTER = 1; LOAD SICSTART = SECT_ST ; @ VECTOR OF STARTDATES CREATED BY 2STDATES.G @ DROPS = { BEGIN } ; /* */ DO WHILE COUNTER <= COLUMNS; NAME = CVTOS(COLNAMES[COUNTER]); IF SICSTART[COUNTER] > MODATE ; POS7 = STRSECT(NAME,7,1) ; POS8 = STRSECT(NAME,8,1) ; POS7AND8 = STRSECT(NAME,7,2) ; IF POS7AND8 $== "0R" ; @ A 2-DIGIT TO BE DROPPED @ DROPS = DROPS|COLNAMES[COUNTER] ; ELSE ; IF (POS7 $/= "0") AND ((POS8 $== "0") OR (POS8 $== "R")) ; @ THIS IS A 3-DIGIT. CHECK THE PARENT. @ PNAME = STRSECT(NAME,1,6) $+ "0R" ; @ 2-DIGIT NAME @ WHEREP = INDCV(PNAME,COLNAMES) ; IF ISMISS(WHEREP) ; PRINT("I am baffled.") ; PRINT NAME ; END ; ELSE ; IF SICSTART[WHEREP] > MODATE ; DROPS = DROPS|COLNAMES[COUNTER] ; ENDIF ; ENDIF ; ELSE ; @ THIS IS A 4-DIGIT. CHECK PARENT AND, IF NEC. THE GRANDPARENT. @ PNAME = STRSECT(NAME,1,7) $+ "R" ; @ 3-DIGIT NAME @ WHEREP = INDCV(PNAME,COLNAMES) ; @ CONTORTIONS TO MAKE THE NEXT IF WORK IF WHEREP IS MISSING: @ LOOK4A2 = 0 ; @ BOOLEAN WILL TELL IF WE LOOK FOR A 2-DIGIT. @ IF ISMISS(WHEREP) ; LOOK4A2 = 1 ; ELSE ; IF SICSTART[WHEREP] > MODATE ; LOOK4A2 = 1 ; ENDIF ; ENDIF ; IF LOOK4A2 ; @ NO 3-DIGIT OR 3-DIGIT STARTS LATE, SO LOOK FOR 2-DIGIT. @ PNAME = STRSECT(NAME,1,6) $+ "0R" ; @ 2-DIGIT NAME @ WHEREP = INDCV(PNAME, COLNAMES) ; IF ISMISS(WHEREP) ; PRINT("I am baffled.") ; PRINT NAME ; END ; ELSE ; IF (SICSTART[WHEREP] > MODATE) ; DROPS = DROPS|COLNAMES[COUNTER] ; ENDIF ; ENDIF ; ELSE ; IF SICSTART[WHEREP] > MODATE ; DROPS = DROPS|COLNAMES[COUNTER] ; ENDIF ; ENDIF ; ENDIF ; ENDIF ; ENDIF ; COUNTER = COUNTER + 1 ; ENDO ; IF ROWS(DROPS) > 1 ; DROPS = DROPS[2:ROWS(DROPS)] ; SAVE DROPS ; @ TO CHECK LATER. @ IF NOT DROPLIST(INVER, OUTVER, DROPS) ; PRINT "Problem dropping variables in DROPS vector." ; END ; ENDIF ; ELSE ; PRINT "No drops. SECTOR3.DAT not created." ; ENDIF ; print "Next..." ; print "Run 4MADEFR.G ;" ; ****************************4MADEFR.G**************************** * Run AFTER 3start.g and BEFORE 5c&d.g. Only need to change start date. 4MADEFR.G creates a vector which has one element for each column of SECTOR3.DAT (or SECTOR1.DAT if SECTOR3.DAT does not exist which happens when they would be identical) An element is zero if the industry existed at the start of the sample (STARTDAT). If the industry did not exist the corresponding element points to the industry from which the new industry was carved out. 1. Create a vector of industry start dates. 2. Create a vector of names of all the variables in SECTOR3.DAT then change those of child industries to be the names of the parent. 3. Next compare the modified name vector to the original to create a vector of numerical pointers (madefrom). First step is to create a vector of industry start dates. */ new ; startdat = 1972.0 ; readrows = 50 ; snames1 = getname("sector1") ; if files("sector3.dat",0) /= 0 ; snames3 = getname("sector3") ; else ; snames3 = snames1 ; endif ; load sect_st ; secinds = indcv(snames3,snames1) ; sicstart = sect_st[secinds] ; save sicstart ; seccols = rows(snames3) ; /* Next step is to loop through the industries and substitute the parent's name for child industries (sicstart > 1947). For 4-digit industries we substitute grandparent's name if parent isn't found or starts at same time or after the 4-digit. */ allnames = snames3 ; nvec = allnames ; i = 1 ; do while i <= seccols ; if sicstart[i] > startdat ; thisname = cvtos(allnames[i]) ; @ put into string for easier handling @ if (strsect(thisname,7,1) $/= "0") ; @ otherwise this is a late-starting 2-digit SIC or residual and should have been dropped @ if (strsect(thisname,8,1) $== "R") or (strsect(thisname,8,1) $== "0") ; @ 3-digit level @ @ substitute name is thisname with positions 7 and 8 changed to "0R" to indicate a 2-digit residual. @ parent = strput("0R", thisname, 7) ; else ; @ 4-digit SIC @ @ A 4-digit may have been created from a 3-digit or a 2-digit. 4-digit should point to 2-digit if 4-digit starts at the same time or earlier than 3-digit or no 3-digit exists.@ @ change position 8 to "R" to point to hypothetical 3-digit parent residual: @ parent = strput("R", thisname, 8) ; @ Does the 3-digit parent residual actually exist?: @ wherep = indcv(parent,allnames); @ contortions to prevent indexing a vector with a missing value: @ use2dig = 0 ; @ does 3-digit parent exist?: @ if ismiss(wherep) ; @ then made from 2-digit @ use2dig = 1 ; endif ; if use2dig == 0 ; @ was 3-digit parent was born after child?: @ if sicstart[wherep] >= sicstart[i] ; @ then parent starts at same time or later than i @ use2dig = 1 ; endif ; endif ; if use2dig == 1 ; @ if using 2-digit parent for either reason @ parent = strput("0R", thisname, 7) ; if ismiss(indcv(parent,allnames)) ; print "I am baffled." ; print thisname$+" "$+parent ; endif ; endif ; endif ; nvec[i] = parent ; @ put parent pointer in nvec @ else ; print "This should not happen at this stage!" ; print thisname ; end ; endif ; endif ; i = i + 1 ; endo ; /* At this point nvec[i] contains name of parent of industry i if there is one. Otherwise it contains the name of industry i. Next compare the modified name vector to the original to create a vector of numerical pointers. */ madefrom = indcv(nvec, allnames) ; @ At this point madefrom contains pointers to parent if exists or self otherwise. @ madefrom = madefrom .* ( allnames ./= nvec ) ; @ This makes all the pointers to self = 0. @ save madefrom ; print "Next..." ; print "Run 5C&D.G ;" ; ******************************5C&D.G***************************** new ; load madefrom ; startdat = 1972 ; /* For different version change loadd line and 2 lines at end. */ oldmaxv = __maxvec ; __maxvec = 500000 ; if files("sector3.dat",0) /= 0 ; E = loadd("sector3") ; else ; E = loadd("sector1") ; endif ; __maxvec = oldmaxv ; numsic = cols(E) ; bigT = rows(E) ; E = E' ; @ transpose for convenience @ totalE = sumc(E) ; active = E[.,1] .> 0 ; jc = zeros(1,bigT) ; jd = jc ; t = 2 ; @ Loop until we hit bigT or there are some missings so totalE is missing: @ do while (t<=bigT) and (not scalmiss(totalE[t])) ; Et = E[.,t] ; @ New starts are the ones that were not active in t-1 but @ @ have positive employment in t. @ newstart = Et .> 0 .and .not active ; @ Produce a vector that is nonzero in this period's new @ @ industries and a pointer to the parent industry for any @ @ new industry. @ madefr_t = newstart .* madefrom ; @ Produce a dummy matrix with a 1 in rows with a new industry @ @ and columns corresponding to the parent industry. For example: @ @ madefr_t = { 0, 0, 2, 2, } @ @ means industries 3 and 4 were spun off from industry 2. @ @ design(madefr_t) is @ @ 0 0 @ @ 0 0 @ @ 0 1 @ @ 0 1 @ if sumc(madefr_t) /= 0 ; @ Produce a vector that is nonzero in this period's new @ @ industries and a pointer to the parent industry for any @ @ new industry. @ madefr_t = newstart .* madefrom ; @ Produce a dummy matrix with a 1 in rows with a new industry @ @ and columns corresponding to the parent industry. For example: @ @ madefr_t = { 0, 0, 2, 2 } @ @ means industries 3 and 4 were spun off from industry 2. @ @ design(madefr_t) is @ @ 0 0 @ @ 0 0 @ @ 0 1 @ @ 0 1 @ bigdummy = design(madefr_t) ; @ Tricky use of Gauss conformability rules (see p. 84) @ @ to add back the employment of spinoff industries. @ @ q1 contains the sum of employment in industries spun @ @ off from the column industry. @ q1 = sumc( Et .* bigdummy ) ; if (numsic-cols(bigdummy) > 0) ; @ pad if necessary @ q1 = q1|zeros((numsic-cols(bigdummy)),1) ; else ; if (numsic-cols(bigdummy) < 0) ; print "ERROR: bigdummy vector has more columns than dataset." ; end ; endif ; endif ; @ Add back employment of spinoff industries. @ Et = Et + q1 ; endif ; @ Now get job creation/destruction for adjusted active industries. @ deltaEt = Et - E[.,t-1] ; jc[t] = sumc(selif(deltaEt, (deltaEt .> 0 .and active))) ; if scalmiss(jc[t]) ; @ no industries increased employment @ jc[t] = 0 ; @ job creation should be 0 @ endif ; jd[t] = sumc(selif(-deltaEt, (deltaEt .< 0 .and active))) ; if scalmiss(jd[t]) ; @ no industries decreased employment @ jd[t] = 0 ; @ job destruction should be 0 @ endif ; active = active + newstart ; t = t + 1 ; endo ; jc = jc' ; jd = jd' ; @ First element is meaninless zero left over from initialization. @ @ Change to missing. @ m = { . } ; jc[1] = m ; jd[1] = m ; save jc ; save jd ; save totalE ; datainfo = { 1972, 1, 12 } ; datainfo[1] = startdat ; datainfo = datainfo|addmiss(rows(jc)-3) ; asciiout(" jc jd totale datainfo ", "jcjd.asc") ; qproout(" jc jd totale datainfo ", "jcjd.prn") ; __maxvec = oldmaxv ; ***************************************************************** To produce figures 2 through 7 run the following seasonal adjustment program on the output data sets from the preceding sectoral programs. This program was written for SAS v.6.07. FILENAME IN 'H1HLB00.SECTORS.CNTL'; DATA A; INFILE IN (NSAGOODS) FIRSTOBS=5; *goods producing creation, destruction, total employment; INPUT JCG JDG TOTG DATAINFO; INFILE IN (NSAMANU) FIRSTOBS=5; *manufacturing; INPUT JCM JDM TOTM DATAINFO; INFILE IN (NSATRADE) FIRSTOBS=5; *trade; INPUT JCT JDT TOTT DATAINFO; INFILE IN (NSASERNT) FIRSTOBS=5; *service producing without trade; INPUT JCSERNT JDSERNT TOTSERNT DATAINFO; INFILE IN (NSASERWT) FIRSTOBS=5; *service producing with trade; INPUT JCSERWT JDSERWT TOTSERWT DATAINFO; INFILE IN (NSA721) FIRSTOBS=5; *all industries; INPUT JCTOT JDTOT TOTTOT DATAINFO; DATA DATES; DO YEAR=1972 TO 1994; DO MONTH=1 TO 12; SASDATE=MDY(MONTH,1,YEAR); OUTPUT; END; END; DATA B; MERGE DATES(WHERE=('01JAN1972'D<=SASDATE<'01MAY1994'D)) A ; *additive adjustment for creation and destruction; PROC X11 DATA=B; VAR JCG JDG JCM JDM JCT JDT JCSERNT JDSERNT JCSERWT JDSERWT JCTOT JDTOT; ID SASDATE; MONTHLY ADDITIVE START='JAN72' END='APR94' PRINTOUT=NONE; TABLES D11; OUTPUT OUT=SEASON1 D11= JCGSA JDGSA JCMSA JDMSA JCTSA JDTSA JCSRNTSA JDSRNTSA JCSRWTSA JDSRWTSA JCTOTSA JDTOTSA; *multiplicative adjusment for total employment; PROC X11 DATA=B; VAR TOTG TOTM TOTT TOTSERNT TOTSERWT TOTTOT; ID SASDATE; MONTHLY START='JAN72' END='APR94' PRINTOUT=NONE; TABLES D11; OUTPUT OUT=SEASON2 D11= TGSA TMSA TTSA TSERNTSA TSERWTSA TOTTOTSA; DATA C; MERGE SEASON1 SEASON2; *output seasonally adjusted data to a PDS; FILE IN(SAGOODS); PUT @1 SASDATE MMDDYY. @10 JCGSA 5.2 @17 JDGSA 5.2 @24 TGSA 7.2; DATA _null_; SET C; FILE IN(SAMANU); PUT @1 SASDATE MMDDYY. @10 JCMSA 5.2 @17 JDMSA 5.2 @24 TMSA 7.2; DATA _null_; SET C; FILE IN(SATRADE); PUT @1 SASDATE MMDDYY. @10 JCTSA 5.2 @17 JDTSA 5.2 @24 TTSA 7.2; DATA _null_; SET C; FILE IN(SASERNT); PUT @1 SASDATE MMDDYY. @10 JCSRNTSA 5.2 @17 JDSRNTSA 5.2 @24 TSERNTSA 7.2; DATA _null_; SET C; FILE IN(SASERWT); PUT @1 SASDATE MMDDYY. @10 JCSRWTSA 5.2 @17 JDSRWTSA 5.2 @24 TSERWTSA 7.2; DATA _null_; SET C; FILE IN(SA721); PUT @1 SASDATE MMDDYY. @10 JCTOTSA 5.2 @17 JDTOTSA 5.2 @24 TOTTOTSA 7.2; *print out of the seasonally adjusted and not seasonally adjusted; PROC PRINT; ID SASDATE; TITLE 'SEASONALLY ADJUSTED'; PROC PRINT DATA=B; TITLE ' NOT SEASONALLY ADJUSTED';