Dynamic sequential file allocation on MVS

sas

    Sponsored Links

    Next

  • 1. Quick help
    Dear ladies & gents I need help with code, I am so rusty haven touched SAS in a while. My product of interest is I am trying to identify the product used prior to C. So when ever I consider an ID and see product C (for the first time), I want to know what the product in the prior date was. I expect out put to be three columns ID, Prior_prod & Date (date when first C was used). For id=1 example output will be: ID Prior_prod Date 1 B MAR 8 None JAN Here is the data: data work; input ID Date $ Product $; cards; 1 JAN A 1 FEB B 1 MAR C 2 JAN A 2 FEB B 2 MAR B 2 APR C 2 MAY C 3 JAN A 3 FEB C 4 JAN A 4 FEB B 4 MAR A 4 MAR B 5 JAN B 5 FEB B 5 MAR B 5 APR C 6 JAN A 6 FEB B 6 MAR C 7 FEB C 8 JAN C ;; run; --------------------------------- Moody friends. Drama queens. Your life? Nope! - their life, your story. Play Sims Stories at Yahoo! Games.
  • 2. dataset Locked ??
    This is some thing I am Just curious to find out is there a windows application or a script that can used to find out who Opened a dataset on Windows 2000 Server Platform. I trying to Google it but I do not what is right query to put it . I am getting Dataset Locked error but if I know a who did it, it would great to tell one person instead of asking the whole group . I know this something to do Operating system commands not a SAS thing but can any of you had this problem before and solved it. Thanks
  • 3. Does the PROC REG OUTEST dataset really need an F-statistic
    To the statistics sages on SAS-L: I don't think this is a subtle question of statistical inference, just a matter of definition of the F and R-square sample statistics and their calculation. Frequently users of PROC REG on our system complain that it does not include the F statistic in the OUTEST dataset, even though it prints it in the listing file. So typically they resort to using ODS to capture it from the listing output. But since the R-square, model DF, and error DF are in the OUTEST data set, can't the F-statistic be directly calculated and ODS be avoided? My understanding of the expressions for the F-stat and R-square suggests this should be straightforward, as in: F = (_rsq_) * (_edf_/_in_) Where _rsq_ = R-square _edf_ = Error DF (N-1) _in_ = Model DF (Number of parameters in the model, excluding intercept). Or are there some model specifications in PROC REG that would not permit using the values in the OUTEST data set to reproduce the F-stat that SAS prints on the listing file? Thanks, Mark Keintz

Dynamic sequential file allocation on MVS

Postby vijayakumar » Wed, 05 Aug 2009 05:40:51 GMT

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

Re: Dynamic sequential file allocation on MVS

Postby barry.a.schwarz » Wed, 05 Aug 2009 06:39:53 GMT

Check out the "Writing to Members of PDS or PDSE Data Sets" section in
the "SAS Companion for z/OS" manual.

-----Original Message-----
From: vijayakumar
Sent: Monday, August 03, 2009 1:41 PM
To:  XXXX@XXXXX.COM 
Subject: 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's 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't 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

Re: Dynamic sequential file allocation on MVS

Postby nathaniel.wooding » Fri, 07 Aug 2009 00:07:30 GMT

ijay

I was out most of yesterday and when I cleaned out my inbox, I do not recall seeing a reply to you.

First, a minor correction. The type of data set on a mainframe is called "Partitioned", not "Portioned".

I have not needed to allocate a new data set like this in quite a while but in the past, I have used the ISPF 3.2 menu. An easy way to cheat in using this tool is to specify an existing PDS on the 3.2 menu and hit enter. The data sets characteristics such as record length and number of cylinders or tracks allocated will be displayed. Assuming that your pf keys are set up like mine, if you hit F3, you will return to the 3.2 menu. Then, enter the letter A in the option field and the name of your new data set either in the section labeled ISPF library or below in the area labeled
Other Partitioned, Sequential or VSAM Data Set:

If you use the latter area, you will need to enclose the set name in quotation marks.

When you hit enter, you will see a screen like the one you saw in the first step. It will have the new file name but all of the parameters of the set that you used as a model.

Now, as to the amount of space to allocate, that will depend on how much information you are going to store there. The PDS where I store my working programs has about 200 tracks allocated on a 3390 disk drive. If you are looking at, say a few thousand obs and maybe 20 variables, you might start with 200 primary tracks and 200 secondary tracks. When ZOS fills up the first 200 tracks, it will automatically add another 200 and will keep doing this for 14 or 15 more times. If this ever happens, you will need to allocate a new PDS with the primary tracks being around 200*16. Use ISPF 3.3 to copy the old members to the new set, delete the old set, and rename the new one.

You will need to estimate the number of "columns" meaning count up the length of each of the variables and add in enough space for the delimiters. Put this in the field labeled "Record Length".

The field Directory Blocks saves a bit of the file space to store the directory information for the PDS. I have several hundred members in the PDS that I have been using as a model here and I have 200 directory blocks. This is probably more than you will need.

Now, when you refer to this data set and the member that you are writing you may write your file name like

FILENAME Out "bgxp.ftdf.data(&newfile)" DISP=old;

The fileref (Out) is, of course, a name that you choose. Some important bits to watch for are:

1) the member name can NOT be more than 8 characters long.
2) it must start with a character but the remaining 7 can be numeric
3) for you to be able to write a member, DISP MUST be Old. You may specify SHR if you are reading the member later although you may also read with OLD. This also goes for reading and writing SAS data sets.

This should get you started. Your biggest challenge will probably be in estimating the size of your file.

Good luck

Nat Wooding


-----Original Message-----
From: SAS(r) Discussion [mailto: XXXX@XXXXX.COM ] On Behalf Of vijayakumar
Sent: Monday, August 03, 2009 4:41 PM
To: XXXX@XXXXX.COM
Subject: 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's 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

Similar Threads:

1.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!

2.Dynamic allocation of output files in a SAS program

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

3.sequential summing/ sequential running totals of column values

Hi List,
I wonder if anyone could help? I'm trying to sum values in one column=20
sequentially, producing the running total of each column in a seperate=20
column. So in the example below column 'a' contains the original data and=
=20
column 'as' contains the corresponding running total when each value is=20
summed sequentially, greatest value first. I've searched the web plus past=
=20
listings on this listserve and can't find what I'm looking for. Not sure if=
=20
I have to use proc sort on each column in turn (I have 100 such columns) an=
d=20
use Suma+a in a data step, or whether there is a function that will do what=
=20
i want without having to sort first.=20
Many thanks for any help!
jared
     a as b bs c cs 4 4 10 100 2 96 2 9 30 70 74 74 1 10 40 40 20 94 3 7 20=
=20
90 1 97

4.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.

5.Merging Multiple Datasets With Sequential File Names

I'm in need of some advice from a SAS guru.

Is there a way to merge multiple files, which have a sequential naming
convention (file001, file002, file 003 etc), into a master table that
also creates a new variable derived from number in the file name?

for example:

Variables
Name     Date     Cost

file001
A     1/2006     4.25
C     2/2004     4.23

file002
J     4/2003     2.34
K    7/2001     5.32

Then merge the files into a master table:

Variables
Name     Date          Cost     FileNum
A           1/2006       4.25      001
C           2/2004       4.23      001
J           4/2003        2.34      002
K           7/2001       5.32      002

Anyone have a quick solution for me?

Thanks Much,

Aaron

6. Check the existence of a file on MVS from UNIX

7. Getting a ZIP file from a remote website in MVS/Z/os

8. MVS transport file



Return to sas

 

Who is online

Users browsing this forum: No registered users and 91 guest