View previous topic :: View next topic |
Author |
Message |
banan Beginner
Joined: 11 Jan 2005 Posts: 6 Topics: 2
|
Posted: Fri Mar 11, 2005 10:25 am Post subject: SQL=100 in JCL COND? |
|
|
Hi all,
i try to control my JCL-steps from/with DB2 tables - record/parameter exists, not exists. At the moment i use a control of 2 steps; in S010 i do an unload of 1 row, S020 checks if i got the row. then comes go/no go...
Code: |
//S010 EXEC PGM=IKJEFT01
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB2T)
RUN PROGRAM(DSNTIAUL) PLAN(DSNTIAUL) PARMS('SQL')
//SYSPUNCH DD DUMMY
//SYSREC00 DD DISP=(,PASS),SPACE=(TRK,1),
// DSN=TEMP File
//SYSIN DD *
SELECT * FROM MYTAB WHERE USER= 'QWERT';
//*
//S020 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
PRINT INDATASET('TEMP File') COUNT(1)
IF LASTCC = 4 THEN SET MAXCC = 5
|
It works fine, but i'd like to have it in one step.
Has anyone got an idea? Is is possible to get SQL=100 in JCL as a step return code?
thanks
ban |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Fri Mar 11, 2005 10:38 am Post subject: |
|
|
banan,
If your shop has the latest version of syncsort, then the following JCL will give you the desired results. If your file is empty then it produces a return code of 4.
Code: |
//STEP0100 EXEC PGM=SORT,PARM='DB2=DB2T'
//SYSOUT DD SYSOUT=*
//SORTOUT DD DSN=YOUR.UNLOAD.FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(X,Y),RLSE)
//SORTDBIN DD *
SELECT * FROM TABLE WHERE COND = 'SOME CONDITION'
//SYSIN DD *
SORT FIELDS=COPY
OPTION NULLOUT=RC4
/*
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
banan Beginner
Joined: 11 Jan 2005 Posts: 6 Topics: 2
|
Posted: Fri Mar 11, 2005 10:51 am Post subject: |
|
|
kolusu,
many thanks for the quick reply.
if i am right, we dont have the latest version :
PROCSTEP RC EXCP
STEP0100 16 8
Code: |
SYNCSORT 3.7CR TPF2A US PATENTS: 4210961,5117495,
z/OS
SYSIN :
SORT FIELDS=COPY
OPTION NULLOUT=RC4
*
WER131I PARM FIELD ERROR - DB2=DB2T
WER268A OPTION STATEMENT : SYNTAX ERROR
|
ban |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Fri Mar 11, 2005 11:05 am Post subject: |
|
|
Quote: |
if i am right, we dont have the latest version :
|
ban _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
banan Beginner
Joined: 11 Jan 2005 Posts: 6 Topics: 2
|
Posted: Fri Mar 11, 2005 11:07 am Post subject: |
|
|
kolusu,
i'll do that.
THANKS again for everything
ban |
|
Back to top |
|
 |
Ranjish Beginner

Joined: 22 Dec 2002 Posts: 64 Topics: 28 Location: Chennai
|
Posted: Sat Mar 12, 2005 3:39 am Post subject: |
|
|
Hi Kolusu,
I just tried it. I got the following error.
SYSIN :
SORT FIELDS=COPY
OPTION NULLOUT=RC4
WER468A DB2 QUERY SUPPORT ERROR: CANNOT OPEN PLAN
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
QW says "- CANNOT OPEN PLAN Insufficient resources were available for
DB2 to process the open request. ".
What could be the reason for this?
Thanks
Ranjish |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Mon Mar 14, 2005 5:21 am Post subject: |
|
|
Quote: |
What could be the reason for this?
|
Ranjish,
Please read my post which is 2 posts above this post.
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
|
|