home *** CD-ROM | disk | FTP | other *** search
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- Path: sparky!uunet!gatech!paladin.american.edu!auvm!STACC.MED.UTAH.EDU!KNECHOD
- Mailer: Elm [revision: 66.33]
- Message-ID: <SAS-L%92073011125730@UGA.CC.UGA.EDU>
- Newsgroups: bit.listserv.sas-l
- Date: Thu, 30 Jul 1992 09:16:03 MDT
- Reply-To: knechod@stacc.med.utah.edu
- Sender: "SAS(r) Discussion" <SAS-L@UGA.BITNET>
- From: Kevin Nechodom <knechod@STACC.MED.UTAH.EDU>
- Subject: Re: Comma delimited output file from SAS on MVS/ESA
- Comments: To: SAS Mailing List <sas-l@uga.cc.uga.edu>
- In-Reply-To: <01GMZHN6UYR8000AAR@msvax.mssm.edu>; from "TOM ABERNATHY" at Jul
- 30, 92 9:55 am
- Lines: 87
-
- After my earlier post, Tom Abernathy told me:
- >
- > If you are reaching a limit of 254 for your lines it is probably some
- > sort of LRECL default. Try specifying a LRECL on your FILENAME statement.
- >
- > Good Luck.
- > Tom Abernathy
- > tom@msvax.mssm.edu
- >
-
- I did so, and the need for my earlier qualification has disappeared. Also,
- my sample usage of the %COMMA macro had an error in it. The output filename
- must be in quotes. So here is the revised macro, if anyone wants it.
-
- My thanks to Karen Patterson, Ben Connor, and Tom Abernathy.
-
- ---- cut here ----
- %MACRO comma(lib,file,output);
-
- filename SASOUT &output lrecl=4096 recfm=v;
- options dquote nomprint nomlogic nomacrogen nosymbolgen
- missing = ' ';
-
- title;
-
- %let THEPUT=PUT;
- %let HDRPUT=PUT;
-
- proc contents data=&lib..&file out=filedef noprint;
- proc sort;
- by varnum;
-
- data _NULL_;
- set filedef;
-
- call symput('NVAR',put(varnum,3.));
-
- call symput('VNAME'||left(put(_N_,3.)),put(name,$8.));
-
- if type = 1 then
- do;
- if format="MMDDYY" then
- call symput('TYPE'||left(put(_N_,3.)),put("D",$1.));
- else
- call symput('TYPE'||left(put(_N_,3.)),put("N",$1.));
- end;
- else
- if type=2 then
- do;
- call symput('TYPE'||left(put(_N_,3.)),put("C",$1.));
- end;
-
- run;
-
- data _NULL_;
-
- set &lib..&file;
- file SASOUT;
-
- p = -1;
-
- if _N_ = 1 then
- do;
- %do i=1 %to &nvar;
- %let HDRPUT = &HDRPUT '"' "&&VNAME&I" '"' ',';
- %if "&&TYPE&I" = "D" or "&&TYPE&I"="C" %then
- %let THEPUT = &THEPUT '"' &&VNAME&I+P '"' ',';
- %else
- %let THEPUT = &THEPUT &&VNAME&I + P ',';
- %END;
- &HDRPUT;
- end;
-
- &THEPUT;
-
- run;
-
- %MEND comma;
-
- %comma(prod,airheum,'aiout')
- ---- cut here ----
-
- --
- Kevin Nechodom UofU STACC | Great Moments in Physics History:
- UofU doesn't even know I exist; | "E= m c cubed? No, too gaudy.
- how would they care what I say? | E= m c ? No, too simple.
- knechod@stacc.med.utah.edu | E= m c squared? Ah, ha!"
-