BookmarkSubscribeRSS Feed
chandu1
Calcite | Level 5

Hi ,

 

I have run the sas program using sasgsub command at command prompt and also run same program in SAS EG. Using sasgsub command the external file is not reading using infile statement but when I run sas program in sas enterprise guide the file is reading properly and creating dataset with observations. 

 

I have run below similar code using sasgsub command.


sasgsub userid -METAPASS passwrd -gridappserver quename -gridsubmitpgm "\\test\pgm1.sas"

 

Please find the attachment for log file info for both sasgsub and SAS EG code

I would appreciate if anyone give any suggestions to resolve the issue.

 

Regards,

chandu

4 REPLIES 4
ChrisNZ
Tourmaline | Level 20

No docx files please. Please paste the log using the </> icon.

chandu1
Calcite | Level 5

Please find the below log while submitting sas program with sasgsub command:

 

2 dm log "clear";
3 dm output "clear";
4
5 /* filename tmpf "\\quintiles.net\enterprise\Apps\sasdata\StatOpB\TestingProcHadoop\Purna\DMPrograms\tempfile.txt"; */
6
7
8 filename tmpf temp;
9
10 proc printto log=tmpf; run;

NOTE: PROCEDURE PRINTTO used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

20
21
22 data tmpf;
23 infile tmpf lrecl=2000 pad missover;
24 input txt $2000.;
25
26 if length(txt)>35 then txt=substr(txt,1,35);
27 if find(upcase(txt),"UNINITIALIZED.") >0 then uninitialized = 1;
28 if find(upcase(txt),"WARNING:") >0 then warning = 1;
29 if find(upcase(txt),"ERROR:") >0 then error = 1;
30 if find(upcase(txt),"NOTE: CHARACTER VALUES HAVE BEEN") >0 then char2num = 1;
31 if find(upcase(txt),"NOTE: NUMERIC VALUES HAVE BEEN") >0 then num2char = 1;
32 if find(upcase(txt),"NOTE: MERGE STATEMENT HAS MORE") >0 then merge = 1;
33
34 run;

NOTE: The data set WORK.TMPF has 0 observations and 7 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds

35
36 data _null_;
37 set tmpf;
38 put txt;
39 run;

NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

40
41 proc means data = tmpf n noprint;
42 var warning error char2num num2char merge uninitialized ;
43 output out=tmpf n=warning error char2num num2char merge uninitialized ;
44 run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.TMPF may be incomplete. When this step was stopped there were 0 observations and 0 variables.
WARNING: Data set WORK.TMPF was not replaced because this step was stopped.
NOTE: PROCEDURE MEANS used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds

3 The SAS System 13:36 Monday, February 21, 2022

45
46 %let ErrNum=0;


47 data _null_;
48 set tmpf;
49 if not (warning>0 or error>0 or char2num>0 or num2char>0 or merge>0 or uninitialized>0 )
50 then put "No Log issues detected";
51 else do;
52 put "The following problems were detected in the log:";
53 if warning>0 then put " " warning " WARNING Messages";
54 if error>0
55 then do;
56 put " " error " ERROR Messages";
57 call symput("ErrNum", trim(left(put(error, 8.))));
58 end;
59 if char2num>0 then put " " char2num " Char to Num Messages";
60 if num2char>0 then put " " num2char " Num to Char Messages";
61 if merge>0 then put " " Merge " Merge Messages";
62 if uninitialized>0 then put " " Uninitialized " Uninitialized Messages";
63 end;
64
65
66
67 run;

NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

68 %Put Number of Err Occurences=&ErrNum;
Number of Err Occurences=0
69 %if &ErrNum=0
70 %then %do; %let MyStr=Successful Completion; %let Statstr="Complete"; %end;
71 %else %do; %let MyStr=Failed: &Errnum Errors;%let Statstr="Failed"; %end;
72

ERROR: Errors printed on page 1.

andreas_lds
Jade | Level 19

Imho the first data step causes the problems:

NOTE: The data set WORK.TMPF has 0 observations and 7 variables.

Check the file you are trying to read.

Kurt_Bremser
Super User

SAS does exactly what you tell it to do, and it does not do things that you explicitly exclude:

5 /* filename tmpf "\\quintiles.net\enterprise\Apps\sasdata\StatOpB\TestingProcHadoop\Purna\DMPrograms\tempfile.txt"; */
6
7
8 filename tmpf temp;

The first FILENAME statement is commented out, so only the temporary file is created, with no content. Un-comment the first statement and remove the second.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 4 replies
  • 518 views
  • 0 likes
  • 4 in conversation