How do you download a flat file from Mainframe to your
local PC using SAS?
Answers were Sorted based on User's Feedback
Answer / sastechies
I would use FileName FTP statement...
FILENAME FILE2 FTP 'PDSNAME' HOST='host'
CD= "'dir'"
user='user'
pass='pass'
lrecl=256
debug;
data _NULL_;
infile FILE2 lrecl=26095;
file "file.txt" lrecl=3000 pad;
input;
put _infile_;
run;
Any other method....
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / poojavaibhav
A "flat file" is a plain text or mixed text and binary file which usually contains one record per line[2] or 'physical' record (example on disc or tape). Within such a record, the single fields can be separated by delimiters, e.g. commas, or have a fixed length. In the latter case, padding may be needed to achieve this length. Extra formatting may be needed to avoid delimiter collision. There are no structural relationships between the records.
You can use Import wizard or import procedure or infile statement to create sas dataset and then use file statement to write file in log.
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / paul
A flat file from mainframes generally have data values assigned with the variable names.
eg: cards;
name=XXX Age=XX Gender=XXXX
name=XXX Age=XX Gender=XXXX
name=XXX Age=XX Gender=XXXX
name=XXX Age=XX Gender=XXXX
;
so to read such data into SAS we simply use named input method.
data flat;
infile 'flatfile.csv';
input var1= $ var2= var3= :ddmmyy10. var4= ;
run;
/*here i specified var1 as char, var3 with date informat
rest are numeric vars */
Is This Answer Correct ? | 0 Yes | 0 No |
what is Global Symbol table and Local symbol table?
The below code we are using for creating more than one macro variables in proc sql using into clause. How we can use same code to create macro variables vara, varb, varc instead of var1, var2, var3.? proc sql noprint; select count(distinct(patient)) into :var1 - :var3 from dataset1 group by trtreg1c ; quit;
What is the Program Data Vector (PDV)? What are its functions?
In the SAS Data step what is the difference between the subsetting done by Where and subsetting done by If?
Which is Best Institute for learning SAS BASE & SAS BI in Hyderabad? Can anyone suggest me ?
If reading an external file to produce an external file, what is the shortcut to write that record without coding every single variable on the record?
How would you define the end of a macro? : sas-macro
Which statement does not perform automatic conversions in comparisons?
What is SAS Information Map Studio and its purpose ?
what is ae onset date n what is RDS
is there any difference between proc summary and proc means?
how do you debug and test your sas programs? : Sas programming