Help using Base SAS procedures

Reading concatenated MVS datasets from pc-SAS

Reply
Occasional Contributor
Posts: 11

Reading concatenated MVS datasets from pc-SAS

On the mainframe (MVS) I know how to read in multiple datasets using the concatenated DD stmt. Is there something similar for pc-SAS (Windows) when reading MVS datasets using the FILENAME FTP statement?
Super Contributor
Super Contributor
Posts: 3,174

Re: Reading concatenated MVS datasets from pc-SAS

Not that I'm aware of - the ability to concatenate files is within the FILENAME specification and enclosing your quoted files in parentheses. I don't expect that you can open two concurrent FTP connections as a concatenation.

Scott Barry
SBBWorks, Inc.
Occasional Contributor
Posts: 11

Re: Reading concatenated MVS datasets from pc-SAS

Thanks
Valued Guide
Posts: 2,175

Re: Reading concatenated MVS datasets from pc-SAS

don't give up just yet.
The syntax definition allows concatenation within the filename statement.
I just had some success with code like[pre]filename fcont ftp ("'AUP.SREED.ACT.AVP.PETER(H)'"
"'AUP.SREED.ACT.AVP(EXIST)'" )
user= 'your user ID'
prompt /*for password*/
HOST='your hostname'
;
data _null_ ;
length filen $200 ;
infile fcont filename= filen ;
input ;
if filen ne lag(filen) then put filen= ;
put _infile_ ;
run ; [/pre]PeterC
Respected Advisor
Posts: 3,777

Re: Reading concatenated MVS datasets from pc-SAS

The EOV INFILE statement option provides a more general method for concatenation boundary detection. Using changes to the value of FILENAME would not work if the files have the same name by design or accident when FILENAME is defined with improper attributes.

[pre]
filename FT15F001 temp;
parmcards;
Use EOV
1
2
3
4
5
;
run;


filename FT30F001 ("%sysfunc(pathname(ft15f001))" "%sysfunc(pathname(ft15f001))" "%sysfunc(pathname(ft15f001))");
data _null_;
length filename $100;
infile FT30F001 eov=eov filename=filename;
input;
if _n_ eq 1 or EOV then do;
put 'NOTE: ' _n_= filename=;
eov = 0;
end;
run;[/pre]
Occasional Contributor
Posts: 11

Re: Reading concatenated MVS datasets from pc-SAS

Thanks, this works great!
Ask a Question
Discussion stats
  • 5 replies
  • 116 views
  • 0 likes
  • 4 in conversation