Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Using FILEVAR in SAS for multiple ASCII files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
Charles Wolters

New User


Joined: 30 Mar 2011
Posts: 48
Location: United States

PostPosted: Fri May 13, 2011 1:15 am    Post subject: Using FILEVAR in SAS for multiple ASCII files
Reply with quote

I have 20 ASCII files all with an identical fixed column layout. In SAS I want to be able to read these and create one SAS data set using one SAS data step. In UNIX and Windows I have used the FILEVAR statement to accomplish this task. Has anybody used the FILEVAR statement in a Z/OS environment? If so , what is the most efficient way to get my 20 ASCII files into a data set that can be processed by SAS? Is the TSO LISTC command the best way to go?

Charles Wolters
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Fri May 13, 2011 1:58 am    Post subject:
Reply with quote

1. ASCII data is rare on a mainframe -- and usually causes problems.

2. Concatenate the files in your JCL and forget using FILEVAR -- SAS Problem Note 41191 suggests not using FILEVAR on z/OS systems.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Fri May 13, 2011 11:42 am    Post subject:
Reply with quote

Quote:

2. Concatenate the files in your JCL and forget using FILEVAR -- SAS Problem Note 41191 suggests not using FILEVAR on z/OS systems.


That is only if beside FILEVAR also a userexit is used, for the rest FILEVAR works fine.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Fri May 13, 2011 11:44 am    Post subject: Re: Using FILEVAR in SAS for multiple ASCII files
Reply with quote

Charles Wolters wrote:
I have 20 ASCII files all with an identical fixed column layout. In SAS I want to be able to read these and create one SAS data set using one SAS data step. In UNIX and Windows I have used the FILEVAR statement to accomplish this task. Has anybody used the FILEVAR statement in a Z/OS environment? If so , what is the most efficient way to get my 20 ASCII files into a data set that can be processed by SAS? Is the TSO LISTC command the best way to go?


Yes, i used FILEVAR a lot of times, and the datasets to process (also around 20) i just typed in. Its not that much work if you use dataset names almost identical.
Back to top
View user's profile Send private message
Charles Wolters

New User


Joined: 30 Mar 2011
Posts: 48
Location: United States

PostPosted: Fri May 13, 2011 6:29 pm    Post subject: Re: Using FILEVAR in SAS for multiple ASCII files
Reply with quote

PeterHolland wrote:
Charles Wolters wrote:
I have 20 ASCII files all with an identical fixed column layout. In SAS I want to be able to read these and create one SAS data set using one SAS data step. In UNIX and Windows I have used the FILEVAR statement to accomplish this task. Has anybody used the FILEVAR statement in a Z/OS environment? If so , what is the most efficient way to get my 20 ASCII files into a data set that can be processed by SAS? Is the TSO LISTC command the best way to go?


Yes, i used FILEVAR a lot of times, and the datasets to process (also around 20) i just typed in. Its not that much work if you use dataset names almost identical.


Thank you for your reply. I am going to develop some SAS code assuming that I manually create a data set of data sets and would appreciate a review.

Charles
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Sat May 14, 2011 12:38 pm    Post subject:
Reply with quote

Here is some sample coding :

Code:

//ROOKSCAN DD  *                                                        00160000
XIBF.EPA.MACHINE.ALL.A1                                                 00170007
XIBF.EPA.MACHINE.ALL.A2                                                 00180007
XIBF.EPA.MACHINE.ALL.A4                                                 00190007
XIBF.EPA.MACHINE.ALL.FA                                                 00200007
XIBF.EPA.MACHINE.ALL.FC                                                 00210007
XIBF.EPA.MACHINE.ALL.FD                                                 00220007
XIBF.EPA.MACHINE.ALL.FE                                                 00230007
XIBF.EPA.MACHINE.ALL.T3                                                 00240007
//SYSIN    DD  *                                                        00250000
**********************************************************************; 00260000
%LET SASFILE=ROOKEPAX;                                                  00270001
**********************************************************************; 00280000
LIBNAME SASDATA 'XIBF.SAS.JCLDATA';                                     00290000
OPTIONS NOCENTER LS=85  PS=64 MEMSIZE=300M NOMPRINT NOSOURCE2;          00300000
**********************************************************************; 00310000
DATA LOADSCAN (KEEP=LOADLIB MBRNAME REFERENC COMPDATE SYSID)            00320000
   ;                                                                    00330000
   FORMAT COMPDATE YYMMDD10.;                                           00340000
   LENGTH DSN $44;                                                      00350000
   INFILE ROOKSCAN;                                                     00360000
   INPUT DSN $;                                                         00370000
   IF SUBSTR(DSN,1,1) = '*' THEN RETURN;                                00380000
   INFILE DUMMY FILEVAR=DSN END=END;                                    00390000
   DO UNTIL(END);                                                       00400000
      INPUT  @1 LOADLIB  $CHAR44.                                       00410000
            @45 MBRNAME  $CHAR8.                                        00420000
            @55 REFERENC $CHAR8.                                        00430000
           @187 COMPDATE JULIAN5.                                       00440000
           @205 SYSID    $CHAR2.;                                       00450000
      OUTPUT;                                                           00460000
   END;                                                                 00470000
RUN;                                                                    00480000
Back to top
View user's profile Send private message
Charles Wolters

New User


Joined: 30 Mar 2011
Posts: 48
Location: United States

PostPosted: Mon May 16, 2011 10:33 pm    Post subject: RE: Using FILEVAR in mainframe SAS
Reply with quote

Peter,

Thank you for your code. It is perfectly understandable. I had thought about creating a text file of the data sets that I wanted to concatenate but your approach of using an instream data set is easier.

Charles Wolters
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm
No new posts Adding records from two files into on... shiitiizz SYNCSORT 4 Mon Sep 19, 2016 8:41 pm
No new posts EBCDIC to ASCII conversion using OCOPY mistah kurtz All Other Mainframe Topics 5 Tue Sep 06, 2016 2:26 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us