Creating data step to input file dump. All variables are straight forward except for one containing space information. Examples of the data are:
121.440K
50956.360K
1439.280M
The filed is 11 bytes long with a size identifier as the last character (k=kilobytes,m=megabytes,etc.) I need to convert these values to a common denominator (numeric field representing bytes) and remove the size identifier character. My attempt so far, with what I know (SPACE variable being the one I'm referencing in my post):
DATA FDREPORT;
INFILE INFILE;
INPUT @1 VOLSER $6.
@8 DSNAME $44.
@53 ARCYEAR 4.
@58 ARCJUL 3.
@62 SPACE $11.
@74 CATALOG $3.
@78 EXPYEAR 4.
@83 EXPJUL 3.
@87 RUNYEAR 4.
@92 RUNJUL 3.;
IF _N_ = 1 THEN DELETE;
IF INDEXC(SPACE,'K') THEN DO;
SPACE=TRANSLATE(SPACE,'','K');
NUMBER=INPUT(SPACE,7.3)*1024;
END;
RUN;
This "seems" to be working from what I've run so far. So my questions are:
Is there a better way of doing this? I realize I will have to create multiple if statements for the different size characters (k,m,g,t,p). When I run a proc contents on the pdb, it lists the NUMBER field as TYPE NUM with a length of 8?
The last two lines of the input are summary lines that I need to skip. Is there an easy way of accomplishing this?
... View more