cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
%3CLINGO-SUB%20id%3D%22lingo-sub-8044%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E3%83%AA%E3%82%B9%E3%83%88%E3%81%8C%E7%A9%BA%E3%81%8B%E3%81%A9%E3%81%86%E3%81%8B%E3%82%92%E7%A2%BA%E8%AA%8D%E3%81%99%E3%82%8B%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-8044%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CP%3E%E3%82%84%E3%81%82%E3%80%81%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%E3%81%93%E3%82%8C%E3%81%AF%E7%B0%A1%E5%8D%98%E3%81%AB%E7%AD%94%E3%81%88%E3%82%89%E3%82%8C%E3%82%8B%E8%B3%AA%E5%95%8F%E3%81%8B%E3%82%82%E3%81%97%E3%82%8C%E3%81%BE%E3%81%9B%E3%82%93%E3%81%8C%E3%80%81%E7%A7%81%E3%81%8C%E3%82%84%E3%82%8D%E3%81%86%E3%81%A8%E3%81%97%E3%81%A6%E3%81%84%E3%82%8B%E3%81%AE%E3%81%AF%E3%80%81JMP%20%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E7%89%B9%E5%AE%9A%E3%81%AE%E3%83%87%E3%82%A3%E3%83%AC%E3%82%AF%E3%83%88%E3%83%AA%E5%86%85%E3%81%AB%E5%90%AB%E3%81%BE%E3%82%8C%E3%82%8B%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AE%E6%95%B0%E3%82%92%E6%95%B0%E3%81%88%E3%80%81%E5%AD%98%E5%9C%A8%E3%81%97%E3%81%AA%E3%81%84%E5%A0%B4%E5%90%88%E3%81%AF%200%20%E3%81%AE%E5%80%A4%E3%82%92%E8%BF%94%E3%81%99%E3%81%8B%E3%80%81%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AE%E6%95%B0%E3%82%92%E8%BF%94%E3%81%99%E3%81%93%E3%81%A8%E3%81%A7%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%E3%83%87%E3%82%A3%E3%83%AC%E3%82%AF%E3%83%88%E3%83%AA%E5%86%85%E3%81%AE%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E6%A9%9F%E8%83%BD%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%99%E3%82%8B%E3%81%A8%E3%80%81%E5%90%AB%E3%81%BE%E3%82%8C%E3%82%8B%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%8C%E3%83%AA%E3%82%B9%E3%83%88%E3%81%A8%E3%81%97%E3%81%A6%E8%A1%A8%E7%A4%BA%E3%81%95%E3%82%8C%E3%82%8B%E3%81%93%E3%81%A8%E3%81%AF%E3%82%8F%E3%81%8B%E3%81%A3%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%81%8C%E3%80%81%E7%A7%81%E3%81%8C%E3%82%84%E3%82%8A%E3%81%9F%E3%81%84%E3%81%AE%E3%81%AF%E3%80%81%E3%81%93%E3%82%8C%E3%82%92%E6%95%B0%E5%80%A4%E3%81%AB%E5%A4%89%E6%8F%9B%E3%81%99%E3%82%8B%E3%81%93%E3%81%A8%E3%81%A7%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%E3%81%A4%E3%81%BE%E3%82%8A%3A%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CPRE%20__jive_macro_name%3D%22quote%22%20class%3D%22jive_text_macro%20jive_macro_quote%22%20modifiedtitle%3D%22true%22%3E%3CBR%20%2F%3E%3CP%3E%2F%2Fset%20up%20raw%20dir%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Eraw_dir%20%3D%20%22C%3A%5C%5CMy%20PhotoFilmStrips%5C%22%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E_files%20%3D%20Files%20In%20Directory(%20raw_dir%20)%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%2F%2Fshow%20files%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Eshow(_files)%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3Eshow(%20Type(_files)%2C%20Is%20Empty(_files)%2C%20Is%20Missing(_files)%2C%20_files%3D%3DEmpty())%3B%3C%2FP%3E%3CBR%20%2F%3E%3C%2FPRE%3E%3CP%3E%E4%B8%8A%E8%A8%98%E3%81%AE%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%97%E3%83%88%E3%82%92%E5%AE%9F%E8%A1%8C%E3%81%99%E3%82%8B%E3%81%A8%E3%80%81raw%20%E3%83%87%E3%82%A3%E3%83%AC%E3%82%AF%E3%83%88%E3%83%AA%E5%86%85%E3%81%AB%E5%90%AB%E3%81%BE%E3%82%8C%E3%82%8B%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%A7%E6%AC%A1%E3%81%AE%E7%B5%90%E6%9E%9C%E3%81%8C%E5%BE%97%E3%82%89%E3%82%8C%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EType(_files)%20%3D%20%22%E3%83%AA%E3%82%B9%E3%83%88%22%3B%3C%2FP%3E%3CP%3E%E7%A9%BA(_files)%20%3D%200%3B%3C%2FP%3E%3CP%3E(_files)%20%3D%20%7B0%7D%3B%20%E3%81%8C%E8%A6%8B%E3%81%A4%E3%81%8B%E3%82%8A%E3%81%BE%E3%81%9B%E3%82%93%E3%80%82%3C%2FP%3E%3CP%3E_files%20%3D%3D%20%E7%A9%BA()%20%3D%200%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%E3%83%87%E3%82%A3%E3%83%AC%E3%82%AF%E3%83%88%E3%83%AA%E3%81%8C%E7%A9%BA%E3%81%AE%E5%A0%B4%E5%90%88%E3%80%81%E6%AC%A1%E3%81%AE%E7%B5%90%E6%9E%9C%E3%81%8C%E5%BE%97%E3%82%89%E3%82%8C%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EType(_files)%20%3D%20%22%E6%95%B0%E5%80%A4%22%3B%3C%2FP%3E%3CP%3E%E7%A9%BA(_files)%20%3D%200%3B%3C%2FP%3E%3CP%3E%E6%AC%A0%E8%90%BD%E3%81%97%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99(_files)%20%3D%201%3B%3C%2FP%3E%3CP%3E_files%20%3D%3D%20%E7%A9%BA()%20%3D%20.%3B%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EIs%20Missing%20%E5%A4%89%E6%95%B0%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%99%E3%82%8B%E3%81%AB%E3%81%AF%E3%81%A9%E3%81%86%E3%81%99%E3%82%8C%E3%81%B0%E3%82%88%E3%81%84%E3%81%A7%E3%81%99%E3%81%8B%20-%20%E3%81%A4%E3%81%BE%E3%82%8A%E3%80%811%20%E3%81%AE%E5%A0%B4%E5%90%88%E3%81%AF%20tt%3D0%20%E3%81%AE%E3%82%88%E3%81%86%E3%81%AA%E5%A4%89%E6%95%B0%E3%81%AB%E6%95%B0%E5%80%A4%E3%82%92%E5%89%B2%E3%82%8A%E5%BD%93%E3%81%A6%E3%80%81Is%20Missing%20%E5%A4%89%E6%95%B0%E3%81%8C%200%20%E3%81%AE%E5%A0%B4%E5%90%88%E3%81%AF%20tt%3D1%20%E3%81%AE%E3%82%88%E3%81%86%E3%81%AB%E5%A4%89%E6%95%B0%E3%82%92%E5%89%B2%E3%82%8A%E5%BD%93%E3%81%A6%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%E5%8A%A9%E3%81%91%E3%81%A6%E3%81%84%E3%81%9F%E3%81%A0%E3%81%91%E3%82%8C%E3%81%B0%E5%B9%B8%E3%81%84%E3%81%A7%E3%81%99%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ERGDS%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%E3%82%B3%E3%83%AA%E3%83%B3%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-8046%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20%E3%83%AA%E3%82%B9%E3%83%88%E3%81%8C%E7%A9%BA%E3%81%8B%E3%81%A9%E3%81%86%E3%81%8B%E3%82%92%E7%A2%BA%E8%AA%8D%E3%81%99%E3%82%8B%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-8046%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%3CEM%3E%E4%B8%8D%E8%B6%B3%E3%81%97%E3%81%A6%E3%81%84%E3%82%8B%EF%BC%88%EF%BC%89%3C%2FEM%3E%E7%A9%BA%E3%81%AE%E3%83%AA%E3%82%B9%E3%83%88%E3%81%A7%E3%81%AF%E3%80%81%E3%83%AA%E3%82%B9%E3%83%88%E3%81%AE%E5%90%84%E8%A6%81%E7%B4%A0%E3%82%92%E6%93%8D%E4%BD%9C%E3%81%99%E3%82%8B%E3%81%9F%E3%82%81%E3%80%81%E7%A9%BA%E3%81%AE%E3%83%AA%E3%82%B9%E3%83%88%E3%81%8C%E8%BF%94%E3%81%95%E3%82%8C%E3%81%BE%E3%81%99%E3%80%82%E3%83%AA%E3%82%B9%E3%83%88%E3%81%8C%E7%A9%BA%E3%81%AE%E5%A0%B4%E5%90%88%E3%80%81%E8%A6%81%E7%B4%A0%E3%81%AF%E3%81%82%E3%82%8A%E3%81%BE%E3%81%9B%E3%82%93%E3%80%82%3CEM%3E%E4%B8%8D%E8%B6%B3%E3%81%97%E3%81%A6%E3%81%84%E3%82%8B%EF%BC%88%EF%BC%89%3C%2FEM%3E%E6%93%8D%E4%BD%9C%E3%81%99%E3%82%8B%E3%81%9F%E3%82%81%E3%80%81%E7%A9%BA%E3%81%AE%E3%83%AA%E3%82%B9%E3%83%88%E3%81%8C%E8%BF%94%E3%81%95%E3%82%8C%E3%81%BE%E3%81%99%E3%80%82%E3%81%9F%E3%81%A0%E3%81%97%E3%80%81%E3%81%93%E3%82%8C%E3%82%92%E3%82%88%E3%82%8A%E3%82%88%E3%81%8F%E7%90%86%E8%A7%A3%E3%81%99%E3%82%8B%E3%81%AB%E3%81%AF%E3%80%81%E6%AC%A1%E3%81%AE%E4%BE%8B%E3%82%92%E8%A6%8B%E3%81%A6%E3%81%8F%E3%81%A0%E3%81%95%E3%81%84%E3%80%82%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3Elst%20%3D%20%7B1%2C2%2C.%2C%22%22%7D%3B%3C%2FP%3E%3CP%3E%E6%AC%A0%E8%90%BD%E3%81%97%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99(lst)%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-8045%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20%E3%83%AA%E3%82%B9%E3%83%88%E3%81%8C%E7%A9%BA%E3%81%8B%E3%81%A9%E3%81%86%E3%81%8B%E3%82%92%E7%A2%BA%E8%AA%8D%E3%81%99%E3%82%8B%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-8045%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EJMP%2010%E3%81%8A%E3%82%88%E3%81%B311%E3%81%A7%E3%81%AF%E3%80%81%E7%A9%BA%E3%81%AE%E3%83%87%E3%82%A3%E3%83%AC%E3%82%AF%E3%83%88%E3%83%AA%E3%81%AF%E6%AC%A0%E6%90%8D%E5%80%A4%E3%81%A7%E3%81%AF%E3%81%AA%E3%81%8F%E7%A9%BA%E3%81%AE%E3%83%AA%E3%82%B9%E3%83%88%E3%82%92%E4%B8%8E%E3%81%88%E3%82%8B%E3%81%AE%E3%81%A7%E3%80%81%E7%A7%81%E3%81%AF%E6%9C%9F%E5%BE%85%E3%81%97%E3%81%BE%E3%81%99%3CEM%3E%E4%B8%8D%E8%B6%B3%E3%81%97%E3%81%A6%E3%81%84%E3%82%8B%EF%BC%88%EF%BC%89%3C%2FEM%3E%200%E3%82%92%E8%BF%94%E3%81%99%E3%80%82%20%E5%A5%87%E5%A6%99%E3%81%AA%E3%81%93%E3%81%A8%E3%81%AB%E3%80%81%E7%A9%BA%E3%81%AE%E3%83%AA%E3%82%B9%E3%83%88%E3%81%AB%E9%81%A9%E7%94%A8%E3%81%99%E3%82%8B%E3%81%A8%E3%80%81%3CEM%3E%E4%B8%8D%E8%B6%B3%E3%81%97%E3%81%A6%E3%81%84%E3%82%8B%EF%BC%88%EF%BC%89%3C%2FEM%3E%E3%83%96%E3%83%BC%E3%83%AB%E9%96%A2%E6%95%B0%E3%81%8B%E3%82%89%E6%9C%9F%E5%BE%85%E3%81%95%E3%82%8C%E3%82%8B%E5%87%BA%E5%8A%9B%E3%81%A7%E3%81%82%E3%82%8B%200%20%E3%81%BE%E3%81%9F%E3%81%AF%201%20%E3%81%A7%E3%81%AF%E3%81%AA%E3%81%8F%E3%80%81%E7%A9%BA%E3%81%AE%E3%83%AA%E3%82%B9%E3%83%88%E3%82%92%E8%BF%94%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%20JMP%209%20%E3%81%A7%E3%81%A9%E3%81%AE%E3%82%88%E3%81%86%E3%81%AB%E5%8B%95%E4%BD%9C%E3%81%99%E3%82%8B%E3%81%8B%E3%81%AF%E3%82%8F%E3%81%8B%E3%82%8A%E3%81%BE%E3%81%9B%E3%82%93%E3%80%82%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%20line-height%3A%201.5em%3B%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22line-height%3A%201.5em%3B%20font-size%3A%2010pt%3B%22%3E%E4%BD%BF%E7%94%A8%E3%81%99%E3%82%8B%E3%81%93%E3%81%A8%E3%82%92%E3%81%8A%E5%8B%A7%E3%82%81%E3%81%97%E3%81%BE%E3%81%99%3C%2FSPAN%3E%E4%BB%A3%E3%82%8F%E3%82%8A%E3%81%AB%20N%20Items()%3CSPAN%20style%3D%22line-height%3A%2019px%3B%20font-size%3A%2010pt%3B%22%3E%20%E3%80%82%20%E4%BE%8B%E3%81%88%E3%81%B0%EF%BC%9A%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22font-size%3A%2014px%3B%20font-family%3A%20Courier%3B%22%3E%E3%81%A3%E3%81%A6%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3D%3C%2FSPAN%3E%3CSTRONG%3E%20(%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3E%E3%83%8A%E3%82%A4%E3%82%A2%E3%82%A4%E3%83%86%E3%83%A0%3C%2FSPAN%3E%3CSTRONG%3E(%3C%2FSTRONG%3E%20_%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%3CSTRONG%3E)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%20%26gt%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E%200%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSTRONG%3E%20)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%20%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%E4%BD%BF%E7%94%A8%E3%81%99%E3%82%8B%E5%A0%B4%E5%90%88%3CEM%3E%E4%B8%8D%E8%B6%B3%E3%81%97%E3%81%A6%E3%81%84%E3%82%8B%EF%BC%88%EF%BC%89%3C%2FEM%3E%20NOT%20%E6%BC%94%E7%AE%97%E5%AD%90%E3%80%81%E3%81%A4%E3%81%BE%E3%82%8A%20!Is%20Missing()%20%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%200%20%E3%81%A8%201%20%E3%82%92%E5%88%87%E3%82%8A%E6%9B%BF%E3%81%88%E3%82%8B%E3%81%93%E3%81%A8%E3%81%8C%E3%81%A7%E3%81%8D%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
lodey101
Level II

Check to see if a list is empty

Hi there,

     This may be an easy question to answer but what I am trying to do is use JMP  to count the number of files contained within a specific directory and return a value of either 0 if none exist or the number of files.

I know that using the Files In Directory function will list the files contained as a list but what I want to do is convert this to a numerical value:

ie:


//set up raw dir


raw_dir = "C:\\My PhotoFilmStrips\";


_files = Files In Directory( raw_dir );



//show files


show(_files);



show( Type(_files), Is Empty(_files), Is Missing(_files), _files==Empty());


If I run the above script i get the following with a file contained within the raw directory:

Type(_files) = "List";

Is Empty(_files) = 0;

Is Missing(_files) = {0};

_files == Empty() = 0;

When the directory is empty I get:

Type(_files) = "Number";

Is Empty(_files) = 0;

Is Missing(_files) = 1;

_files == Empty() = .;

How can I make use of the Is Missing variable - ie if it is 1 then assign the number to a variable like tt=0 and when it the Is Missing variable is 0 then tt=1

Any help would be appreciated

Rgds

Colin

1 ACCEPTED SOLUTION

Accepted Solutions
ms
Super User (Alumni) ms
Super User (Alumni)

Re: Check to see if a list is empty

In JMP 10 and 11 an empty directory gives an empty list, not a missing value and I would thus expect Is Missing() to return 0. Strangely, If applied to an empty list Is Missing() returns an empty list, not 0 or 1 that is the expected output from a boolean function. I am not sure how it works in JMP 9.


I suggest you use N Items() instead. For example:

tt=(nitems(_files)>0);

If using Is Missing() you can switch between 0 and 1 with the NOT operator, i.e. !Is Missing()

View solution in original post

2 REPLIES 2
ms
Super User (Alumni) ms
Super User (Alumni)

Re: Check to see if a list is empty

In JMP 10 and 11 an empty directory gives an empty list, not a missing value and I would thus expect Is Missing() to return 0. Strangely, If applied to an empty list Is Missing() returns an empty list, not 0 or 1 that is the expected output from a boolean function. I am not sure how it works in JMP 9.


I suggest you use N Items() instead. For example:

tt=(nitems(_files)>0);

If using Is Missing() you can switch between 0 and 1 with the NOT operator, i.e. !Is Missing()

Re: Check to see if a list is empty

Is Missing() on an empty list will return an empty list, because it is operating on each element of a list.  If the list is empty, there are no elements for Is Missing() to operate on, so it returns the empty list.  However, a better way to see this is the following example:

lst = {1,2,.,""};

ismissing(lst);

Michael Crotty
Principal Statistical Writer
Manager, Statistical Documentation
JMP Development

Recommended Articles