10-31-2017 10:05 AM
My objective is to upload from local drive multiple .txt files to an already allocated mainframe file. My problem is finding correct syntax to point at more than one .txt file in the infile statement.
My txt files are identified as:
FILENAME exp1 "C:\&filenm.\201601_201601_US0001_us01.txt" LRECL=375;
FILENAME exp2 "C:\&filenm.\201602_201602_US0001_us01.txt" LRECL=375;
FILENAME exp3 "C:\&filenm.\201603_201603_US0001_us01.txt" LRECL=375;
My infile statement (after signon) is below:
options comamid=TCP remote=mvsnode.SPAWNER autosignon=YES;
FILENAME IMP1 "PIR5.GGDATA.PREMIUM.recon6.US01.Q116";
Proc Upload infile=EXP1, exp2, exp3 /*THIS IS NOT WORKING*/
10-31-2017 10:14 AM - edited 11-02-2017 08:57 AM
Erroneus post deleted. While the overview of the proc upload procedure specifically mentions only "SAS Files", the proc upload statement documentation has the parts for external files.
11-02-2017 08:48 AM
Do you want to concatenate the three files into one file on the mainframe, or do you want to upload the three files as members in a partitioned dataset?
In the first case you will have to concatenate the three files first:
filename temp temp; data _null_; file temp; infile exp1 eof=file2; if 0 then do; file2: infile exp2 eof=file3; end; if 0 then do; file3: infile exp3 eof=file3; end; input; put _infile_; run; rsubmit; filename imp1 "pir5.etc...."; proc upload infile=temp outfile=imp1;run; endrsubmit;
In the other case you will have to run a separate proc upload for each file, as the filenames are too long to be used as member names in a partitioned dataset:
rsubmit; proc upload infile=exp1 outfile=imp1(EXP1);run; proc upload infile=exp2 outfile=imp1(EXP2);run; proc upload infile=exp3 outfile=imp1(EXP3);run;
11-02-2017 08:57 AM
I want upload multiple text files into one mainframe dataset (not partitioned into members). In a previous response, someone said I cannot upload text files. They must be sas files but I know someone in my group who has used proc upload to upload a text file to the mainframe.
Do you know if proc upload can support multiple text files in the infile statement?
11-02-2017 09:08 AM
I corrected my previous post.
But look at this (from the proc upload doc):
So you should be able to use wildcards for files in a directory accessed through a filename reference. If that is not possible, you need to do the transfer one file at a time. Aggregate file references are not allowed.