BookmarkSubscribeRSS Feed
Gangi
Obsidian | Level 7

I have file with name as "NBB.YCOT010.MAY25" (semicolon as delimiter) which is output from mainframe,

Please help me how can load it to using code,

 

Note: If I load using Import wizard I can see file taken as below,

INFILE 'C:\Users\Temp\SEG8776\NBB.YCOT010-e5eca727229347ce9dab2e0cbd18c2ea.txt'

 

3 REPLIES 3
Tom
Super User Tom
Super User

No idea what your question is here. 

 

 

If you want to read a semi-colon delimited file you could try asking SAS to try to guess what is in it by using PROC IMPORT.

Or you could just write your own data step to read it.

 

But it also sounds like part of your problem is that you do not know how to find the file? If you want to reference it directly from your SAS code then the file needs to be available on the machine where SAS is running (is is most likely different than the machine you are using to run Enterprise Guide).

 

I assume that you are seeing a different name in the SAS log that what you initially said the filename was because you are using Enterprise Guide.  You might have pointed EG at a copy of the file on the PC where you are running EG and it uploaded a version of the file to the SAS server and ran a data step that EG wrote to read from the file that EG uploaded for you.  

 

 

ChrisNZ
Tourmaline | Level 20

File > Import Data   then choose semicolon as the delimiter.

What's the problem?  Do you have packed decimal or other similarly unusual data to read?

Kurt_Bremser
Super User

If you want to load such a file without the assistance of EG (eg because you want to run the code in batch mode), as a first step you have to make the file available to the context of the SAS session. In the case of a remote server, you either need to store the file to a shared location the server can "see", or upload it to the server with some kind of FTP process.

Then you need to write a data step that can read the file; with mainframe files, caution must be used with regards to numbers in packed decimal or binary format, or possible character set conversions (EBCDIC to ASCII).

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 3 replies
  • 718 views
  • 0 likes
  • 4 in conversation