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 |
How would you code a merge that will keep only the observations that have matches from both sets?
where will go the observations that were deleted by delete statement?
What are the advantages of using sas?
what is the use of proc contents and proc print in sas? : Sas-administrator
data study; input Subj : $3. Group : $1. Dose : $4. Weight : $8. Subgroup; x= input(Weight,5.1); datalines; 001 A Low 220 2 002 A High 90 1 003 B Low 193.6 1 004 B High 165 2 005 A Low 123.4 1 ; Why does X get truncated? X shows up as 22 instead of 220,9 instead of 90 and 19.8 instead of 198? This problem doesnt happen with the values 193.6 and 123.4. This does not happen if x is read on the 5. informat instead of the 5.1 informat
what are the types of interactive display types? : Sas-bi
if we dont want to print output what we have to do..???give syntax..???
8 Answers Accenture, GSK GlaxoSmithKline,
If you’re not wanting any SAS output from a data step, how would you code the data statement to prevent SAS from producing a set?
how do we get duplicate observations in a separate dataset?
how will you location sas platform applications available from web browser? : Sas-bi
what is study design in while working with SAS? what are screening variables in SAS?
what is slowly changing dimension? : Sas-di