24.0 PGMCALL Command The PGMCALL command will allow a branch to be made to: SAS, Speakeasy, SPSS, TSP, ESP, BRAP, SCA, LIMDEP, MATLAB, MINITAB, X12, SHAZAM, STATA, R or GAUSS. The program can be optionally run and the results placed in the B34S *.out file. Form of PGMCALL command. B34SEXEC PGMCALL parameters$ SAS $ Speakeasy options parameters$ SPSS $ TSP $ R $ SCA parameters$ LIMDEP options parameters$ RATS options parameters$ MINITAB options parameters$ MATLAB options parameters$ GAUSS options parameters$ X12$ SHAZAM options parameters$ STATA$ PGMCARDS$ control cards for program B34SRETURN$ B34SEEND$ Parameters on PGMCALL sentence. IBEGIN = n1 Sets first B34S observation to pass. Default =1. IEND = n2 Sets last B34S observation to pass. Default = NOOB. IDATA =n3 Sets logical unit where data built. Default=28. ICNTRL= n4 Sets logical unit where control cards are built. Default=29. INLIST=(Var1,Var2) Specifies series to pass. If INLIST is not specified, then all active B34S variables are passed to program called. SAS sentence. The SAS sentence has one parameter that is only used on PC's. FILENAME = k Sets the file name for the SAS data. A sample PC job is given next to load data into PC The keyword k should be given inside "' '" such as FILENAME="'TEST.DAT'". If IDATA = ICNTRL, the SAS command and DATA file will be combined. /$ TEST PROBLEM IN TOBIT TAKEN FROM SAS STAT PAGE 1024 /$ ESTIMATES SAME AS SAS 6.07. /$ SE'S DIFFER SINCE SAS USES LARGE SAMPLE PROCEDURE /$ B34S uses inverse of -1 * second derivatives matrix B34SEXEC DATA NOOB=20 NOHEAD HEADING('TOBIT DATA FROM SAS')$ INPUT DURABLE AGE LQTY$ LABEL DURABLE='DURABLE GOODS PURCHASE '$ LABEL AGE ='AGE IN YEARS '$ LABEL LQTY ='LIQUITY RATIO TIMES 1000'$ DATACARDS$ 0.0 57.7 236. 0.7 50.9 283. 0.0 48.5 207. 0.0 41.7 220. 0.0 47.7 238. 0.0 59.8 216. 0.0 44.3 284. 3.7 45.1 221. 0.0 51.7 275. 3.0 50.0 269. 10.4 46.8 207. 0.0 58.0 249. 0.0 58.9 246. 0.0 40.0 277. 1.5 34.1 231. 0.0 39.9 219. 0.0 33.4 240. 3.5 48.1 266. 6.1 46.1 214. 0.0 53.1 251. B34SRETURN$ B34SEEND$ B34SEXEC LIST$ B34SEEND$ B34SEXEC OPTIONS OUTPUT=VERBOSE$ B34SEEND$ B34SEXEC TOBIT$ MODEL DURABLE=AGE LQTY$ B34SEEND$ B34SEXEC OPTIONS OPEN('SASTEST.DAT') UNIT(28) DISP=UNKNOWN$ B34SRUN$ B34SEXEC OPTIONS OPEN('SASTEST.SAS') UNIT(29) DISP=UNKNOWN$ B34SRUN$ B34SEXEC OPTIONS UNIT(28) REWIND$ B34SEEND$ B34SEXEC OPTIONS UNIT(29) REWIND$ B34SEEND$ B34SEXEC PGMCALL $ SAS FILENAME="'C:SASTEST.DAT'"$ PGMCARDS$ PROC REG DATA=B34SDATA; MODEL DURABLE= AGE LQTY; B34SRETURN$ B34SEEND$ By default SAS uses the file name B34SDT and the SAS dataset name B34SDATA. The input convention "' '" allows the file name to be save within ' '. The next job runs the same procedure on MVS where the FILENAME commaand is not needed. /*JOBPARM R=4096,T=1 // EXEC B34S //GO.FT28F001 DD DSN=&&DATA,UNIT=SCRATCH,DISP=(NEW,PASS), // DCB=(RECFM=FB,BLKSIZE=3200,LRECL=80),SPACE=(CYL,(1,1)) //GO.FT29F001 DD DSN=&&CNTL,UNIT=SCRATCH,DISP=(NEW,PASS), // DCB=(RECFM=FB,BLKSIZE=3200,LRECL=80),SPACE=(CYL,(1,1)) //GO.SYSIN DD * B34S cards here B34SEXEC PGMCALL$ SAS$ PGMCARDS$ PROC MEANS; PROC PRINT; B34SRETURN$ B34SEEND$ // EXEC SAS //B34SDT DD DSN=&&DATA,DISP=(OLD,DELETE) //SYSIN DD DSN=&&CNTL,DISP=(OLD,DELETE) /* On it is possible to execute SAS under B34S and obtain the output and log files from SAS in the B34S out and log files. The next job illustrates this: /$ Loads B34S data in sas command file TESTSAS.SAS /$ User can optionally add SAS commands after PGMCARDS$ b34sexec options include('c:\b34slm\gas.b34')$ b34seend$ B34SEXEC OPTIONS OPEN('TESTSAS.SAS') UNIT(29) DISP=UNKNOWN$ B34SRUN$ B34SEXEC OPTIONS CLEAN(29) $ B34Srun$ B34SEXEC PGMCALL IDATA=29 ICNTRL=29$ SAS $ PGMCARDS$ options noxwait; proc print; proc reg; model gasout=gasin; run; B34SRETURN$ B34SRUN $ B34SEXEC OPTIONS CLOSE(29)$ B34SRUN$ /$ Pause added to wait until SAS stops running under windows 95 B34SEXEC OPTIONS SYSTEM('SAS TESTSAS' 'pause')$ b34srun $ B34SEXEC OPTIONS NPAGEOUT NOHEADER WRITEOUT(' ','Output from SAS',' ',' ') WRITELOG(' ','Output from SAS',' ',' ') COPYFOUT('TESTSAS.LST') COPYFLOG('TESTSAS.LOG')$ SYSTEM('ERASE TESTSAS.SAS','ERASE TESTSAS.LST','ERASE TESTSAS.LOG')$ B34SRUN$ B34SEXEC OPTIONS HEADER$ B34SRUN$ Here the pause statement has been added so that b34s will wait until SAS completes running before trying to get the SAS output and input files. This job uses the shell program runsas2. *********************************** Speakeasy sentence. Speakeasy is a powerful program developed by Stan Cohen and others which runs on IBM MVS, CMS, PC, RS/6000, SUN and VAX. Options on the Speakeasy sentence. IIOPT - If present will build a Speakeasy program names GETSB34S to input data. NOMEAN - If present will suppress means in Speakeasy. Parameters on Speakeasy sentence. ISIZE = n2 If present will set the size in Speakeasy. IUNIT = n3 Sets Speakeasy INPUT UNIT. Default = 15. Note that Speakeasy only accepts units LE 20. IUNIT controls where DATA in inputted when in Speakeasy. CLINES=(' ', ' ') will optionally pass commands to speakeasy that are placed at the top of the job. The following program will load a variable YY in Speakeasy and get the sum of squares. This job runs entirely in the BATCH mode and shows an MVS setup. /*JOBPARM R=4096,T=1 // EXEC B34S //GO.FT28F001 DD DSN=&&DATA,UNIT=SCRATCH,DISP=(NEW,PASS), // DCB=(RECFM=FB,BLKSIZE=3200,LRECL=80),SPACE=(CYL,(1,1)) //GO.FT29F001 DD DSN=&&CNTL,UNIT=SCRATCH,DISP=(NEW,PASS), // DCB=(RECFM=FB,BLKSIZE=3200,LRECL=80),SPACE=(CYL,(1,1)) //GO.SYSIN DD * B34S cards here B34SEXEC PGMCALL$ Speakeasy$ PGMCARDS$ X=SUMSQ(YY) X QUIT B34SRETURN$ B34SEEND$ // EXEC Speakeasy //FT15F001 DD DSN=&&DATA,DISP=(OLD,DELETE) //SYSIN DD DSN=&&CNTL,DISP=(OLD,DELETE) /* The following job is illustrates what might be used on a PC. /$$ SHOWS HOW TO GENERATE RANDOM NUMBERS /$$ ALSO SHOWS Speakeasy LINK B34SEXEC OPTIONS OPEN('TSPEAK.DAT') DISP=UNKNOWN UNIT=28$ B34SEEND$ B34SEXEC OPTIONS OPEN('TSPEAK.USE') DISP=UNKNOWN UNIT=29$ B34SEEND$ B34SEXEC DATA NOOB=25 NOHEAD$ BUILD RAN1 RAN2 COUNT$ GEN RAN1=RN()$ GEN RAN2=RN()$ GEN COUNT=KOUNT()$ B34SEEND$ B34SEXEC LIST$ B34SEEND$ B34SEXEC PGMCALL$ Speakeasy IUNIT=18 CLINES=('ASSIGN 18 "TSPEAK.DAT" ')$ PGMCARDS$ RAN3=RAN1*RAN2 RAN1 RAN2 RAN3 B34SRETURN$ B34SEEND$ The above job runs Speakeasy outside B34S. After B34S terminates, the user enters Speakeasy and gives the command USE TSPEAK which will 1. load the data and 2. execute the commands between PGMCARDS$ and B34SRETURN$. If sufficient memory is available, Speakeasy can be run under B34S. An example of the job TESTSKP.B34 is given next /$ TEST PROBLEM FOR TOBIT TAKEN FROM SAS STAT PAGE 1024 /$ USER RUNS TOBIT, THEN SETS UP A CALL TO SPEAKEZ /$ USER IS PLACED IN Speakeasy /$ FIRST COMMAND: USE TESTSPK /$ LOADS GETSB34S /$ THIS WILL PLACE USER IN EDITOR /$ TOBIT ESTIMATES SAME AS SAS 6.07. /$ SE'S DIFFER SINCE SAS USES LARGE SAMPLE PROCEDURE B34SEXEC DATA NOOB=20 NOHEAD HEADING('TOBIT DATA FROM SAS')$ INPUT DURABLE AGE LQTY$ LABEL DURABLE='DURABLE GOODS PURCHASE '$ LABEL AGE ='AGE IN YEARS '$ LABEL LQTY ='LIQUITY RATIO TIMES 1000'$ DATACARDS$ 0.0 57.7 236. 0.7 50.9 283. 0.0 48.5 207. 0.0 41.7 220. 0.0 47.7 238. 0.0 59.8 216. 0.0 44.3 284. 3.7 45.1 221. 0.0 51.7 275. 3.0 50.0 269. 10.4 46.8 207. 0.0 58.0 249. 0.0 58.9 246. 0.0 40.0 277. 1.5 34.1 231. 0.0 39.9 219. 0.0 33.4 240. 3.5 48.1 266. 6.1 46.1 214. 0.0 53.1 251. B34SRETURN$ B34SRUN$ B34SEXEC LIST$ B34SRUN$ B34SEXEC OPTIONS OUTPUT=VERBOSE$ B34SRUN$ B34SEXEC TOBIT$ MODEL DURABLE=AGE LQTY$ B34SRUN$ B34SEXEC OPTIONS OPEN('TESTSPK.DAT') UNIT(28) DISP=UNKNOWN$ B34SRUN$ B34SEXEC OPTIONS OPEN('TESTSPK.USE') UNIT(29) DISP=UNKNOWN$ B34SRUN$ /$ be sure that nothing remains in the file B34SEXEC OPTIONS CLEAN(28)$ B34SRUN$ B34SEXEC OPTIONS CLEAN(29)$ B34SRUN$ B34SEXEC PGMCALL $ Speakeasy ISIZE=200 IIOPT CLINES('ASSIGN 15 "TESTSPK.DAT" ') $ PGMCARDS$ PAUSE OLSQ DURABLE C AGE LQTY PAUSE GRAPHICS VGA T=INTEGERS(NOROWS(DURABLE)) GRAPH(AGE,LQTY,DURABLE:T) COLOR RED:CURVES ADDGRAPH AGE:T COLOR BLUE:CURVES ADDGRAPH LQTY:T B34SRETURN$ B34SRUN$ /$ CLOSE FILES B34SEXEC OPTIONS CLOSE(28)$ B34SRUN$ B34SEXEC OPTIONS CLOSE(29)$ B34SRUN$ B34SEXEC OPTIONS SYSTEM('SPEAKEZ')$ B34SRUN$ Notes: 1. If the commands CLOSE(28) and CLOSE(29) are not given, B34s will not properly release the files on unit 28 and 29 to Speakeasy. 2. IIOPT has been given to make a Speakeasy program GETSB34S since the Speakeasy statement PAUSE is only useable in a Speakeasy program. 3. Once in Speakeasy, the user gives the command USE TESTSPK which will load the program GETSB34S and leave the user in the editor. The Speakeasy user then exits the editor and runs GETSB34S or any other Speakeasy command. 4. If the B34S user wants to use the files 28 and 29 again, to call PGMCALL to load more data for Speakeasy, the OPTIONS command OPEN( ) must be used to reopen files 28 & 29. 5. The B34SRUN$ command has been used to force execution of every step.. *********************************** SPSS sentence. The SPSS sentence has no options or parameters. At this time data is passed in one file. Old SPSS (Pre 1980) is no longer supported. Note: Spss commands MUST start in col 1!! To run on unix spss -m testspss.pgm > spss.out b34sexec options ginclude('gas.b34'); b34srun; b34sexec options open('testspss.pgm') unit(29) disp=unknown$ b34srun$ b34sexec options clean(29) $ b34seend$ b34sexec pgmcall idata=29 icntrl=29$ spss $ pgmcards$ regression variables= gasout gasin / dependent gasout/ method=enter b34sreturn$ b34srun $ b34sexec options close(29)$ b34srun$ TSP (ESP) sentence. The TSP sentence will call TSP and will use the ; in place of the $ as a delimiter. If the $ delimiter is desired, use EPS in place of TSP. The following job will branch from B34S to TSP. Note that only the ICNTRL unit is used. /*JOBPARM R=2048,T=1 // EXEC B34S //GO.FT29F001 DD DSN=&&CNTL,UNIT=SCRATCH,DISP=(NEW,PASS), // DCB=(RECFM=FB,BLKSIZE=3200,LRECL=80),SPACE=(CYL,(1,1)) //GO.SYSIN DD * B34S cards here B34SEXEC PGMCALL$ TSP$ PGMCARDS$ NAME,STOKES 'TEST RUN OF NEW TSP'; LOAD ; SMPL 1,50 ; OLSQ CONS, C, GNP ; STOP; END; B34SRETURN$ B34SEEND$ /* // EXEC TSP //SYSIN DD DSN=&&CNTL,DISP=(OLD,DELETE) /* *********************************** SCA sentence. SCA is powerful time series program. If IDATA is set equal to ICNTL, B34S will create a SCA data input file in line with the SCA control cards which are read next. If IDATA is not equal to ICNTRL, B34S will create a SCA procedure file with the default name B34SDATA. If the user desires to override this name, use the SCAFNAME parameter as is done below. Parameters on SCA sentence. SCAFNAME=key Optionally sets name of SCA procedure file. Running the 32 bit PC version of SCA under B34S The below listed example,from c:\b34slm\example.mac, shows how to run the windows 32 bit version of SCA that makes use of the command line arguments. Note that the procedure is myrun. The line /$#==MYRUN at run time strips out the /$# leaving the procedure name MYRUN. This job illustrates making a SCA FSAVE file and bringing this file back into b34s to be read by the b34s matrix command. /$ /$$ SCA is run under B34S and results moved back to b34s. /$$ /$$ The test job SCA1 illustrates only runs SCA /$$ /$$ The b34s/sca interface and MATRIX capability is shown. /$$ /$$ The 32 bit sca is called under b34s. /$$ /$$ Note This option requires that the user license sca(r) /$$ /$ b34sexec options include('c:\b34slm\gas.b34'); b34srun; b34sexec options open('sca.dat') disp=unknown unit(28)$ b34srun$ b34sexec options open('sca.cmd') disp=unknown unit(29)$ b34srun$ b34sexec options clean(28)$ b34srun$ b34sexec options clean(29)$ b34srun$ b34sexec options system('erase c:\junk\scadata.fsv'); b34srun; b34sexec pgmcall$ sca scafname=mydata$ pgmcards$ /$#==myrun assign file 18. attrib access(read). external 'sca.dat'. call procedure is mydata. file is 18. iarima gasout. estim utsmodel. method is exact. hold residuals(testres). print testres. fsave testres. file is 'scadata.fsv'. dataset is test. stop. return /$#== b34sreturn$ b34srun$ b34sexec options close(28)$ b34srun$ b34sexec options close(29)$ b34srun$ b34sexec options system('scaw32 10000 /f:sca.cmd /p:myrun /o:sca.out')$ b34srun$ b34sexec options npageout writeout('output from sca',' ',' ') copyfout('sca.out') system('erase sca.cmd','erase sca.out','erase sca.dat') $ /$ /$ Data from SCA pulled back into MATRIX facility for further work /$ b34sexec matrix; call getsca('scadata.fsv', :member test); call print(testres); testres=goodrow(testres); call graph(testres); b34srun$ ****************************************************************** The below listed example is setup to run on MVS. In this mode of operation, the input and output files are set by the JCL. /*JOBPARM R=2048,T=1 // EXEC B34S //GO.FT28F001 DD DSN=&&DATA,UNIT=SCRATCH,DISP=(NEW,PASS), // DCB=(RECFM=FB,BLKSIZE=3200,LRECL=80),SPACE=(CYL,(1,1)) //GO.FT29F001 DD DSN=&&CNTL,UNIT=SCRATCH,DISP=(NEW,PASS), // DCB=(RECFM=FB,BLKSIZE=3200,LRECL=80),SPACE=(CYL,(1,1)) //GO.SYSIN DD * B34S cards here B34SEXEC PGMCALL$ SCA SCAFNAME=MYDATA$ PGMCARDS$ CALL PROCEDURE IS MYDATA. FILE IS 28. (more SCA commands here) B34SRETURN$ B34SEEND$ // EXEC SCA //FT28F001 DD DSN=&&DATA,DISP=(OLD,DELETE) //SYSIN DD DSN=&&CNTL,DISP=(OLD,DELETE) /* The below example, supplied with the B34S PC version, shows how to run SCA on a PC. Due to design limitations of SCA, the older SCA could not be called under B34S. However the below listed file will make a file that could be run. SCAW32 does not have this limitation and if available shoule be used. SCA.DAT containing the B34S data SCA.CMD containing all statements PARMCARDS$ and B34SRETURN$ /$$ THIS INTERFACE MAKES A FILE SCATEST.SSS TO TEST B34S/SCA INTERFACE /$$ SINCE THE CURRENT RELEASE OF SCA CANNOT BE CALLED UNDER B34S /$$ AFTER THIS JOB RUNS, USER MUST GIVE COMMAND /$$ /$$ SCA /$$ CALL PROCEDURE IS MYTEST. FILE IS 'SCA.CMD' B34SEXEC OPTIONS OPEN('GAS.B34') INCLUDE(33)$ B34SRUN$ B34SEXEC OPTIONS OPEN('SCA.DAT') DISP=UNKNOWN UNIT(28)$ B34SRUN$ B34SEXEC OPTIONS OPEN('SCA.CMD') DISP=UNKNOWN UNIT(29)$ B34SRUN$ B34SEXEC PGMCALL$ SCA SCAFNAME=MYDATA$ PGMCARDS$ ==MYTEST PROFILE REVIEW. ASSIGN FILE 18. ATTRIB ACCESS(READ). EXTERNAL 'SCA.DAT'. CALL PROCEDURE IS MYDATA. FILE IS 18. REGRESS GASOUT,GASIN. RETURN END // B34SRETURN$ B34SRUN$ To run this stream of commands interactively, the user types SCA CALL PROCEDURE IS MYTEST. FILE IS 'SCA.CMD'. Discussion: The use of the SCA statement PROFILE REVIEW. makes a file SCAOUTP.OTP containing the SCA output which copies what was on the screen. The use of the assign statement prevents SCA from having confusion on which SCA PROCEDURE unit is active. While this example has only one SCA command (REGRESS) multiple commands can be supplied. The above setup runs SCA interactively. The file RUNSCA.BAT, which is supplied with B34S allows SCA to be run in a batch mode. This file is given below: REM SHOWS USING SCA WITH A COMMAND FILE *.CMD REM OUTPUT TO *.OUT D:\SCA\SCA < %1.CMD COPY SCAOUTP.OTP %1.OUT ERASE *.OTP If the B34S job TESTSCA.B34 is modified so that a SCA procedure is not created /$$ THIS INTERFACE MAKES A FILE SCATEST.SSS TO TEST B34S/SCA INTERFACE /$$ SINCE THE CURRENT RELEASE OF SCA CANNOT BE CALLED UNDER B34S /$$ AFTER THIS JOB RUNS, USER MUST GIVE COMMAND /$$ /$$ RUNSCA SCA /$$ B34SEXEC OPTIONS OPEN('GAS.B34') INCLUDE(33)$ B34SRUN$ B34SEXEC OPTIONS OPEN('SCA.DAT') DISP=UNKNOWN UNIT(28)$ B34SRUN$ B34SEXEC OPTIONS OPEN('SCA.CMD') DISP=UNKNOWN UNIT(29)$ B34SRUN$ B34SEXEC PGMCALL$ SCA SCAFNAME=MYDATA$ PGMCARDS$ PROFILE REVIEW. ASSIGN FILE 18. ATTRIB ACCESS(READ). EXTERNAL 'SCA.DAT'. CALL PROCEDURE IS MYDATA. FILE IS 18. REGRESS GASOUT,GASIN. ACF GASOUT ACF GASIN STOP B34SRETURN$ B34SRUN$ The command RUNSCA SCA will produce an output file SCA.OUT containing the SCA output. This way of operating allows SCA to be used in a batch mode without the user having to type any commands. The file RUNSCA.BAT should be copied to the C:\dos directory so that it is in the path. Its use is similar to the RUNB34S.BAT file. *********************************** LIMDEP sentence LIMDEP is a powerful program that is particularly strong in the area of limited dependent variable problems and sample selection problems. A good reference is "LIMDEP Version 7" by William Greene. LIMDEP can be ordered rom Econometric Software, Inc, 43 Maple Avenue Bellport, NY 11713. Tel. 516-286-7049. B34S can branch to Limdep version 5 and version 7. Under the display manager, a dynamic link can be made and the output and log from LIMDEP pulled into the B34S output and log files. Missing Data in the B34S dataset should be dropped prior to the LIMDEP call. The best way is to code DROPMISS on the DATA step or use the line: b34sexec data set dropmiss; b34srun; If missing data is passed to LIMDEP on PC and Linux recode the data prior to its being passed and use the LIMDEP REJECT command. This is not recommended. If the key word missing is in the datset, the FORMAT statement automatically built by PGMCALL cannot be used. If this statement is not present LIMDEP will rewind the input file causing problems with the Lahey compiler. The best wauy to proceed is to build data outside LIMDEP if this is possible. LIMDEP sentence options. IBAT - Do not put in the LIMDEP BATCH$ command. On the first call the IBAT option must not be entered. On subsequent calls to LIMDEP in the same B34S job, the IBAT command must be supplied. If this is not done, LIMDEP will produce many error messages. For LIMDEP version 7, the IBAT command must be used. NECHO - Do not put in ECHO$ command. For LIMDEP version 7, the NECHO option must be used. IPROC - Make a PROCEDURE on unit ICNTRL. NOMEANS - Suppress means in LIMDEP. IREWF - Rewind INCTRL prior to building data and control file. LIMDEP sentence parameters. PCOMMENTS(' ',' ') Sets optional comments or LIMDEP commands that will be place first in the LIMDEP command file. This option is used for the PC LIMDEP setup. TITLE=(' Any title here (up to 72 characters) ') ITEMP = n1 If n1 = -1 TEMP file built for # of variables in data. If n1 = 0, no save file made. This is the default. If n1 GT 0, TEMP file build for ITEMP variables. See usage note below. Usage notes. If LIMDEP is called from under SAS with BY variable processing there will be problems since IBAT must not be used for the first LIMDEP call and must be used for calls after the first call. The solution is to call LIMDEP under SAS with three observations and IBAT not set. In the next BY variable call, IBAT is set. If there is only one LIMDEP call per B34S run, the user does not have to be concerned with the IBAT option. If your sample size exceeds LIMDEP internal storage, you will have to use the ITEMP save file option. It is highly recommended that you set ITEMP. Once ITEMP is set, 4 * ITEMP becomes the BLKSIZE for allocating unit 11. If there are 6 series and 60 observatsions, this is done in the space field. In this problem SPACE=(24,(60),RLSE). If an error is made, you will read the first variable correctly from the save file but not the second. It is strongly recommended that you run a regression both in LIMDEP and outside LIMDEP and check means to see if the data has been passed correctly. The ITEMP saving option LIMDEP is a design weakness of the program on MVS. A preferred alternative to having to set blocksize in the LIMDEP temportary file described above, is to use the CONTIG parameter on the SPACE command in the JCL. Use of this option is shown below. When LIMDEP runs, the following message is displayed: AFB151I VDIOS : XXX RECORDS OF LENGTH YYYY FORMATTED ON FILE FT11F001 This message appears harmless. Users should check means to be sure that the data has been passed correctly. If LIMDEP is called from under SAS, you must use PARMCARDS4; with ;;;; (in col 1-4) as the delimiter since LIMDEP uses the ; as a delimiter. Sample job 1. Poisson Job b34sexec options ginclude('greene.mac') member(a19_3); b34srun; b34sexec options open('limdep.in') unit(29) disp=unknown$ b34SRUN$ b34sexec options clean(29)$ b34srun$ b34sexec list; var actual typea,typec,typed,typee,y65_69,y70_74,y75_79,logmth,o75_79; b34srun; b34sexec data dropmiss set; b34srun; b34sexec reg; model actual=typea typec typed typee y65_69 y70_74 y75_79 o75_79 logmth; b34srun; b34sexec pgmcall$ limdep ibat necho title('Results from limdep') pcomments('open ; output = limdep.out $') $ /$ pgmcards$ poisson ; lhs = actual ;rhs=one,typea,typec,typed,typee,y65_69,y70_74,y75_79,o75_79,logmth ;marginal effects$ b34sreturn$ b34srun $ b34sexec options close(29)$ b34srun$ b34sexec options position(1); b34srun; b34sexec options position(6); b34srun; b34sexec options dodos('limdep limdep.in') dounix('limdep < limdep.in'); b34srun b34sexec options npageout writeout('Output from LIMDEP',' ',' ') copyfout('limdep.out') writelog('Output from LIMDEP log') copyflog('trace.lim') dounix('rm limdep.in ', 'rm limdep.out', 'rm trace.lim ') /$ dodos('erase limdep.in ', /$ 'erase limdep.out', /$ 'erase trace.lim ','cls') $ b34srun$ Sample 2 Job b34sexec options ginclude('b34sdata.mac') macro(res72)$ b34seend$ b34sexec options open('limdep.in') unit(29) disp=unknown$ b34SRUN$ b34sexec options clean(29)$ b34srun$ b34sexec pgmcall$ limdep ibat necho title('Results from limdep') pcomments('open ; output = limdep.out $') $ pgmcards$ crmo; lhs=lnq; rhs=one,lnl,lnk,lnrm1,time$ armax; lhs = lnq; rhs = one,lnl,lnk,lnrm1,time; model=2,0,1$ armax; lhs = lnq; rhs = one,lnl,lnk,lnrm2,time; model=2,0,1$ b34sreturn$ b34srun $ b34sexec options close(29)$ b34srun$ b34sexec options dodos('limdep limdep.in') dounix('limdep < limdep.in')$ b34srun$ b34sexec options npageout writeout('Output from LIMDEP',' ',' ') copyfout('limdep.out') writelog('Output from LIMDEP log') copyflog('trace.lim') dodos('erase limdep.in ', 'erase limdep.out', 'erase trace.lim ', 'cls') dounix('rm limdep.in ', 'rm limdep.out', 'rm trace.lim '); b34srun$ *********************************** RATS sentence. RATS is a powerful program that can perform time series analysis for procedures not available in B34S. The B34S/RATS interface allows RATS to be run under B34S. Data can be passed from B34S to RATS, which can be run under B34S on 386/387 and 486 machines with enough memory. Residuals and other transformed series in RATS can be read back into B34S. The RATS sentence only runs with the PC B34S as of this time. Information on RATS can be obtained in the manual Rats User's Guide Version 7.0 and Rats Reference Manual Version 7.0 which is avaliable from Etima 1800 Sherman Avenue, Suite 612 Evanston, IL 60201 (847)-864-8772 General information (847)-864-1910 Technical Support (847)-864-6221 Fax (800)-822-8038 Orders, Sales Inquiries RATS sentence options. NOMEAN - Turn off the automatic calculation of means in RATS for the variables passed. It is NOT recommended that this option be used since it is important to validate that the data has been passed correctly. NOTREND - Turn off the automatic RATS command SET TREND = T PASSASTS - Passes data as time series using the B34S internal date capability. For info on setting the internal B34S date, see SETYEAR SETMONTH SETFREQ commands on the OPTIONS paragraph OR the DATA paragraph. Note that the internal B34S date options require that the data not have missing holes. If the data in B34S currently has "holes" but the user wants to maintain the ability to merge the data back into B34S without alignment problems there are two options: - Pass the observation number as a variable - Pass the julian date as a variable. Note that there are two conventions concerning bases for the julian date. If SASDATEON is in effect in B34S, the B34S julian date is similar to SAS in that 1 Jan 1960 = 1. If SASDATEOFF is in effect, the classic julian date convention is in effect and the julian date is the number of days since 1 Jan 0001. RATS uses the SASDATEOFF convention. Note: RATS in version 4.10 has changed the form of the RATS portable file for time series. B34S has been modified to read the 4.10 portable time series file. This means that if RATS 4.02 is run the user must not use the PASSASTS option. Users are cautioned to carefully check reading of data in *.POR files to insure that the data has been passed correctly. RATS sentence parameters. DATAFILE(' ') Sets the data file name inside ' '. The default name is RATS.DAT The file mentioned MUST be allocated and cleaned with the B34SEXEC OPTIONS command. For examples, see below. PCOMMENTS(' ',' ') Sets optional comments or RATS commands that will be place first in the RATS command file. DATES(' ',' ') Sets custom date information. If this command is not present the RATS interface uses the RATS commands CALENDAR(IRREGULAR) ALLOCATE N where N is the number of data points, or the appropriate time series commands if the option PASSASTS is supplied. For detail on this option, see PASSASTS above. where N is the number of data points. The DATES sentence supplies the RATS CALENDAR and ALLOCATES commands. It is imperative that users take care with the specificaion of these parameters so that RATS does not unexpectedly get an end of file. Setup note: The program rats32s saves the output file with default mane *.lst. The Perferences Directories allows this to be changed to *.out to conform with the scripts. The minimun setting to pass all from B34S to RATS would be B34SEXEC OPTIONS OPEN('RATS.DAT') UNIT(28) DISP=UNKNOWN$ B34SRUN$ B34SEXEC OPTIONS OPEN('RATS.IN') UNIT(29) DISP=UNKNOWN$ B34SRUN$ B34SEXEC OPTIONS CLEAN(28)$ B34SRUN$ B34SEXEC OPTIONS CLEAN(29)$ B34SRUN$ B34SEXEC PGMCALL$ RATS $ PGMCARDS$ (RATS commands here) B34SRETURN$ B34SRUN$ B34SEXEC OPTIONS FLUSH(28)$ B34SRUN$ B34SEXEC OPTIONS FLUSH(29)$ B34SRUN$ B34SEXEC OPTIONS SYSTEM('RATS386 RATS.IN,RATS.OUT')$ B34SRUN$ A job showing a regression in RATS which is called under B34S where the RATS output is copied into the B34S.OUT file is given below. Note that a number of graphs are done and Box-Jenkins models are estimated. The PASSASTS option is used to set the date in RATS. Data are listed to facilitate checking of the functioning of the program. /$ TEST JOB FOR B34S/RATS INTERFACE /$ DATA FROM GREEN SHOWS PLOTS ON VGA B34SEXEC DATA NOOB=47 NOHEAD SETYEAR(1940) SETFREQ(1)$ INPUT YEAR DPRICE$ BUILD YEAR MONTH DAY$ GEN YEAR=CYEAR()$ GEN MONTH=CMONTH()$ GEN DAY=CDAY()$ DATACARDS$ 1940 1.0 1941 9.7 1942 9.3 1943 3.2 1944 2.1 1945 2.3 1946 18.2 1947 9.0 1948 2.7 1949 -1.8 1950 5.8 1951 5.9 1952 0.9 1953 0.6 1954 -0.5 1955 0.4 1956 2.9 1957 3.0 1958 1.8 1959 1.5 1960 1.5 1961 0.7 1962 1.2 1963 1.6 1964 1.2 1965 1.9 1966 3.4 1967 3.0 1968 4.7 1969 6.1 1970 5.5 1971 3.4 1972 3.4 1973 8.8 1974 12.2 1975 7.0 1976 4.8 1977 6.8 1978 9.0 1979 13.3 1980 12.4 1981 8.9 1982 3.9 1983 3.8 1984 4.0 1985 3.8 1986 1.1 B34SRETURN$ B34SRUN$ B34SEXEC LIST$ B34SRUN$ B34SEXEC OPTIONS OPEN('RATS.DAT') UNIT(28) DISP=UNKNOWN$ B34SRUN$ B34SEXEC OPTIONS OPEN('RATS.IN') UNIT(29) DISP=UNKNOWN$ B34SRUN$ B34SEXEC OPTIONS CLEAN(28)$ B34SRUN$ B34SEXEC OPTIONS CLEAN(29)$ B34SRUN$ B34SEXEC PGMCALL$ RATS PASSASTS PCOMMENTS('* ', '* TEST PROBLEM SHOWING DATA FROM GREEN PAGE 418', '* ') $ PGMCARDS$ LINREG DPRICE / RESIDS # CONSTANT DPRICE{1} GRAPH(HEADER='RESIDUALS OF AR(1) MODEL') 1 # RESIDS GRAPH(HEADER='BASIC DATA OF AR(1) MODEL') 1 # DPRICE GRAPH(HEADER='RESIDUALS AND DATA OF AR(1) MODEL') 2 # DPRICE # RESIDS PRINT BOXJENK(DIFF=1,AR=3) DPRICE / RESAR3 GRAPH(HEADER='RESIDUALS AND DATA OF AR(3) MODEL') 2 # DPRICE # RESAR3 AR1(METHOD=MAXL) DPRICE / GLSRES # CONSTANT DPRICE{1} GRAPH(HEADER='RESIDUALS AND DATA OF MAXIMUM LIKELIHOOD GLS(1) MODEL') 2 # DPRICE # GLSRES B34SRETURN$ B34SRUN $ B34SEXEC OPTIONS CLOSE(28)$ B34SRUN$ B34SEXEC OPTIONS CLOSE(29)$ B34SRUN$ B34SEXEC OPTIONS SYSTEM('RATS386 RATS.IN,RATS.OUT')$ B34SRUN$ B34SEXEC OPTIONS NPAGEOUT WRITEOUT('OUTPUT FROM RATS',' ',' ') COPYFOUT('RATS.OUT') SYSTEM('ERASE RATS.IN','ERASE RATS.OUT','ERASE RATS.DAT') $ B34SRUN$ Note: In the above the job the B34S OPTIONS command CLOSE(28) and CLOSE(29) must be given (in place of FLUSH( ) or REWIND( ) because in the last B34SEXEC OPTIONS command the output of RATS is copied to the B34S output file and the files RATS.IN, RATS.OUT and RATS.DAT are erased. Unless unit 28, and 29 are closed inside B34S, when B34S terminates it will not "know" that a system command has been given to erase a file that B34S "thought" was still open. The next example estimates ARCH, ARCH-M and GARCH for the same series. B34SEXEC OPTIONS OPEN('RATS.DAT') UNIT(28) DISP=UNKNOWN$ B34SRUN$ B34SEXEC OPTIONS OPEN('RATS.IN') UNIT(29) DISP=UNKNOWN$ B34SRUN$ B34SEXEC OPTIONS CLEAN(28)$ B34SRUN$ B34SEXEC OPTIONS CLEAN(29)$ B34SRUN$ B34SEXEC PGMCALL$ RATS _PASSASTS PCOMMENTS('* ', '* TEST PROBLEM SHOWING ARCH FROM GREEN PAGE 418', '* ') $ PGMCARDS$ LINREG DPRICE / RESIDS # CONSTANT DPRICE{1} * * ARCH * * SEE PAGE 5-31 RATS MANUAL * SET V = 1.0 NONLIN B0 B1 A0 A1 FRML REGRESID = DPRICE-B0-B1*DPRICE{1} FRML ARCHVAR = A0+A1*REGRESID(T-1)**2 FRML ARCHLOGL = (V=ARCHVAR(T)), -5*(LOG(V)+REGRESID(T)**2/V) LINREG DPRICE # CONSTANT DPRICE{1} COMPUTE B0=%BETA(1),B1=%BETA(2),B2=%BETA(3) COMPUTE A0=%SEESQ, A1=.05 MAXIMIZE(METHOD=BHHH,RECURSIVE,ITERATIONS=10000) ARCHLOGL 2 * * * ARCH-M * SET U = 0.0 SET VV = 1.0 NONLIN B0 B1 B2 A0 A1 FRML ARCHVAR = A0+A1*U{1}**2 FRML REGRESID = DPRICE-B0-B1*DPRICE{1}-B2*SQRT(ARCHVAR(T)) FRML ARCHLOGL = (VV(T)=ARCHVAR(T)),(U(T)=REGRESID(T)), $ -5*(LOG(VV)+U**2/VV) LINREG DPRICE # CONSTANT DPRICE{1} COMPUTE B0=%BETA(1), B1=%BETA(2), B2=0, A0=%SEESQ,A1=.05 MAXIMIZE(METHOD=BHHH,RECURSIVE,ITERATIONS=10000) ARCHLOGL 2 * * * GARCH * SET U1 = 0.0 SET V1 = 0.0 NONLIN B0 B1 B2 A0 A1 A2 FRML REGRESID = DPRICE-B0-B1*DPRICE{1} FRML GARCHVAR = A0-A1*U{1}**2+ $ A2 * %IF(V1{1}>1.E+100,%NA,V1{1}) FRML GARCHLOGL = V1(T)=GARCHVAR(T),U1(T)=REGRESID(T),$ -.5*(LOG(V1)+U1**2/V1) LINREG DPRICE # CONSTANT DPRICE{1} COMPUTE B0=%BETA(1), B1=%BETA(2), B2=0, A0=%SEESQ,A1=.05,A2=.01 MAXIMIZE(METHOD=BHHH,RECURSIVE,ITERATIONS=10000) GARCHLOGL 2 * * B34SRETURN$ B34SRUN $ B34SEXEC OPTIONS CLOSE(28)$ B34SRUN$ B34SEXEC OPTIONS CLOSE(29)$ B34SRUN$ B34SEXEC OPTIONS SYSTEM('RATS386 RATS.IN,RATS.OUT')$ B34SRUN$ B34SEXEC OPTIONS NPAGEOUT WRITEOUT('OUTPUT FROM RATS',' ',' ') COPYFOUT('RATS.OUT') SYSTEM('ERASE RATS.IN','ERASE RATS.OUT','ERASE RATS.DAT') $ B34SRUN$ *********************************** MATLAB sentence. The MATLAB sentence allows B34S to produce a MATLAB M file which can be called from MATLAB. Data and commands can be passed. Warning: Since MATLAB is case sensitive, users must use caution to be sure and give variable references in lower case unless UPPERCASE option is used. Under the B34S MATRIX command the command MAKEMATLAB and GETMATLAB produce files that can be read with the MATLAB M file commands GETB34S and MAKEB34S. These M files are in the c:\b34slm\mfiles directory. In contrast to the MAKEMATLAB command under the MATRIX command that passes data as a MATLAB matrix, the MATLAB sentence: - passes b34s variables as vectors. - allows user to add MATLAB commands to the end of the file to process these vectors in MATLAB MATLAB sentence options. NOMEANS Turns off listing of means in MATLAB. This option is recommended. LOWERCASE Makes all names lower case. This is the default. UPPERCASE Passes all names as upper case. MATLAB sentence parameters. OUTFILE(k) Sets the outfile name. Default = _b34sdata.dat. Sample job showing passing of data from B34S to MATLAB. b34sexec options open('_b34sdat.dat') unit=28 disp=unknown$ b34seend$ b34sexec options clean(28) $ b34seend$ b34sexec options open('b34sdata.m') unit=29 disp=unknown$ b34seend$ b34sexec options clean(29) $ b34seend$ b34sexec options include('c:\b34slm\gas.b34')$ b34seend$ b34sexec pgmcall$ matlab$ pgmcards$ plot(gasin) b34sreturn$ b34seend$ Note the use of the lower case variable reference in the plot command. This job is distributed with the B34S in B34STEST.MAC as TMATLAB.B34 Assuming the above job was run from c:\working. After leaving B34S, the following MATLAB commands will run the command file built. cd c:\working b34sdata Note: The b34sdata command calls the MALAB M file B34SDATA.M *********************************** MINITAB sentence. The MINITAB sentence allows B34S to produce a MINITAB execution file. Due to the design of MINITAB student edition, MINITAB cannot be called in under B34S. MINITAB sentence options. BATCH Makes the file a batch job by puting BATCH as the first statement and STOP as the last statement. Assuming the file was named MINITAB.IN, the file could be executed as MINITAB -i MINITAB.IN MINITAB sentence parameters. OUTFILE Sets the outfile name. Default = MINITAB.LST Sample job showing regression and ARIMA in MINITAB. b34sexec options open('minitab.in') unit=29 disp=unknown$ b34seend$ b34sexec options clean(29) $ b34seend$ b34sexec options include('c:\b34slm\gas.b34')$ b34seend$ b34sexec pgmcall$ minitab$ pgmcards$ regress 'gasout' on 1 predictor 'gasin' fits in c9; residuals put into c10; dw . print c9 c10 acf 24 for series 'gasout' arima 5 1 1 'gasout' c8; constant; forecast 280 60. acf 24 for series c8 b34sreturn$ b34seend$ This job is distributed with the B34S in B34STEST.MAC. Sample job showing missing data. b34sexec options open('minitab.in') unit=29 disp=unknown$ b34seend$ b34sexec options clean(29)$ b34seend$ b34sexec data keepmiss$ input x y$ datacards$ 11 33 66 na . 88 99 88 00 88 b34sreturn$ b34seend$ b34sexec pgmcall$ minitab$ pgmcards$ print 'x' 'y' b34sreturn$ b34seend$ Produces the below listed file for input into MINITAB. Note how missing data is handled. B34S has to have KEEPMISS in effect. # File built by B34S on 05/27/95 at 15:04:07 outfile 'MINITAB.LST' noecho read data into & c1 & c2 & c3 11.000000 33.000000 1.0000000 66.000000 * 1.0000000 * 88.000000 1.0000000 99.000000 88.000000 1.0000000 0.00000000 88.000000 1.0000000 end echo name c1 'X' name c2 'Y' name c3 'CONSTANT' info describe 'X' describe 'Y' describe 'CONSTANT' print 'x' 'y' *********************************** X12 Sentence. The B34S X12 sentence on the PGMCALL command allows the user to call the Census X12 program and obtain the output in the B34S log. This command is currently in experimental form due to the experimental nature of X12. X12 provides a number of output formats. The B34S DATA step can be used to read back the X12 generated series into B34S. At some later date, an automatic interface procedure might be developed in B34S if there is demand. The X12 sentence currently has no options. A sample job using the X12 sentence is given next. Users are incouraged to inspect the job TESTX12 which is included in the B34STEST.MAC file. Note that the X12 sentence requires that the INLIST option be used on the PGMCALL sentence since only one series can be passed to X12 at this time. The X12 input file MUST end in .spc. Sample job. /$ Tests X12 interface /$ User must have X12 /$ /$ X12 is availabe from the Dept of Census /$ b34sexec data filef=@@ setmy(1,68) setfreq=12$ * Data from the Bureau of the Census $ input icmeti$ label icmeti ='Total Inventories Communications equip.'$ datacards$ 1654.76 1712. 1784. 1797. 1857. 1865. 1855. 1880. 1869. 1891. 1906. 1915. 1938. 1881. 1916. 1912. 1979. 1972. 1931. 1973. 2085. 2103. 2133. 2185. 2202. 2235. 2218. 2242. 2258. 2294. 2256. 2248. 2251. 2203. 2160. 2137. 2088. 2094. 2105. 2108. 2150. 2167. 2142. 2155. 2154. 2134. 2118. 2146. 2170. 2163. 2205. 2203. 2202. 2210. 2173. 2230. 2253. 2237. 2252. 2237. 2325. 2318. 2365. 2370. 2426. 2488. 2531. 2590. 2594. 2646. 2698. 2736. 2882. 2924. 2986. 3017. 3060. 3073. 3040. 3063. 3089. 3147. 3161. 3117. 3182. 3226. 3251. 3234. 3234. 3199. 3141. 3129. 3131. 3145. 3105. 3058. 3046. 3085. 3106. 3127. 3181. 3234. 3181. 3240. 3231. 3313. 3327. 3375. 3400. 3525. 3614. 3612. 3718. 3686. 3695. 3747. 3809. 3850. 3849. 3846. 3853. 3942. 4056. 4047. 4129. 4151. 4121. 4224. 4312. 4293. 4339. 4318. 4475. 4566. 4707. 4718. 4763. 4817. 4854. 4993. 5075. 5259. 5357. 5491. 5743. 5961. 6245. 6336. 6478. 6493. 6612. 6678. 6775. 6862. 6892. 6744. 6923. 7105. 7078. 7185. 7133. 7109. 7079. 7099. 7097. 7164. 7221. 7015. 7612. 7729. 7807. 7799. 7701. 7600. 7590. 7617. 7555. 7584. 7698. 7346. 7474. 7458. 7542. 7529. 7608. 7561. 7602. 7608. 7636. 7673. 7689. 7662. 7743. 7920. 8210. 8272. 8415. 8492. 8639. 8772. 8850. 9041. 9048. 8895. 9066. 9179. 9136. 9088. 9038. 8962. 8981. 8774. 8694. 8630. 8471. 8200. 8198. 8315. 8412. 8487. 8600. 8624. 8800. 8828. 8744. 8698. 8781. 8785. 8799. 8921. 8866. 8947. 8990. 8919. 8996. 8987. 8838. 8951. 8942. 8854. 8834. 8868. 8968. 8992. 9041. 9065. 9123. 9219. 9201. 9215. 9327. 9086. 9173. 9303. 9246. b34sreturn$ b34srun$ b34sexec options open('x12junk.spc') unit(29) disp=unknown$ b34srun$ b34sexec options clean(29)$ b34srun$ b34sexec pgmcall inlist(icmeti) icntrl=29 idata=29$ X12 $ pgmcards$ span{ # end=87.3 start=68.1 } transform{ boxcox=log } regression{ # variables=(Const LS69.02 ls69.09 ls82.01) variables=(Const ls82.01) } arima{ model=(0 1 3)(0 1 1) } outlier{ print=all } check{} forecast{ numfor=12 numback=12 } b34sreturn$ b34srun$ /$ Note that the prior step MUST end with a run to force execution /$ before the close occurs. b34sexec options close(29)$ b34srun$ b34sexec options system('x12 x12junk')$ b34srun$ b34sexec options npageout writeout('Output from x12') copyfout('x12junk.out') /$ Note: To debug or run X12 stand alone, uncomment next line. /$ system('erase x12junk.in','erase x12junk.out') $ b34srun$ *********************************** SHAZAM sentence. The B34S SHAZAM sentence on the PGMCALL command allows the user to call the SHAZAM program and obtain the output in the B34S log. This command is currently in experimental form. SHAZAM sentence options. LOWERCASE Makes all names lower case. This is the default. UPPERCASE Passes all names as upper case. SHAZAM sentence parameters. OUTFILE(k) Sets the outfile name. Default = _B34SDATA.DAT. Example problem b34sexec options include('C:\b34slm\gas.b34')$ b34srun$ B34SEXEC OPTIONS OPEN('_b34sdata.dat') UNIT(28) DISP=UNKNOWN$ B34SRUN$ B34SEXEC OPTIONS OPEN('shazam.in') UNIT(29) DISP=UNKNOWN$ B34SRUN$ B34SEXEC OPTIONS CLEAN(28)$ B34SRUN$ B34SEXEC OPTIONS CLEAN(29)$ B34SRUN$ b34sexec pgmcall$ shazam$ pgmcards$ arima gasin b34sreturn$ b34seend$ b34sexec options include('C:\b34slm\gas.b34')$ b34srun$ B34SEXEC OPTIONS OPEN('shazam.in') UNIT(29) DISP=UNKNOWN$ B34SRUN$ B34SEXEC OPTIONS CLEAN(29)$ B34SRUN$ b34sexec pgmcall idata=29$ shazam$ pgmcards$ arima gasin b34sreturn$ b34seend$ *********************************** STATA The STATA sentence passs either all data or only the data listed on the INLIST( ) call to STATA. Commands listed after PGMCARDS; are appended to the end of the file. Due to STATA placing every line read in the STATA output file, the two file mode of running the STATA interface is highly recommended. STATA sentence options. LOWERCASE Makes all names lower case. This is the default. UPPERCASE Passes all names as upper case. If there is an input file, its name must be set both on the open statement and on the STATA sentence unless its name is statdata.do FILENAME = k Sets the file name for the STATA data. A sample PC job is given next to load data into PC The keyword k should be given inside ' ' such as FILENAME='mystata.dat'. Example # 1 One file b34sexec options ginclude('b34sdata.mac') member(gas)$ b34srun$ b34sexec options open('stata.do') unit(29) disp=unknown$ b34srun$ b34sexec options clean(29)$ b34srun$ b34sexec pgmcall idata=29 icntrl=29$ stata$ pgmcards$ list regression gasout gasinarima gasin b34sreturn$ b34seend$ b34sexec options close(29); b34srun; b34sexec options dodos('stata /e stata.do') dounix('stata -b do stata.do'); b34srun; b34sexec options npageout writeout('output from stata',' ',' ') copyfout('stata.log') dounix('rm stata.do','rm stata.log') $ b34srun$ Example # 2 Two files b34sexec options ginclude('b34sdata.mac') member(gas)$ b34srun$ b34sexec options open('statdata.do') unit(28) disp=unknown$ b34srun$ b34sexec options clean(28)$ b34srun$ b34sexec options open('stata.do') unit(29) disp=unknown$ b34srun$ b34sexec options clean(29)$ b34srun$ b34sexec pgmcall idata=28 icntrl=29$ stata$ pgmcards$ list regression gasout gasinarima gasin b34sreturn$ b34seend$ b34sexec options close(28); b34srun; b34sexec options close(29); b34srun; b34sexec options dodos('stata /e stata.do') dounix('stata -b do stata.do'); b34sdrun; b34sexec options npageout writeout('output from stata',' ',' ') copyfout('stata.log') dounix('rm stata.do','rm stata.log','rm statdata.do') $ b34srun$ GAUSS The GAUSS sentence passes either all data or only the data listed on the INLIST( ) call to GAUSS. Commands listed after PGMCARDS; are appended to the end of the file. If idata=icntrl, data and commands are in one file. This is useful for series < 1000 in observations to keep tjhe # of files down. For Series with > 1000 observations, the GAUSS limit of the command length of 4000 limits the use of the GAUSS let commmand. In this situation idata must point to a different file than icntrl. This mode of operation uses the GAUSS load command. In this latter option the data is saved by variable name and also in a matrix _xx(k,noob). GAUSS sentence options. LOWERCASE Makes all names lower case. This is the default. UPPERCASE Passes all names as upper case. OUTFILE Sets the outfile name. Default = _b34sdata.dat Note: Only numeric data is passed. Example # 1 One file b34sexec options ginclude('b34sdata.mac') member(gas)$ b34srun$ b34sexec options open('gauss.in') unit(29) disp=unknown$ b34srun$ b34sexec options clean(29)$ b34srun$ b34sexec reg; model gasout=gasin; b34srun; b34sexec pgmcall idata=29 icntrl=29$ gauss$ pgmcards$ call ols("",gasout,gasin); b34sreturn$ b34seend$ b34sexec options close(29); b34srun; b34sexec options dounix('gaussb gauss.in > gauss.out.log'); b34srun; b34sexec options npageout writeout('output from gauss',' ',' ') copyfout('gauss.out.log') dounix('rm gauss.in','rm gauss.out') $ b34srun$ Example # 2 Two file b34sexec options ginclude('b34sdata.mac') member(gas)$ b34srun$ b34sexec options open('gauss.in') unit(29) disp=unknown$ b34srun$ b34sexec options clean(29)$ b34srun$ b34sexec options open('gauss.dat') unit(28) disp=unknown$ b34srun$ b34sexec options clean(28)$ b34srun$ b34sexec reg; model gasout=gasin; b34srun; b34sexec pgmcall idata=28 icntrl=29$ gauss outfile('gauss.dat')$ pgmcards$ call ols("",gasout,gasin); b34sreturn$ b34seend$ b34sexec options close(29); b34srun; b34sexec options dounix('gaussb gauss.in > gauss.out.log'); b34srun; b34sexec options npageout writeout('output from gauss',' ',' ') copyfout('gauss.out.log') dounix('rm gauss.in','rm gauss.out') $ b34srun$ R The R sentence passes all data or just the listed data to the open source R program. The setup should also work with S. R sentence options. LOWERCASE Makes all names lower case. This is the default. UPPERCASE Passes all names as upper case. /; /; Running R from a fixed script /; Uses r.bat file /; b34sexec options ginclude('gas.b34'); b34srun; b34sexec options open('rjob.r') unit(28) disp=unknown$ b34srun$ b34sexec options clean(28) $ b34seend$ b34sexec pgmcall; r; pgmcards; windows() a<- acf(gasout); a plot(a) i<-c(0,1,14) arima(gasout,i) quit() b34sreturn$ b34srun $ b34sexec options close(29)$ b34srun$ /$ the next card has to be modified to point to sas location /$ be sure and wait until sas gets done before letting b34s resume /$ *************************************************************** b34sexec options dodos(' r rjob' )$ b34srun$ b34sexec options npageout noheader writeout(' ','output from r',' ',' ') copyfout('rjob.out') /;odos('erase rjob.r','erase rjob.out') $ b34srun$ b34sexec options header$ b34srun$