I have a file called pmam.static.txt.
normally it was read into sas program with the following lines:
INFILE "&G_IFC_RAW_PENDING_PATH./pmam.static.txt" REFM=N;
if I read it in note pad, it is showing as strange symbols.. which look like this picture showing above and attached...
now my questions is how can I see the content ?
how can I read this in sas? how can I see the content in sas... Could the file actually be a sas data set??
please help thanks.
I suggest you ask the person from whom the file is coming. They should know.
Where did you get the file?
Why do you think it is a text file? What text did you expect to see in it?
Try looking at the file and see what bytes are actually there. The easiest way is to use the LIST statement in a data step.
This step will dump the first 500 bytes to the SAS log for you to look at.
data _null_;
INFILE "&G_IFC_RAW_PENDING_PATH./pmam.static.txt" recfm=f lrecl=100 obs=5;
input;
list;
run;
Since you have a lot of @ characters which hex code of 40 perhaps the text is actually in EBCDIC instead of ASCII. 40 is a space in EBCDIC. Try reading it with $EBCDIC informat and see if it looks more like text.
This will try to read the first 100 bytes from each of the first 5 lines and create a SAS dataset.
data test;
INFILE "&G_IFC_RAW_PENDING_PATH./pmam.static.txt" obs=5 truncover;
line+1;
input text $ebcdic100.;
run;
is the code in the pic above helping to show what format and how I can read it?
seem it says it extract IBM EBCDIC File PMAM STATIC into SAS dataset
data test;
INFILE "&G_IFC_RAW_PENDING_PATH./pmam.static.txt" obs=5 truncover;
line+1;
input text $ebcdic100.;
run;
so if I want to see the first 20 row fully , how do I write? like below?
data test;
INFILE "&G_IFC_RAW_PENDING_PATH./pmam.static.txt" obs=20 truncover;
line+1;
input text $ebcdic100.;
run;
do I need to increase the 100 byte to a higher number?
please advise, thanks.
Why not just run the program you have to read the data file and then review your SAS log? This will indicate whether you have any processing problems or not.
Did the code posted the photograph of not work?
What errors did you get?
Check the following three options .
data test; INFILE "&G_IFC_RAW_PENDING_PATH./pmam.static.txt" truncover encoding='EDBIC' recfm=s370 termstr=nl ;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.