DATA Step, Macro, Functions and more

download and exclude special format

Accepted Solution Solved
Reply
Super Contributor
Posts: 267
Accepted Solution

download and exclude special format

Hello everyone,

 

I am going to download a whole library of formats but want to exclude one from those format. what should I do?

 

the name of the format i want to exclude from download is $badformat.

 

proc download incat=Lib1.formats outcat=Lib2.formats
    connectstatus=no;

  /*ToDo:  add some code here to exclude $badformat. */



run;

Thank you very much!

 


Accepted Solutions
Solution
‎02-15-2018 06:32 PM
Occasional Learner
Posts: 1

Re: download and exclude special format

[ Edited ]
Posted in reply to GeorgeSAS

 

proc download incat=Lib1.formats outcat=Lib2.formats
    connectstatus=no;

  /*ToDo:  add some code here to exclude $badformat. */

exclude badformat/ENTRYTYPE=etype;

run;

 

proc download incat=Lib1.formats outcat=Lib2.formats
    connectstatus=no;

  /*ToDo:  add some code here to exclude $badformat. */

exclude format_A format_B format_C/ENTRYTYPE=format;
exclude formatc_A formatc_B formatc_C/ENTRYTYPE=formatc;

run;

try this.

 

 

I add some changes, can exclude both format or formatc type ,need to write separately. see the new lines of codes

View solution in original post


All Replies
Super User
Posts: 6,638

Re: download and exclude special format

Posted in reply to GeorgeSAS

The EXCLUDE statement allows you to list those members you do not want to download:

 

http://documentation.sas.com/?docsetId=connref&docsetTarget=n0o0vsabkqk59jn1wseldad5q4ax.htm&docsetV...

 

 

Super Contributor
Posts: 267

Re: download and exclude special format

Posted in reply to Astounding
proc download incat=Lib1.formats outcat=Lib2.formats
    connectstatus=no;

  /*ToDo:  add some code here to exclude $badformat. */

exclude badformat;

run;

ERROR: Missing ENTRYTYPE specification for entry badformat.

Solution
‎02-15-2018 06:32 PM
Occasional Learner
Posts: 1

Re: download and exclude special format

[ Edited ]
Posted in reply to GeorgeSAS

 

proc download incat=Lib1.formats outcat=Lib2.formats
    connectstatus=no;

  /*ToDo:  add some code here to exclude $badformat. */

exclude badformat/ENTRYTYPE=etype;

run;

 

proc download incat=Lib1.formats outcat=Lib2.formats
    connectstatus=no;

  /*ToDo:  add some code here to exclude $badformat. */

exclude format_A format_B format_C/ENTRYTYPE=format;
exclude formatc_A formatc_B formatc_C/ENTRYTYPE=formatc;

run;

try this.

 

 

I add some changes, can exclude both format or formatc type ,need to write separately. see the new lines of codes

Super User
Posts: 6,638

Re: download and exclude special format

[ Edited ]
Posted in reply to GeorgeSAS

The way I read the documentation, SAS is asking for this:

 

exclude badformat / entrytype=format;

 

If that format can't be found, it's possible you would have to use:

 

exclude $badformat / entrytype=format;

 

I can't test it, but that looks like what I'm reading.

 

***** Looks like @stackoverflow got there first ... and is correct that you need the slash before entrytype=

I changed my examples to add the slash.

☑ This topic is solved.

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

Discussion stats
  • 4 replies
  • 158 views
  • 6 likes
  • 3 in conversation