SAS program for comparing files in JCL



All other tools like QACenter, Strobe, Endevor, Telon, APAS, Scheduler, Auditor, DATA-XPERT, CoolGen, Intertest, AdvantageGen, COBTEST etc.

SAS program for comparing files in JCL

Postby koti_aug26 » Sat Dec 19, 2009 12:31 pm

Could anybody please help me to get a SAS program for the following requirement,

The requirement is to compare two files and generate a report. Both the files have same LRECL.

//STEP2 EXEC SASPROD
//SARFILE DD DSN=INFILE1,DISP=SHR
//SARFILE1 DD DSN=INFILE2,DISP=SHR
//RESULT DD DSN=RESFILE,DISP=SHR
//SYSIN DD *
DATA SARPRINT;
INFILE SARFILE;
INFILE SARFILE1;
PROC COMPARE BASE=SARFILE COMP=SARFILE1 OUT=RESULT OUTNOEQUAL;RUN;
/*
//*

If we use above code. We got few errors.

ERROR: File WORK.SARFILE.DATA does not exist.
ERROR: File WORK.SARFILE1.DATA does not exist.

Kindly let me know if any clarification needed.
_________________
Thanks,
Koteswararao
koti_aug26
 
Posts: 1
Joined: Sat Dec 19, 2009 12:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: SAS program for comparing files in JCL

Postby salltm » Sat Dec 19, 2009 3:16 pm

please check the PROC.SASPROD MAYBE There are some files missing in you PROC.
salltm
 
Posts: 4
Joined: Fri Dec 05, 2008 8:40 am
Location: China
Has thanked: 0 time
Been thanked: 0 time

Re: SAS program for comparing files in JCL

Postby expat » Sat Dec 19, 2009 5:48 pm

salltm wrote:please check the PROC.SASPROD MAYBE There are some files missing in you PROC.

HUH .................... the errors are coding errors.

How can you read from the WORK file when you have not put anything in there
expat
 
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 8 times

Re: SAS program for comparing files in JCL

Postby Robert Sample » Sat Dec 19, 2009 8:41 pm

DATA SARPRINT;
INFILE SARFILE;
INFILE SARFILE1;
PROC COMPARE BASE=SARFILE COMP=SARFILE1 OUT=RESULT OUTNOEQUAL;RUN;
This is code from someone who has never used SAS, I would bet. Points about it are:
1. You only create one SAS dataset, which is SARPRINT, yet you are attempting to compare two SAS datasets (SARFILE and SARFILE1), neither of which you have created.
2. Assigning an INFILE in SAS tells SAS nothing but which DD name your input statements are coming from.
3. You have NO INPUT statements, so you are reading no data, so there's not going to be anything in SARPRINT anyway.

The normal processing for a SAS program is:
DATA A;
INFILE SARFILE LENGTH=RL;
INPUT @;
RECLEN = RL;
INPUT @1 DATALINE $VARYING. RECLEN;
which gives you two output variables in the SAS dataset WORK.A -- RECLEN which has the length of each record, and DATALINE which contains the actual data lines read from SARFILE.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to All Other Tools

 


  • Related topics
    Replies
    Views
    Last post