BookmarkSubscribeRSS Feed
josh_rodriguez
Calcite | Level 5

Hi, and thank you in advance!

 

(I'm using SAS DI Studio 4.905.)

 

I currently have a Job that has 3 objects in it in the following order:

-Text File, which is comprised of a header with the columns, and the subsequent lines have rows of data.

-A File Reader transformation, which helps read said file. 

-A Data Validation transformation, which will validate that the headers/columns are correct. (Eg: validate that the EMPLID field has a header of "WCU ID". If this is not the case, the program will abort.)

 

Currently, this Job is working fine. It is able to process 1 file at a time.

 

What I'm trying to do is make it work for multiple files. Currently, I have 4 files to process, but it only seems to be doing the validation for the first file. 

 

I have tried adding a Loop here and there, but same result. (Most likely I'm doing it wrong.)

 

I attached screenshots with what I have set up. I have also pasted below the User written body code of the File Reader. Please advise.

 

proc datasets lib = work nolist nowarn memtype = (data view);
delete WHOZG0KF;
quit;

data work.WHOZG0KF / view = work.WHOZG0KF ;
infile 'FILE_LOCATION_GOES_HERE/slatetosisupdate*'
lrecl = 431
delimiter = '|'
dsd
missover
firstobs = 1
obs = 1;
;
attrib EMPLID length = $11
format = $11.
informat = $11.;
attrib WCU_SLATE_APP_NUM length = $50
format = $50.
informat = $50.;
attrib ACAD_CAREER length = $4
format = $4.
informat = $4.;
attrib ADMIT_TYPE length = $3
format = $3.
informat = $3.;
attrib ACAD_PLAN length = $10
format = $10.
informat = $10.;
attrib HOUSING_INTEREST length = $1
format = $1.
informat = $1.;
attrib WCU_SLATE_EMPLID length = $50
format = $50.
informat = $50.;
attrib WCU_AD_RNL_INDEX length = $5;
attrib WCU_AD_AWRD_AMT length = $8;
attrib ADM_APPL_NBR length = $8
format = $8.
informat = $8.;
attrib RECRUITMENT_CAT length = $4
format = $4.
informat = $4.;
attrib WCU_ARTIC_CODE length = $10
format = $10.
informat = $10.;
attrib PROG_ACTION length = $4
format = $4.
informat = $4.;
attrib PROG_REASON length = $4
format = $4.
informat = $4.;
attrib ACTION_DATE length = $18;
attrib PROG_ACTION_2 length = $4
format = $4.
informat = $4.;
attrib PROG_REASON_2 length = $4
format = $4.
informat = $4.;
attrib ACTION_DT_2 length = $18;
attrib PROG_ACTION_3 length = $4
format = $4.
informat = $4.;
attrib PROG_REASON_3 length = $4
format = $4.
informat = $4.;
attrib ACTION_DT_3 length = $18;
attrib EFFSEQ length = $3;
attrib ERROR length = $1;
attrib WCU_STU_REC_UPD length = $1;
attrib DATE1 length = $18;

input EMPLID WCU_SLATE_APP_NUM ACAD_CAREER ADMIT_TYPE ACAD_PLAN
HOUSING_INTEREST WCU_SLATE_EMPLID WCU_AD_RNL_INDEX WCU_AD_AWRD_AMT
ADM_APPL_NBR RECRUITMENT_CAT WCU_ARTIC_CODE PROG_ACTION PROG_REASON
ACTION_DATE PROG_ACTION_2 PROG_REASON_2 ACTION_DT_2 PROG_ACTION_3
PROG_REASON_3 ACTION_DT_3 EFFSEQ ERROR WCU_STU_REC_UPD DATE1;

run;

%rcSet(&syserr);

 

1.png

2.png

3.png

4.png

5.png

  

1 REPLY 1
LinusH
Tourmaline | Level 20

Trying to understand what you are doing.

This job is for validating the header record, not to import actual data, or?

Also, I'm wondering how you distinguish the different files, is this an aggergate file location you are pointing to?

I guess this can be kind of hard to trouble shoot, but I usually try to run it step by step (preferable in Enterpise Guide) and see what happens, and evaluate output from each operation.

Data never sleeps

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 603 views
  • 0 likes
  • 2 in conversation