MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SQL=100 in JCL COND?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
banan
Beginner


Joined: 11 Jan 2005
Posts: 6
Topics: 2

PostPosted: Fri Mar 11, 2005 10:25 am    Post subject: SQL=100 in JCL COND? Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Mar 11, 2005 10:38 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
banan
Beginner


Joined: 11 Jan 2005
Posts: 6
Topics: 2

PostPosted: Fri Mar 11, 2005 10:51 am    Post subject: Reply with quote

kolusu,

many thanks for the quick reply.
if i am right, we dont have the latest version Sad :

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Mar 11, 2005 11:05 am    Post subject: Reply with quote

Quote:

if i am right, we dont have the latest version :


ban
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
banan
Beginner


Joined: 11 Jan 2005
Posts: 6
Topics: 2

PostPosted: Fri Mar 11, 2005 11:07 am    Post subject: Reply with quote

kolusu,

i'll do that.

THANKS again for everything Smile


ban
Back to top
View user's profile Send private message
Ranjish
Beginner


Joined: 22 Dec 2002
Posts: 64
Topics: 28
Location: Chennai

PostPosted: Sat Mar 12, 2005 3:39 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Mar 14, 2005 5:21 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group