Dynamic sequential file allocation on MVS

sas

    Sponsored Links

    Next

  • 1. getting at notes stored in JMP
    I have a JMP dataset with coded fields. There is information about the variable coding in the notes for each field. Is there a way of extracting the JMP notes into SAS?
  • 2. A question of change output layout
    I output one of the Proc Univariate result (Extreme) by using ODS. It looked like this: ID value obs value obs 1 1.5 10 9.0 98 1 2.3 3 11.4 102 2 1.1 6 10.1 88 2 1.4 3 12.4 99 Now I like change this to: ID L_val1 L_val2 L_obs1 L_obs2 H_val1 H_val2 H_obs1 H_obs2 1 1.5 2.3 10 3 9.0 11.4 98 102 2 1.1 1.4 6 3 10.1 12.4 88 99 Can anyone think of anyway to solve this? Thanks a lot.
  • 3. Assigning names and values from a table to macrovariables
    The issue is how to assign a certain name and value to macro variables according to values in a table. Run the following code in the editor: data pst_tbl; input pst_name $1-25 pst_value 26-29; cards; pst_itg_dfm_dok_ugy_2_p 0.5 pst_itg_dfm_sak_ugy_2_p 1.5 pst_itg_dty_dok_3_p 3.9 pst_itg_nul_dok1_p 8.7 ; I want to make 4 macrovariables (or dynamically, as many as there may be of records in PST_TBL). I want to give them the same name as the value in PST_NAME, and the same value as the corresponding value in PST_VALUE. For example, &pst_itg_dfm_dok_ugy_2_p is going to evaluate to 0.5. I want the macrovariables to be global. How do I write this code ? Regards Rune Runnestoe

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