|
View previous topic :: View next topic
|
| Author |
Message |
murali922
New User

Joined: 25 Jul 2005 Posts: 92 Location: India
|
|
|
|
| Code: |
//step1 EXEC PGM=ISRSUPC,
// PARM=(DELTAL,LINECMP,
// '',
// '')
//NEWDD DD DSN=<new dataset>,
// DISP=SHR
//OLDDD DD DSN=<old dataset>,
// DISP=SHR
//OUTDD DD DSN=&&TEMP,
// DISP=(,PASS),
// DSORG=PS,
// RECFM=FB,
// LRECL=80,
// BLKSIZE=0,
// UNIT=SYSDA,
// AVGREC=K,
// SPACE=(1,(1,1),RLSE)
//*
//step2 EXEC PGM=SORT
//SORTIN DD DSN=&&TEMP,DISP=(OLD,DELETE)
//SORTOFA DD DSN=<dataset with inserts>,
// DISP=SHR
//SORTOFB DD DSN=<dataset with deletes>,
// DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSIN dd *
OPTION COPY
OUTFIL FILES=A,OUTREC(6,80),
INCLUDE=(2,3,CH,EQ,C'I -')
OUTFIL FILES=B,OUTREC(6,80),
INCLUDE=(2,3,CH,EQ,C'D -')
/* |
The above JCl compares 2 files. 1 file being the base file. And the other one being the new one. Creates one file with all new insertions.
Creates another file with all deletions.
I should not have any deletions normally. Hence I need to abend the job, if there are any records in the dataset which holds deleted
records.
I know I have an option to count the number of records in a dataset and then if the count is more than 0, make it abend. But dont know
the syntax..
Can someone let me know who I should write the next step, so that if there are any records in the <dataset with deletes> the job would abend. |
|
| Back to top |
|
 |
dineshness
New User
Joined: 25 Dec 2006 Posts: 63 Location: Perambalur
|
|
|
|
You can use the following SORT card to Set the RC12,
COUNT FROM(SORTIN) HIGHER(0) USING(CTL1)
//CTL1CNTL DD *
INCLUDE COND = (2,3,CH,EQ,C'D -')
/*
Dinesh. |
|
| Back to top |
|
 |
Steve Coalbran
New User

Joined: 01 Feb 2007 Posts: 89 Location: Stockholm, Sweden
|
|
|
|
Maybe true, and I am definitely no Frank Yaeger, but if I try and apply this to a SORT JCL I have handy, there is something definitely missing...
| Code: |
//ICEMAN EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
//OUT1 DD SYSOUT=*
//SYSIN DD *
COUNT FROM(SORTIN) HIGHER(0) USING(CTL1)
//CTL1CNTL DD *
INCLUDE COND = (2,3,CH,EQ,C'D -')
/*
|
what's is it?...
| Code: |
SDSF OUTPUT DISPLAY SE16661I JOB04191 DSID 104 LINE 1 COLUMNS 02- 81
COMMAND INPUT ===> SCROLL ===> CSR
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 20:34 ON MON FEB
COUNT FROM(SORTIN) HIGHER(0) USING(CTL1)
?
ICE005A 0 STATEMENT DEFINER ERROR
ICE010A 0 NO SORT OR MERGE CONTROL STATEMENT
ICE751I 0 C5-K05352 C6-Q95214 E7-K90000
ICE052I 3 END OF DFSORT
******************************** BOTTOM OF DATA ********************************
|
PS: Using bbCode on the reply would aid the non-psychic.  |
|
| Back to top |
|
 |
dineshness
New User
Joined: 25 Dec 2006 Posts: 63 Location: Perambalur
|
|
|
|
Me too neither... .
But, from the JCL can you really give SORTIN as * ?, Please try with a dataset name with some records.
And, you dont have to include the OUT1 DD entry.
Delimit the SYSIN before CTL1CNTL with /*.
I dont really have a system with which i can try the code.
My reply was purely intuitive....as it should have worked .
Dinesh. |
|
| Back to top |
|
 |
dineshness
New User
Joined: 25 Dec 2006 Posts: 63 Location: Perambalur
|
|
|
|
| Quote: |
| But, from the JCL can you really give SORTIN as * ?, Please try with a dataset name with some records. |
I mean code some instream data records or mention a dataset name having records.
Dinesh. |
|
| Back to top |
|
 |
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
| murali922 wrote: |
| Can someone let me know who I should write the next step, so that if there are any records in the <dataset with deletes> the job would abend. |
Have you looked at Smart DFSORT Tricks and the chapter entitled Set RC=12 or RC=4 if file is empty, has more than n records, etc?
I'm not sure, but you might be able to incorporate the technique in the sort that does the splitting. |
|
| Back to top |
|
 |
murali922
New User

Joined: 25 Jul 2005 Posts: 92 Location: India
|
|
|
|
Super Cool. It worked and the doc was superb
Thanks a lot
Murali. |
|
| Back to top |
|
 |
murali922
New User

Joined: 25 Jul 2005 Posts: 92 Location: India
|
|
|
|
Super Cool. The document was very useful
Thanks a lot... |
|
| Back to top |
|
 |
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
| murali922 wrote: |
Super Cool. It worked and the doc was superb  |
That is good to hear.
Did you manage to combine the function or have another step?
Could you post your solution? |
|
| Back to top |
|
 |
murali922
New User

Joined: 25 Jul 2005 Posts: 92 Location: India
|
|
|
|
I added another step
| Code: |
PS050 EXEC PGM=ICETOOL
TOOLMSG DD SYSOUT=*
DFSMSG DD SYSOUT=*
INDD DD DSN=<data set name>,
DISP=SHR
TOOLIN DD *
COUNT FROM(INDD) NOTEMPTY
/* |
|
|
| Back to top |
|
 |
superk
Global Moderator

Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Here's the question I have:
Do you use the DFSORT option as shown, but still have the follow-up job step that causes the abend to occur? Or, do you just incorporate both processes into a single user-written program? |
|
| Back to top |
|
 |
murali922
New User

Joined: 25 Jul 2005 Posts: 92 Location: India
|
|
|
|
PS040 is a step which creates the SORTED file (INDD).
PS040 uses the following sort card :-
OPTION COPY
OUTFIL FILES=A,OUTREC(6,80),
INCLUDE=(2,3,CH,EQ,C'I -')
OUTFIL FILES=B,OUTREC(6,80),
INCLUDE=(2,3,CH,EQ,C'D -')
PS050 is the step which looks like what I have posted above.
PS050 uses the following as TOOLIN :-
COUNT FROM(INDD) NOTEMPTY |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|