BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SirRolin
Calcite | Level 5

Hi, I have had some mysterious behaviours in SAS,
I have 4 different SAS Codes, that is getting used in a batch run,
Each of them use the same pipe code, but the 3rd and 4th Pipes fail.
I have tried to Clear the name after I am done with the pipes, didn't help.
I tried to make different names for all the pipes, didn't help.
but it is only when run in batch that they fail, if I run them manually they do work. all of them.
Here's the Pipe.
filename FlistCB4 pipe "dir /s/b/a-d ""I:\Dat\4841CPM\28 Kredit\15 Green Loans\*.xlsx""";

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

@SirRolin If it's a samba authentication issue, you need be fix that.

 

On the other hand, maybe this issue will not be triggered if you don't use a pipe.

Try listing the files using another logic such as this one: https://communities.sas.com/t5/SAS-Programming/listing-all-files-within-a-levelectory-and-sublevelec...

View solution in original post

7 REPLIES 7
Kurt_Bremser
Super User

Hi and welcome to the communities!

 

Please post the whole log of such a failed call to the pipe (including the FILENAME statement and the data/procedure step where the file reference is used).

Please use the </> button for posting the log:

Bildschirmfoto 2020-04-07 um 08.32.59.png

SirRolin
Calcite | Level 5

Sorry for the long wait.
Here's the Log:

4165      +*filename FlistCB4 pipe "dir /s/b/a-d ""\\danskenet.net\public\Dat\4841CPM\28 Kredit\15
4165     !+Green Loans\*.xlsx""";
4166      +filename FlistCB4 pipe "dir /s/b/a-d ""I:\Dat\4841CPM\28 Kredit\15 Green Loans\*.xlsx""";
4167      +
4168      +
4169      +data FlistIOME;
4170      +  infile FlistCB4 lrecl=500 truncover;
4171      +  input this_file $500.;
4172      +  attrib
4173      +    Folder_Name length=$60
4174      +    Filename length=$60
4175      +    Date format=yymmdd10.
4176      +  	HAT length=$8
4177      +	hat2 length=$4
4178      +  ;
4179      +  /* remove all rows with folder names not complying with naming convention */
4180      +  	Folder_Name=scan(this_file,-2,'/\');
4181      +  	Filename=scan(this_file,-1,'/\');
4182      +	HAT=substr(Filename,length(Filename)-12,8);
4183      +	Date=input(substr(Filename,length(Filename)-12,8),yymmdd10.);
4184      +	hat2=substr(Filename,length(Filename)-3,4);
4185      +	hat3=substr(Filename,1,11);
4186      +    if upcase(HAT3)='GREEN_LOANS';
4187      +	if not missing(Date) ;
4188      +run;

NOTE: The infile FLISTCB4 is:
      Unnamed Pipe Access Device,
      PROCESS=dir /s/b/a-d "I:\Dat\4841CPM\28 Kredit\15 Green Loans\*.xlsx",
      RECFM=V,LRECL=500

Stderr output:
Invalid Signature.
NOTE: 0 records were read from the infile FLISTCB4.
NOTE: The data set WORK.FLISTIOME has 0 observations and 7 variables.
Kurt_Bremser
Super User

The "Invalid Signature" is a Windows response connected to a problem in the SMB protocol. It usually happens when connecting to older NAS boxes that do not support a certain security feature introduced with Windows Server 2012. A Google search for "windows dir invalid signature" will reveal more.

ChrisNZ
Tourmaline | Level 20

@SirRolin If it's a samba authentication issue, you need be fix that.

 

On the other hand, maybe this issue will not be triggered if you don't use a pipe.

Try listing the files using another logic such as this one: https://communities.sas.com/t5/SAS-Programming/listing-all-files-within-a-levelectory-and-sublevelec...

SirRolin
Calcite | Level 5
Sorry for the huge delay, had lots going on.
Finally got around to test this, and it worked perfectly. Thx
ballardw
Super User

Is the content of the pipe expected to change between uses? If not then I would suggest a method to capture the result one time (the first??) and place the result in a data set in a library that all of the code can access.

SirRolin
Calcite | Level 5
yes it's supposed to change.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 7 replies
  • 1096 views
  • 1 like
  • 4 in conversation