DATA Step, Macro, Functions and more

Read flat files on tape (MVS*)

Posts: 0

Read flat files on tape (MVS*)

How do you read flat files on tape within the PC-SAS environment?

I've found out that you can add "tape", as engine, to the libname statement but is that all. Maybe that only applies to existing SAS datasets, not flat files?

Posts: 8,743

Re: Read flat files on tape (MVS*)

Partly the type of syntax you use will depend on how you are reading the "flat file" from tape -- what operating system has the tape drive physically attached. Was the tape created on the mainframe or on Unix? Is the tape file really a flat/sequential file or a VSAM file or a SAS transport file? You indicated that you were reading flat files. It is possible to read flat files or "raw data" stored on tape with SAS.

Here is an example of reading a tape file on UNIX:
(I only found doc on the TAPE engine for Open VMS, not Windows)
And here are some other notes:

If you're going to be using a tape device attached to an MVS system, you might need to use SAS/Connect to set up your PC code to run on the MVS system so the tape can be mounted and read. Or, use techniques similar to those described here: to read the tape file.

This may be a question best answered by Tech Support, as they can help you with the correct syntax for your particular configuration, operating system, location of tape drive and type of file.

Super Contributor
Super Contributor
Posts: 3,174

Re: Read flat files on tape (MVS*)

If not mentioned in the links provided by Cynthia, the SAS FILENAME FTP engine is a possibility to read data directly from z/OS MVS operating system, however you will need to have an FTP privilege to mount a tape defined for your remote host system.

Also, considerations must be made for the DCB attributes as well for the remote host file type you are reading -- not an issue if straight F/FB/V/VB though.

Scott Barry
SBBWorks, Inc.
Posts: 0

Re: Read flat files on tape (MVS*)

Don't forget that MVS uses the EBCDIC character set instead of ASCII, so text fields will need translating before you can see them correctly on the PC. FTP gives you the option to do this, but there may be complexities if you have a mixture of text and binary.
Ask a Question
Discussion stats
  • 3 replies
  • 3 in conversation