So, first off I'll admit that I am a user with no formal SAS training. So everything I know about SAS (which isn't much as I look through the manuals) is through the school of hard knocks or figuring things out from other jobs. So be kind, please? 😉 Anyways...my issue is that a user wants a total, from a transaction file, for one particular type of a transaction. So, I used PROC TABULATE to come up with a report that gives her what she wanted. But, she would like the data in a CSV file. So, looking through the forums I found a way to do it, but (just so it looks better) I would like to get rid of some fields. So, my JCL looks like this: //STEP1 EXEC SAS9,TIME=120,OPTIONS='LS=133,NODATE,MACRO' //OUT DD DSN=<Dataset name>,DISP=SHR //SYSIN DD * %GLOBAL DAT; . CALL SYMPUT('DAT',PUT(DATE(),WORDDATE18.)); . . PROC TABULATE FORMAT=DOLLAR12.2 OUT=DAT1; BY FLD1; CLASS FLD2; VAR TOTFEE; FORMAT FLD1 $FLD1. FLD2 $FLD2.; TABLES FLD2 ALL='TOTAL',TOTFEE; TITLE1 'XXXXXXXXXXXXXX'; TITLE2 'YYYYYYYYYY'; TITLE3 'ZZZZZZZZZZ'; TITLE5 "&DAT"; KEYLABEL N=' '; *; DATA _NULL_; FILE OUT; SET DAT; PUT (_ALL_) (','); /* Here's part of the output (I apologize for the cut/paste, the format got all messed up): ------------------ FLD1=AAA ------------------ ---------------------------------------------- | | TOTFEE| | |---------------| | | SUM | |-------------------------------+------------------| |FLD2 | | |------------------------------- | | |XXXXX | $0.00| |-------------------------------+------------------| |YYYYYYY | $282.00| |-------------------------------+------------------| |ZZZZZZZ | $53.50| So, the above works great, EXCEPT I have values in my file that I have no idea where they came from, what they are and how to get rid of them, which is where my question comes in. My file looks like this: ,AAA ,AXXXX ,1 ,1 ,1 ,0 ,AAA ,BTTTTTT ,1 ,1 ,1 ,282 ,AAA ,BUUUUUU ,1 ,1 ,1 ,53.5 ,AAA ,BXXXXX ,1 ,1 ,1 ,23.5 ,AAA ,BYYYY ,1 ,1 ,1 ,820.1 So, I have, I guess, an empty first field, the next two fields and the last fields are the ones that I want. The three 1s, I don't want, but don't know how to get rid of them. My JCL output doesn't tell me anything either, other than there were 6 fields output (so maybe I don't have an empty first field). NOTE: THERE WERE 213 OBSERVATIONS READ FROM THE DATA SET WORK.RGDATA. NOTE: THE DATA SET WORK.DAT1 HAS 22 OBSERVATIONS AND 6 VARIABLES. NOTE: THE PROCEDURE TABULATE PRINTED PAGES 6-7. NOTE: THE PROCEDURE TABULATE USED THE FOLLOWING RESOURCES: Any help would be greatly appreciated. Thanks
... View more