Dynamic allocation of output files in a SAS program

sas

    Sponsored Links

    Next

  • 1. get summary information using PROC SQL
    Dear All, I have a question about how to combine two datasets and get some summary information. I have a monthly dataset (data1) which consists of four variables: the stock ID, current month, return in current month, and holding period for each stock(HP). The HP is, by the way, different across stocks across months. Now, for data1, I want to get the rolling return for each stock in each month for previous HP-months. The complete monthly return data are in another dataset (data2).I tried the following code but failed. Could anybody please help me? Thanks! my code: proc sql; create table temp as select distinct b.id, b.dates exp(sum(log(1+a.ret)))-1 as hp_return from data2 as a left join data1(rename=(id=ids date=dates)) as b on a.id=b.ids and b.hp>intck('month', a.date,b.dates)>=0; run;
  • 2. Data File with multiple instances
    I work for a financial institution and we are having trouble with some SAS code. Any suggestions you can lend are greatly appreciated. Background: We have transaction files that have multiple records per account number. We are attempting to calculate some specific attributes for each account number. One solution we have used is to use an array to combine the multiple records of each account into one record per account and then use arrays to evaluate the data. This works when there are only one or two records per account, but we have seen as many as 150+ records per account. This is a problem because the array to combine the records will now require all account number to have 150+ segments regardless if most accounts only have data in a few segments. This creates a huge file that is unnecessary and inefficient. Is there a way to process a file(s) with multiple records per account that evaluates dollar amounts and date ranges while keeping the existing integrity of the file? The calculation must sometimes look at data from a previous or later record. Thank you in advance.
  • 3. LOGISTIC model--I have this thought--What do you think
    What you are planning to do is quite reasonable. You have a hypothesis that changes in balances might influence the outcome variable, so you include change as a predictor. However, I would also include the most recent balance in the model, as it is quite reasonable to expect this to be important also - and it would be interesting to know whether the change is important while holding the level constant. More generally, if you have balances for the previous N months, then you can have N predictor variables. These can be any indepedent linear function of the N balances. Eg for 2 months you could have any of the following sets of predictor variables B1, B2 B2, (B1-B2) (B1+B2)/2, (B1-B2) Each of these models will give identical outcome predictions. If you estimated the first of these models, but the key variable were really the change in balance, then you would expect to find that the parameters on B1 and B2 would be different. If you want, you can test these different options after model estimation using the test statement. (Of course, if you just throw everything in without a good reason then you are data mining and need to recognise that the significance levels are not conservative enough).
  • 4. zero cell in chisq
    Hi Sas users: When I try to submit this one way Chisq I get this message ERROR: The number of TESTP values must equal the number of table cells, for the table of hiredate. NOTE: The SAS System stopped processing this step because of errors. options nodate nonumber symbolgen; **proc printto file='lpt1:' new ; dm 'log;clear;out;clear;' ; data severe; input hiredate $ type $ count pct; CARDS; 55-69 obs 0 0 70-79 obs 58 10 80-89 obs 112 18 90-94 obs 141 16 95-99 obs 172 21 00- obs 301 35 ; proc print;run; proc freq ORDER=DATA ; tables hiredate / chisq NOCOL NOCUM EXPECTED TESTP=(1 7 14 18 22 38) ; WEIGHT pct; run; quit; Dr. Jamil Ibrahim, Ph.D. Institutional Research Associate Assistant Professor , SHRP Univ. Of Miss. Med. CTR. 2500 N state St Jackson, MS 39216 Tel. 601-984-1197 Fax 601-984-1205 Nternet: XXXX@XXXXX.COM The information contained in the attachment(s) to this email is confidential. If you were not expecting a confidential email from the Department of Institutional Research at the University of Mississippi Medical Center, please do not view, open, disclose, reproduce, distibute or otherwise use this attachment. If you received this email in error, please notify me immediately. Thank you.
  • 5. Drill Down on Tables
    Dear All, I wold like to produce a number of Freq tables and to pass from one to another using a drill down functionality. Suppose, for example, I have a dateset with the following variables: - customer id - sex - status - contact channel I would like to produce the frequency by sex, then, clicking on the number of males, I would open the frequency of males by status, and so on... I have seen there is a chance to do this with graphics (see Configuring Drill-Down Links for Java and ActiveX) but I can not find anything about Tables. Thanks in advance. Grado

Dynamic allocation of output files in a SAS program

Postby k_hemendra » Thu, 10 Jul 2003 19:58:06 GMT

Hi,
Is it possible to dynamically allocate output files in a SAS program.
I guess it is possible in Assembler.

Re: Dynamic allocation of output files in a SAS program

Postby Biff » Fri, 11 Jul 2003 01:04:20 GMT




YES

Similar Threads:

1.Dynamic sequential file allocation on MVS

Dear Folks,

I was used SAS on Win/Unix platform and new to mainframe, I have task
to complete which needs some expert advise , that why I am here.

I have to export SAS datasets to a delimited file which has to be
stored in portioned dataset as member, I wrote macro to do covert the
dataset as delimited file but I don know how to put it into PDS
member i.e

My pds name : bgxp.ftdf.data
My dataset name: mytrans
My csv converter macro : mconcsv
My Delimited file name should be : transrep

Here my expectations are :

1.	How to include a delimited file to member of PDS via JCL or SAS
2.	How do we set the space for the file i.e. I don know exactly how
much space I need for the delimited file?

If some one in the group post sample snippet with JCL / SAS that will
be really helpful.

Thanks & Regards,
Vijay

2.Dynamic Link SAS output to Powerpoint

Gents,
 In our New applications Dept. we have installed a Plasma Screen to
display online the status of customer's applcations.
I'm able to calculate online and through SAS all related numbers which
we have to display on the Plasma screen by using Powerpoint.
My quateion is:
 How I can have a dynamic link between SAS and Powerpint ?

Regards...Jarmak

3.Unix File Allocation Freeing ?

I have a program that is writing to a file that I want to execute,
within the program, after being created.  It didn't work when I tried
it and I'm guessing it's because the file was tied up by the program.
Is there a Unix command I can use to free the file within the program?

Here's the general flow of the program:

data _null_;
     file '/mypath/test.sh';
     put 'line 1';
     run;

* this is where the allocation free would be ;

x test.sh;

Other ideas welcome.  Thanks for any help.

4.MVS allocation of ODS PDF file

How should one allocation a PDF file for ODS PDF.  The default size is too
small.

Here is how I tried it:

//TOPSPDF  DD DSN=PSB2230.TOPS.PDF,
//            DISP=(NEW,CATLG,DELETE),
//            SPACE=(CYL,(50,10),RLSE),UNIT=SYSDA,
//            DCB=(RECFM=U,BLKSIZE=0)

And the statement is SAS is:

ODS PDF FILE=TOPSPDF;

Thanks!

5.Automated import of dynamic labeled files into SAS

Hi,

I want to write a SAS-Base program which is able to import dynamic
labeled files into SAS. The filenames have no specific pattern. Only
one part of the filename is static. For example:
File 1: attach_first.txt
File 2: attach_hour.txt
...
File 1000: attach_town.txt

The structure of the file content is in every file the same.

Exist in SAS wildcards to read in these Files?

I would be happy to get a solution!

A lot of Greetings from Germany.

Tom

A normal SAS-program with proc import looks like:
proc import datafile="D:\Service\Research\attach_first.txt"
            out=work.attach_first
	    dbms=dlm
            replace;
            delimiter='|';
	    getnames=yes;
run;

6. Dynamic file creation thru SAS

7. best practices: list processing, dynamic programming

8. dynamic macro-programming with call symput



Return to sas

 

Who is online

Users browsing this forum: No registered users and 50 guest