[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sas-l
Subject:    Re: output.
From:       Jack Shoemaker <JShoemak () OXHP ! COM>
Date:       1998-06-30 16:47:03
[Download RAW message or body]

Mike,

   Does this code fragment help?  The data-step variable inside the loop
called COLHEAD should have months specified in MMMYYYY format (let's be
Y2K compliant after all).  The INTNX() function increments dates ( i - 1
) months from the START date.  The MONYY7. format writes out the date in
MMMYYYY format.

   Hope this helps. - Jack

if _n_ = 1 then do;
  start = '01MAY1995'D; /* first month */
  nmn = 10;  /* number of months */
  do i = 1 to nmn;
     colhead = put( intnx( 'month', start, ( i - 1 ) ), monyy7. );
  end;
end;

--
Jack Shoemaker / Oxford Specialty Management / JShoemak@oxhp.com


+ -----Original Message-----
+ From: Mike Janicke [mailto:Jaguar5764@AOL.COM]
+ Sent: Tuesday, June 30, 1998 8:43 AM
+ To: SAS-L@UGA.CC.UGA.EDU
+ Subject: output.
+
+
+ Dear SAS_L, I am using the following code to create an output
+ dataset.  The
+ file to be downloaded looks like this:
+
+ Cover May95 Jun95 Jul95
+ A        5             4       6
+ B         3             3       8
+ .           .             .        .
+ now I'd like to create some type of automatic variables to
+ code for the dates
+ rather than manually type May95 etc below.  the actual file
+ has 5 years worth
+ of data so you can imagine how laborous this is to update.  I
+ have a file
+ earlier with one record for every Month/Year if that would
+ help.  Perhaps
+ there is a way to use Callsymput and create a macro variable
+ for each date and
+ code using those variable names.
+ I'd appreciate any help you might offer!  Thanks!
+
+
+  DATA _NULL_;  SET &DATANAME;
+    FILE "IUUUUUJ.OUTPUT.DATA(&DATANAME)";
+
+ HEAD1="*&VAR*5/95*6/95*7/95*";
+     IF _N_=1 THEN PUT @1 HEAD1 $CHAR200.;
+                                               PUT(&VAR MAY95 JUN95
+ JUL95)(+(-1)'*');
+

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic