Dynamic sequential file allocation on MVS

sas

    Sponsored Links

    Next

  • 1. European sas User Group papers
    Hi, I want to access papers & posters that were presented in the Strasburg European sas User group in 1994 or was it 1995. Googling just brings up the American repository. I suppose it is too far back for it to be included in any repository. So I am hoping you might have attended the conferance and downloaded the material at the time. With regard, Eli
  • 2. ODS, RTF, TITLE, and graphic
    I know I've seen this somewhere, but now that I need it, I can't find it. I'm producing an RTF file. Like a lot of RTF output, the page has a title in what Microsoft Word calls the "header" area, produced with a TITLE statement. I need to include a graphic (a picture of the company logo) in the title, so that it appears on the printed page in the upper left corner. Can anyone explain how to do this? Thanks.
  • 3. indexc function trouble
    I'm having problems using the indexc function with birth certificate data. I'm attempting to determine if one or more two digit obstetrical procedure codes are present in a string variable. For example if I run the following code: data test; input x $; datalines; 010203 020304 030405 ; run; data test; set test; z=indexc(x,'02','04'); put z; run; SAS outputs: 1 1 1 when I should be seeing: 3 1 3 which clearly isn't correct. Any ideas what I'm doing wrong? Thanks, Robert
  • 4. getting average of repeating observations
    I have a dataset with the following structure: ID DATE VALUE X 05MAR2007 55 X 07MAR2007 60 X 07MAR2007 66 X 10MAR2007 89 Y 15MAY2007 80 Y 18MAY2007 45 Y 21MAY2007 50 Y 21MAY2007 56 Fot each ID, I would like to remove the observations with duplicate dates and replace them with only one obsservation that has the average VALUE. eg. in this case I would want: X 05MAR2007 55 X 07MAR2007 63 X 10MAR2007 89 Y 15MAY2007 80 Y 18MAY2007 45 Y 21MAY2007 53 How can I do this programatically?

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 43 guest