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 |
Have you ever used the SAS Debugger?
What procedure you used to calculate p-value?
2 Answers Accenture, Quintiles,
In ARRAY processing, what does the DIM function do?
Name statements that are recognized at compile time only?
what is sas metadata repository? : Sas-bi
Name statements that are recognized at compile time only?
How would you code a merge that will write the matches of both to one data set, the non-matches from the left-most data?
What is SAS? What are the functions does it performs?
There is a field containing a date. It needs to be displayed in the format “ddmonyy” if it’s before 1975,”dd mon ccyy” if it’s after 1985, and as ‘disco years’ if its between 1975 and 1985. How would you accomplish this in data step code? Using only PROC FORMAT.
Which are the statements whose placement in the data step is critical?
How do you add a number to a macro variable?
How do you generate random samples?