43.0 READVBYV Command The READVBYV command allows reading data into B34S in variable by variable format. This command makes a B34S data loading step. If the READVBY sentence is supplied, an INPUT card is needed for each variable. The READVBYV command only reads data. If data needs to be transformed or the time series properties set, use the B34S DATA step with the SET option. The READVBYV command is NOT the fastest way to load data. In addition the data has to be saved in core. Hence where ever possible, data should be read observation by observation. Form of READVBYV command: B34SEXEC READVBYV options parameters $ INPUT var=var1 $ INPUT var=var2 $ LABEL Var1=' ' var2=' ' $ PGMCARDS $ DATACARDS $ B34SRETURN $ B34SEEND $ READVBYV sentence parameters NOOB=n1 - Sets the number of observations- required. FILE(' ') - Supplies file name if all series are on one file HEADING(' ') - Optionally supplies up to 32 characters for heading. SETFREQ(R) - Sets base frequency. 1. = annual data. .1 = data once per decade. R can be set as real OR integer. If SETFREQ is passed -1, the Julian internal date is reset to unused. SETYEAR(NN) - Sets base year for annual data. Frequency assumed =1. SETMY(M1,Y1) - Sets base year for monthly data. Frequency assumed =12. SETQY(Q1,Y1) - Sets base year for quarterly data. Frequency assumed = 4. SETDMY(D1,M1,Y1) Sets base year for daily data. Frequency assumed =365. IDVAR = xx Sets the character variable xx as an id variable for the observation. IDDATE= xx Sets the variable xx as a julian date variable to identify each observation. IDDATETIME=xx Sets the variable xx as a julian date variable and indicates that time info is saved. INPUT sentence options REAL Variable is real. This is the default. CHARACTER Variable is character of at most 8 characters. INPUT sentence parameters VAR=Vname Sets variable name to input. Required. SKIP=n2 Sets the number of lines to skip before reading. FILE(' ') Sets the file to read from. If this parameter is not given, data must be supplied between PARMCARDS$ and B34SRETURN$ label(' ') Supplies a label for series. A max of 40 characters can be supplied. The label can also be supplied with the LABEL sentence (which has the same format as on the DATA command). If both are given, the LABEL sentence controls. missing(' ') Supplies a missing variable code. LABEL sentence. LABEL X1='MORE INFO ON VARIABLE X1' X2='MORE INFO ON VARIABLE X2' $ The LABEL sentence allows the user to provide more information on a variable that is allowed by the 8 character name. Up to 40 columns of text can be provided inside the ' '. The LABEL sentence is optional. Examples: Simple setup to load two series. b34sexec readvbyv noob=3$ input var=x $ input var=y $ pgmcards$ 1 2 3 4 5 6 b34sreturn$ b34seend$ Labels added using option # 1. b34sexec readvbyv noob=3$ input var=x label='more info on variable x'$ input var=y label='more info on variable y'$ pgmcards$ 1 2 3 4 5 6 b34sreturn$ b34seend$ Labels added using option # 2 b34sexec readvbyv noob=3$ input var=x $ label x ='more info on veriable x'$ input var=y $ label y ='more info on variable y'$ pgmcards$ 1 2 3 4 5 6 b34sreturn$ b34seend$ Character data loaded. b34sexec readvbyv noob=3$ input var=x $ input var=y character$ pgmcards$ 1 2 3 a b c b34sreturn$ b34seend$ Character Data loaded by col b34sexec data filef=cfixed noob=3; input x(1,1,3) y(1,4,4) name(1,6,10); character name; datacards; 1234 john 4321 carol 9998 diana b34sreturn; b34srun; b34sexec list; b34srun; Missing data recoded. b34sexec readvbyv noob=3$ input var=x $ input var=y missing('m')$ pgmcards$ 1 2 3 4 5 m b34sreturn$ b34seend$ Data loaded from two files. b34sexec readvbyv noob=3$ input var=x file('file1')$ input var=y file('file2')$ b34seend$ Data loaded from two files with a skip of 2 and 3 b34sexec readvbyv noob=3$ input var=x file('file1') skip=2$ input var=y file('file2') skip=3$ b34seend$ Data loaded from one file. b34sexec readvbyv noob=3 file=('testfile')$ input var=x$ input var=y$ b34seend$