Output a filelist to TXT file on Mainframe

sas

    Next

  • 1. selecting observation lines in the Data Step
    I have a data set in which an individual observation line represents a separate ventfor a given key variable, which I will note here as ID .Some IDs have only one observation line, but most have multiples. I am trying to compare adjacent observation lines to see if there is a difference in one of the variables, which I will call here olor Using Data Step programming, I am trying to select as output only those observation lines in which a change in olordoes exist from one vent to another. If you have any suggestions, I would greatly appreciate it.
  • 2. Error with Proc IMPORT: File _IMEX_.'Sheet1$'n.DATA does not exist
    When I use proc import to convert an excel file to dataset, log says "File _IMEX_.'Sheet1$'n.DATA does not exist " I closed all excel files before did that and started new SAS sessions, and Save As to a different file name and tag name, but all these did not help. I doubt if the excel file has too many columns. Any way to resolve this problem ? I appreciate your help.

Output a filelist to TXT file on Mainframe

Postby zqr0 » Sat, 25 Jul 2009 05:54:20 GMT

I am working on a program to migrate several SAS and TXT files from a
given Mainframe account to a Windows server.  I have much of the program
working and I have been working with a text file of Mainframe files
created with TSO 3.4 dataset list that someone did for me.  I would like
to make the program more dynamic and send a list of all Mainframe datasets
(files) to a text file that I can read in and create macro calls from.

I have tried a few aproaches that I found on here using PROC IDCAMS but
each time it seams to keep running and never ending.  The directory
(Mainframe account) that I am trying to get a file list for testing
purposes only has 13 files so it should be very quick.

I did get a list using the code below but it sends the list to the SAS LOG
and I have not been able to redirect it with PROC PRINTTO.

Command I have used:

X 'LISTCAT LVL(ZQR0)';

Is there a way to redirect or "pipe" the output of this to a file like
ZQR0.FILELIST.TXT?

I am working via SAS CONNECT so avoiding JCL would be my preferable
solution.

Thanks,
   Jim

Re: Output a filelist to TXT file on Mainframe

Postby rjf2 » Sat, 25 Jul 2009 06:28:39 GMT

> From: Brittain, James (CDC/CCHIS/NCHS)

here are a couple of references that you'll need after you get this
list:

1. List Processing Basics: Creating and Using Lists of Macro Variables
* Ronald J. Fehd
* Art Carpenter

 http://www.**--****.com/ 

 http://www.**--****.com/ 
ng_Lists_of_Macro_Variables


 http://www.**--****.com/ 

 http://www.**--****.com/ 


2. Batch Processing under Windows

 http://www.**--****.com/ 

 http://www.**--****.com/ 



see also:

 http://www.**--****.com/ 

Ron Fehd  the macro maven  CDC Atlanta GA USA RJF2 at cdc dot gov

Re: Output a filelist to TXT file on Mainframe

Postby mlhoward » Sat, 25 Jul 2009 07:31:38 GMT

Are they SAS datasets?   If so you could capture the file names with ODS using Proc Datasets.

I tried it (on UNIX), and do get it into a data set, and of course you could use any number
of means to print a sas data set to a file; if you are using SAS Connect you could use proc
download after this to bring down the data set.

RSUBMIT;

libname saslib2 '/home/user/saslib';
ods output members=members;
proc datasets library=saslib2;
quit;

proc print data=members;
run;


ENDRSUBMIT;
signoff;


-Mary





From: Jim Brittain < XXXX@XXXXX.COM >
To:  XXXX@XXXXX.COM 
Subject:      Output a filelist to TXT file on Mainframe
Date:         Thu, 23 Jul 2009 16:54:20 -0400

I am working on a program to migrate several SAS and TXT files from a
given Mainframe account to a Windows server.  I have much of the program
working and I have been working with a text file of Mainframe files
created with TSO 3.4 dataset list that someone did for me.  I would like
to make the program more dynamic and send a list of all Mainframe datasets
(files) to a text file that I can read in and create macro calls from.

I have tried a few aproaches that I found on here using PROC IDCAMS but
each time it seams to keep running and never ending.  The directory
(Mainframe account) that I am trying to get a file list for testing
purposes only has 13 files so it should be very quick.

I did get a list using the code below but it sends the list to the SAS LOG
and I have not been able to redirect it with PROC PRINTTO.

Command I have used:

X 'LISTCAT LVL(ZQR0)';

Is there a way to redirect or "pipe" the output of this to a file like
ZQR0.FILELIST.TXT?

I am working via SAS CONNECT so avoiding JCL would be my preferable
solution.

Thanks,
   Jim

Re: Output a filelist to TXT file on Mainframe

Postby gerhard.hellriegel » Sat, 25 Jul 2009 17:43:30 GMT

On Thu, 23 Jul 2009 17:28:39 -0400, Fehd, Ronald J. (CDC/CCHIS/NCPHI)






what you are creating is a member of a PDS. That thing contains a list of
other files (the output from LISTCAT), I think. I don't understand what
you want to do. You are migrating a application to Win. What would you do
with a list of hostfiles on Win? So why "redirecting" the LISTCAT output
to a Win-file??
I assume you want to transfer the logic, not the physical representation
(files) on win? In that case you might want a directory list of .SAS
or .TXT files in another file? Is that true, or do you want the LISTCAT
output (that you can do with PROC DOWNLOAD).
There are several possibilities to do this, but first post what you really
want to do.

Gerhard

Re: Output a filelist to TXT file on Mainframe

Postby Nathaniel.Wooding » Sat, 25 Jul 2009 21:20:38 GMT

Jim

Mainframe SAS has a tool called  Proc Source which can be used with the
Partitioned Data Sets (PDS) where mainframe programs are often stored. It
can, for example, simply list the members of a pds or it can also dump the
entire pds into a sequential text file with a record indicating the start
of each new pds.

If you were to assign filenames to the pds and to a sequential file, say In
and Out, you could use the code

Proc Source indd = in  Outdd = Out nodata;
run;

The file Out would have the list of the member names and these will appear
as


 ./       ADD   NAME=member name


The ./ Add bit is used by an IBM utility for loading members into a PDS.

Nat Wooding
Environmental Specialist III
Dominion, Environmental Biology
4111 Castlewood Rd
Richmond, VA 23234
Phone:804-271-5313, Fax: 804-271-2977
       Cel Phone: 804-205-0752



             Jim Brittain
             < XXXX@XXXXX.COM >
             Sent by: "SAS(r)                                           To
             Discussion"                XXXX@XXXXX.COM 
             < XXXX@XXXXX.COM                                           cc
             GA.EDU>
                                                                   Subject
                                       Output a filelist to TXT file on
             07/23/2009 04:54          Mainframe
             PM


             Please respond to
               Jim Brittain
              < XXXX@XXXXX.COM >






I am working on a program to migrate several SAS and TXT files from a
given Mainframe account to a Windows server.  I have much of the program
working and I have been working with a text file of Mainframe files
created with TSO 3.4 dataset list that someone did for me.  I would like
to make the program more dynamic and send a list of all Mainframe datasets
(files) to a text file that I can read in and create macro calls from.

I have tried a few aproaches that I found on here using PROC IDCAMS but
each time it seams to keep running and never ending.  The directory
(Mainframe account) that I am trying to get a file list for testing
purposes only has 13 files so it should be very quick.

I did get a list using the code below but it sends the list to the SAS LOG
and I have not been able to redirect it with PROC PRINTTO.

Command I have used:

X 'LISTCAT LVL(ZQR0)';

Is there a way to redirect or "pipe" the output of this to a file like
ZQR0.FILELIST.TXT?

I am working via SAS CONNECT so avoiding JCL would be my preferable
solution.

Thanks,
   Jim


CONFIDENTIALITY NOTICE:  This electronic message contains
information which may be legally confidential and or privileged and
does not in any case represent a firm ENERGY COMMODITY bid or offer
relating thereto which binds the sender without an additional
express written confirmation to that effect.  The information is
intended solely for the individual or entity named above and access
by anyone else is unauthorized.  If you are not the intended
recipient, any disclosure, copying, distribution, or use of the
contents of this information is prohibited and may be unlawful.  If
you have received this electronic transmission in error, please
reply immediately to the sender that you have received the message
in error, and delete it.  Thank you.

Re: Output a filelist to TXT file on Mainframe

Postby michaelraithel » Sat, 25 Jul 2009 22:56:03 GMT

Dear SAS-L-ers,

Jim Brittain posted the following:

Jim, I immediately thought of the same solution that Nat did when reading this.  If you are migrating PDS's to PC's then PROC SOURCE is your guy!

I used PROC SOURCE to great effect many years ago when I first navigated the dark and stormy gulf that separates the mainframe mainland and the PC archipelago.  If you do not feel like reinventing the calipers, check out my oldy, moldy SUGI 25 paper:

Transferring Your Mainframe SAS Programs to Your PC in Three Easy Steps

 http://www.**--****.com/ 

If you dust off the cobwebs, give it a shake, and change a line or two, it just might do the trick!

Jim, best of luck in all of your SAS endeavors!


I hope that this suggestion proves helpful now, and in the future!

Of course, all of these opinions and insights are my own, and do not reflect those of my organization or my associates. All SAS code and/or methodologies specified in this posting are for illustrative purposes only and no warranty is stated or implied as to their accuracy or applicability. People deciding to use information in this posting do so at their own risk.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Michael A. Raithel
"The man who wrote the book on performance"
E-mail:  XXXX@XXXXX.COM 

Author: Tuning SAS Applications in the MVS Environment

Author: Tuning SAS Applications in the OS/390 and z/OS Environments, Second Edition

 http://www.**--****.com/ 

Author: The Complete Guide to SAS Indexes

 http://www.**--****.com/ 

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
An expert is someone who knows more and more about less and
less, until eventually he knows everything about nothing. - Anonymous
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Similar Threads:

1.Fwd: Output a filelist to TXT file on Mainframe

---------- Forwarded message ----------
From: Data _null_; < XXXX@XXXXX.COM >
Date: Jul 24, 2009 8:11 AM
Subject: Re: Output a filelist to TXT file on Mainframe
To:  XXXX@XXXXX.COM 


On 7/24/09, Nat Wooding < XXXX@XXXXX.COM > wrote:
> Proc Source indd = in  Outdd = Out nodata;
> run;
>
> The file Out would have the list of the member names and these will appear
> as
>
>
>  ./       ADD   NAME=member name


You can also write tailored control decks using the FIRST, LAST,
BEFORE and AFTER statement.

I might be nice to have a similar PROC for other OSes that process
file directory tree style aggregate storage locations.  But maybe that
is a different subject.

2.From TXT file to TXT file without converting the originals

3.From TXT file to TXT file without converting the originals into

4.txt file output question

I'm working on a .txt file output that is meant to mimic the output of a
legacy system.  I almost have it working but I need to figure out how to
get SAS to recreate the right justified column in the raw data output.
(It's not quite lining up in the email but the one's column of the
rightmost data is right-justified at column 28.)  Any help would be
appreciated.

Thanks

=20

=20

111390                   122

206200                      1

206201                      4

206204                   290

206205                 7023

206212                   697

=20

Code so far:

=20

data _null_;

  set CNPA;

  file outfile encoding=3D"utf-8";

  Code =3D trim(NPA) || trim(Prefix);

  if _N_ =3D 1 then do;

    put #1 ' ';

    put #2 Code TNCount;

  end;

  else put Code TNCount;

run;

=20

=20

5.Proc Freq output as TXT file

6. Output files on the mainframe

7. How to put a table in an external file (txt-file)

8. How to change .xls files into .txt files in SAS



Return to sas

 

Who is online

Users browsing this forum: No registered users and 17 guest