BookmarkSubscribeRSS Feed
HeatherNewton
Quartz | Level 8

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;image_50417409.JPG

 

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.

 

 

8 REPLIES 8
Tom
Super User Tom
Super User

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;
HeatherNewton
Quartz | Level 8

image_50334721.JPG

 

is the code in the pic above helping to show what format and how I can read it?

HeatherNewton
Quartz | Level 8

seem it says it extract IBM EBCDIC File PMAM STATIC into SAS datasetimage_50353665.JPG

HeatherNewton
Quartz | Level 8
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.

 

SASKiwi
PROC Star

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.

Tom
Super User Tom
Super User

Did the code posted the photograph of not work?

What errors did you get?

Ksharp
Super User

Check the following three options .

 

data test;
   INFILE "&G_IFC_RAW_PENDING_PATH./pmam.static.txt" truncover encoding='EDBIC'  recfm=s370  termstr=nl   ;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 8 replies
  • 1912 views
  • 1 like
  • 5 in conversation