BookmarkSubscribeRSS Feed
Marilyn
Calcite | Level 5
Can anyone tell me if there is any way to read mainframe tape files with PC SAS?
5 REPLIES 5
deleted_user
Not applicable
We had PCs and Unix servers at a client site, and received our data from an external source on mainframe cartridges. By mounting the cartridge reader to one of the Unix servers, we could retrieve the mainframe files, and unload the files.

To do this yourself you'll need suitable hardware, and then make sure that you handle the character set conversion from EBCDIC to ASCII in some manner. We did it manually by reading the file in blocks through SAS, but that was because of specialist needs with our data at the time. You may not have the same need and could use a more direct way to read the files.

Configuration is very specific to your site and hardware, and may require more interactive assistance than can be provided on this forum. A call to Tech Support is strongly recommended.

Kind regards

David
advoss
Quartz | Level 8
You might also be able to read the file using the FILENAME FTP ENGINE to your MVS/zOS site.. Depending upon site setup, the FTP ENGINE may allow tape mounts. Then of course you must deal with the things like packed decimal numbers which EBCDIC to ASCII conversion will mess up.
JohnH
Fluorite | Level 6
Here is my batch program code which I create in Enterprise guide:

----------------------------------------------------------------------------------------
//$xxxxSAS JOB (12340000,T123,,ALK,,OPE-19),xxxxJCH,
// CLASS=T,MSGCLASS=Q,MSGLEVEL=(1,1),REGION=2M,NOTIFY=$xxxx
//*MAIN SYSTEM=(SYxx)
//S1 EXEC SAS9
//*IN DD DSN=xxxxxx.xxxx.xxxxxxx.xxx.xxxxx,DISP=OLD
//WORK DD SPACE=(6160,(9000,9000),,,ROUND)

/* */
OPTIONS OBS=10000;
filename outbox email
to='john.c.hennessey@ssa.gov'
subject='John Test'
attach=(
"xxx.xxxxxxxx.outpdf" type='image/gif' extension='rtf'
"xxx.xxxxxxxx.tran" type='text/plain' extension='txt');
filename outlog 'ais.p2222jch.tran';
proc printto log=outlog new; run;
*ods listing close;
filename outpdf 'ais.p2222jch.outpdf';
*ods listing close;
*ods pdf file=outpdf style=Styles.printer;
ods rtf file=outpdf style=Styles.printer trantab=ascii;
title 'My Sample Title';
footnote 'My Sample Footnote';
/***************************
*** SAS Code Here ***
**************************/
proc tabulate data=sashelp.class;
class sex age;
table age, sex ;
run;
/****************************
*** End SAS Code Here ***
*****************************/
ods rtf close;
*ods pdf close;
ods listing;
proc printto;run;
data _null_;
file outbox;
put 'John,';
put 'These are my SAS log and output files.';
run;
filename outlog clear;
filename outpdf clear;
------------------------------------------------------------------------------------

Note that it emails me my results and output. Here is my code which I run in Enterprise Guide to ftp the batch program to the mainframe batch queue. Come & see my presentation of Enterprise Guide & SAS/Connect on the mainframe at the SAS Global Forum in San Antonio

----------------------------------------------------------------------
/**********************************************************************
** This is the upload/submit code. I found that the filename path had to be on one unwrapped line **
** in order to work. I also had to assign and associate the ID and PASSWORD through the Parameter Manager. **
************************************************************************/

/**************************************************
* Replace with path to the batch program you want to submit **
**************************************************/
filename bprog 'S:\xxxx\xxxxxxxxxx\xxxxxxxxxxxx.sas';

%let sy56=xxxx.xxxx.xxx.xxx;
OPTIONS NOSOURCE2;

/***********************************************************************
* Make sure that you add the ID and PASSWORD parameters(macro variables) to this window *
***********************************************************************/

SIGNON SY56.SPAWNER USER="&ID" PASSWORD="&PASSWORD";

/*******************************************************
** DON'T TOUCH THIS CODE AT ALL **
*******************************************************/

FILENAME OUTJOB FTP '.X' HOST='xxxx.xxxx.xxx.xxx'
USER="&ID" PASS="&PASSWORD" RCMD='SITE FILE=JES';

DATA _NULL_;
FILE OUTJOB;
INFILE BPROG;
INPUT;
PUT _INFILE_;
RUN;

SIGNOFF;
---------------------------------------------------------------------------------------------------
Doc_Duke
Rhodochrosite | Level 12
Another possibility not already mentioned. If you have the physical tapes and no access to a mainframe, you can purchase a mainframe tape drive and attach it to a PC (usually with a SCSI Adapter).

Some of them come with software to convert from EBCDIC text to ASCII text. You may even find some software that will allow you to tell the record format so you can unscramble the packed decimal code.

Depending on the number of tapes, it may be simpler (and cheaper) to have a contract service do the conversion.
deleted_user
Not applicable
I did mention it Doc, where we mounted the tape reader to a Unix machine.

We had sufficient throughput of mainframe tapes to want our own solution, and this worked well, using SCSI as you say.

Doing a standard read was a problem because the record data was variable length and included columns where a series of options on the record were binary encoded to a composite value.

These values sometimes included an end of record or end of line marker, so the tapes were read in fixed blocks and translated using SAS. It was an efficient process when it was finally retired in favour of ftp data.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Health and Life Sciences Learning

 

Need courses to help you with SAS Life Sciences Analytics Framework, SAS Health Cohort Builder, or other topics? Check out the Health and Life Sciences learning path for all of the offerings.

LEARN MORE

Discussion stats
  • 5 replies
  • 2095 views
  • 0 likes
  • 5 in conversation