Problem with x command

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 15
Accepted Solution

Problem with x command

The below command is not working properly.

 

x " tac &archivefile. | awk '!NF {print ""};NF {if (n) {print} else {n=1}}' | tac >  &rawfile. ";

 

Ideally it should create a &rawfile with some lines,ignoring last non empty line from archive file.

 

But it is creating just an empty &rawfile.

 

There is no problem with the linux command,it is worling fine in linux .

The comand is shown below after resolving the macro variables.

 

$ tac APPDIRECT_PROD_2018011107.dat | awk '!NF {print ""};NF {if (n) {print} else {n=1}}' | tac > /vfau/vfau_sit/sit05/datain/AppDirect/Landing/APPDIRECT_PROD_2018011107.dat

 

What exactly the problem with my x command ?

 


Accepted Solutions
Solution
‎01-24-2018 01:42 AM
Super User
Posts: 9,886

Re: Problem with x command

Posted in reply to swathiprasad

Add

2>&1

to the end of your command, and you'll find any eventual error message(s) in your .dat file.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code

View solution in original post


All Replies
Solution
‎01-24-2018 01:42 AM
Super User
Posts: 9,886

Re: Problem with x command

Posted in reply to swathiprasad

Add

2>&1

to the end of your command, and you'll find any eventual error message(s) in your .dat file.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Occasional Contributor
Posts: 15

Re: Problem with x command

Posted in reply to KurtBremser
Thank you sir!!
Super User
Posts: 9,886

Re: Problem with x command

Posted in reply to swathiprasad

Hi!

 

Glad I could be of help.

What did you find?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 129 views
  • 1 like
  • 2 in conversation