|
View previous topic :: View next topic
|
| Author |
Message |
Charles Wolters
New User
Joined: 30 Mar 2011 Posts: 48 Location: United States
|
|
|
|
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 |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
 |
PeterHolland
Global Moderator

Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
| 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 |
|
 |
PeterHolland
Global Moderator

Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
| 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 |
|
 |
Charles Wolters
New User
Joined: 30 Mar 2011 Posts: 48 Location: United States
|
|
|
|
| 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 |
|
 |
PeterHolland
Global Moderator

Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
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 |
|
 |
Charles Wolters
New User
Joined: 30 Mar 2011 Posts: 48 Location: United States
|
|
|
|
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 |
|
 |
|
|