BookmarkSubscribeRSS Feed
sfffdg
Obsidian | Level 7

Hi ,

 

i am trying to get last non blank record from an external file.

 

I tried with 

 

filename ocmd pipe "awk '/./{line=$0} END{print line}' /vfau/vfau_sit/sit05/datain/AppDirect/Landing/APPDIRECT_PROD_2018011105.dat"

 

and 


filename ocmd pipe "tac /vfau/vfau_sit/sit05/datain/AppDirect/Landing/APPDIRECT_PROD_2018011105.dat | egrep -m 1 ."

 

 

But our company has no Goptions accesible..and i am getting error like

 

ERROR 23-2: Invalid option name GOPTIONS.

25 ! GOPTIONS NOACCESSIBLE;
____________
23
ERROR: Error in the FILENAME statement.
ERROR 23-2: Invalid option name NOACCESSIBLE.

 

 

Is there any other approach?

5 REPLIES 5
sfffdg
Obsidian | Level 7

It is like reading XXXXX from the below file.

 

ADJJSHJBSJJAJS

SJHDBSJSJJSJ

XXXXX

<Blankrecord>

<Blankrecord>

 

 

 

BrunoMueller
SAS Super FREQ

All SAS statements end with a semicolon ";"

 

you are missing this

sfffdg
Obsidian | Level 7
With semicolon only am getting the error as our company does not have access to goptions
BrunoMueller
SAS Super FREQ
I guess you are running this with SAS Enteprise Guide as the front end.

Please post the complete log as attachment or as a code block (the {} symbol in the editor)
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Goptions has nothing to do with the code you are running - which is a command line command which you do need access for.  You can turn goptions off to get rid of this error:

https://communities.sas.com/t5/SAS-Enterprise-Guide/Turning-off-goptions-in-SAS-EG-code-node/td-p/13...

 

And docs:

http://support.sas.com/documentation/cdl/en/graphref/63022/HTML/default/viewer.htm#goptionschap.htm

 

However that will not solve your connection to the OS which may be turned off by default by your IT group - this is often the case.

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