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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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