| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| vini Intermediate
 
 
 Joined: 12 Jan 2004
 Posts: 240
 Topics: 48
 Location: Maryland
 
 | 
			
				|  Posted: Mon Mar 08, 2004 10:28 am    Post subject: Check for DS %Used in JCL |   |  
				| 
 |  
				| A Step in a JCL creates a GDG version (VB , Lrecl 11004). How can I implement something as follows after the step ???
 If GDG-ver %Used > 0
 TSO SE 'Records created' U(TESTID)
 End-if
 Basically a User should be notified automatically in someway that records were created , without having to check the Job output .
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| kolusu Site Admin
 
  
 
 Joined: 26 Nov 2002
 Posts: 12394
 Topics: 75
 Location: San Jose
 
 | 
			
				|  Posted: Mon Mar 08, 2004 10:49 am    Post subject: |   |  
				| 
 |  
				| Vini, 
 If I understand correctly , you want to send a message to the user if the file has atleast 1 record. You can use one of the methods shown in the link below to check for an empty file and use the retun code to send the message.
 
 http://www.mvsforums.com/helpboards/viewtopic.php?t=1285&highlight=empty
 
 for ex: if you used idcams to check for the empty file , then the next step will run only when there are records in the file.
 
 
 
  	  | Code: |  	  | //*********************************************************************
 //*  SETS RC=0000 IF DATASET HAS RECORDS                              *
 //*  SETS RC=0004 IF DATASET IS EMPTY                                 *
 //*********************************************************************
 //EMPTY    EXEC PGM=IDCAMS
 //SYSPRINT DD SYSOUT=*
 //FILE01   DD DSN=YOUR FILE IN QUESTION,
 //            DISP=SHR
 //SYSIN    DD  *
 PRINT INFILE(FILE01) CHARACTER COUNT(1)
 //*
 //SENDMESG EXEC PGM=IKJEFT01,COND=(4,EQ,EMPTY)
 //SYSTSPRT DD  SYSOUT=*
 //SYSTSIN  DD  *
 SE 'RECORDS CREATED' U(USERID)
 /*
 
 | 
 
 Hope this helps...
 
 Cheers
 
 Kolusu
 _________________
 Kolusu
 www.linkedin.com/in/kolusu
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| vini Intermediate
 
 
 Joined: 12 Jan 2004
 Posts: 240
 Topics: 48
 Location: Maryland
 
 | 
			
				|  Posted: Wed Mar 17, 2004 6:55 pm    Post subject: |   |  
				| 
 |  
				| Kolusu, Can I use these Steps ,as the Last two steps if I make them a part of the same JCL in which the File is created ?! My concern is , would the Record count be available in the same JCL after the Step in which the file is created. I want to confirm this , vaguely remember coming across some Posts where these things seemed to be a concern (maybe in a different context though).
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| kolusu Site Admin
 
  
 
 Joined: 26 Nov 2002
 Posts: 12394
 Topics: 75
 Location: San Jose
 
 | 
			
				|  Posted: Thu Mar 18, 2004 6:36 am    Post subject: |   |  
				| 
 |  
				| Vini, 
 Yes you can use these steps as the last steps of same job which creates the dataset. Make sure to give (+1) version for the last step also. check this topic which explain more about using newly created gdg version in the same job.
 
 http://www.mvsforums.com/helpboards/viewtopic.php?t=1251
 
 Hope this helps...
 
 Cheers
 
 Kolusu
 _________________
 Kolusu
 www.linkedin.com/in/kolusu
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| vini Intermediate
 
 
 Joined: 12 Jan 2004
 Posts: 240
 Topics: 48
 Location: Maryland
 
 | 
			
				|  Posted: Thu Mar 18, 2004 1:28 pm    Post subject: |   |  
				| 
 |  
				| If I understand correctly, it means the GDG gets catalogued soon after the last successfully executed step of the JCL. kolusu , thanks , got no more confusions !
  |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  | 
	
		|  |