1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

SASテクニック 変数ラベルとフォーマットをリセット

Last updated at Posted at 2020-06-16

SASデータセットの変数ラベルとフォーマットを削除するプログラム

datasetsプロシジャ

proc Datasets lib = ライブラリ名 nolist;
  modify データセット名 ;
  attrib _ALL_ label = "" format = informat = ;
quit;

変数情報などだけ読み込むため、重いデータでも速い
format = フォーマット名 でformatを指定するが、nullのためformatを削除(informatも同様)
formatとinformatがイコールってことではない

data ステップ

data 出力データセット名 ;
  set 入力データセット名 ;

  format _ALL_;
  informat _ALL_;
  attrib _ALL_ label = "" ;
run;

setの前にformat等書いてしまうと、
入力データセットの変数情報で上書きされてしまうためformatなどが消せない
何かの処理をしつつformat等をリセットするならこっちのほうがいいかも

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?