| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| deepa12 Beginner
 
 
 Joined: 05 Apr 2005
 Posts: 131
 Topics: 64
 Location: chennai
 
 | 
			
				|  Posted: Fri Sep 28, 2018 1:03 am    Post subject: Messages from  IDCAMS- REPRO in REXX |   |  
				| 
 |  
				| Kindly refer to the JCL code for IDCAMS REPRO. When i provide search condition as a key beyond the last record in file, IDCAMS prints the following message in SYSPRINT 
 REPRO IFILE(DD1IN) OFILE(DD1OUT) FROMKEY('ZZZZ') TOKEY('ZZZZ')
 IDC0005I NUMBER OF RECORDS PROCESSED WAS 0
 IDC3006I FUNCTION TERMINATED DUE TO BEGINNING POSITIONING ERROR
 
 
 
  	  | Code: |  	  | //uid1LOAD JOB (EXCP),'SAR EXTRACT',CLASS=2,MSGCLASS=Y,NOTIFY=XE57 //DCBKP1   EXEC PGM=IDCAMS,COND=(4,LT)
 //DD1IN    DD  DSN=XE57.X7.SMFILE,DISP=SHR
 //DD1OUT   DD  DSN=XE57.SMFILE,DISP=SHR
 //SYSOUT   DD  SYSOUT=*
 //SYSPRINT DD  SYSOUT=*
 //SYSU@@MP DD  SYSOUT=*
 //SYSIN    DD  *
 REPRO IFILE(DD1IN) OFILE(DD1OUT) FROMKEY('ZZZZ') TOKEY('ZZZZ')
 /*
 | 
 
 If i code similar to this in REXX, as provided below  i get a different error message as specified here:
 ERROR  OCCURED WHILE PROCESSING 12
 12 :Clause too long
 19:  "REPRO IFILE(IN) OFILE(TE) FROMKEY('"FKEY"') TOKEY('"FKEY"')"
 
 
 
  	  | Code: |  	  | INFILE = 'XE57.X7.SMFILE' ADDRESS TSO
 "ALLOC FI(IN) DA('"INFILE"') OLD "
 "ALLOC FI(TE) DA('XE57.X7.SMFILE1') SHR REU"
 ADDRESS
 x=msg("on") ;
 SIGNAL ON ERROR
 SIGNAL ON SYNTAX
 msgtrapstat = TRAPMSG("ON");
 X = OUTTRAP("CMD.");
 FKEY=STRIP(ZZZZ)
 ADDRESS TSO
 "REPRO IFILE(IN) OFILE(TE) FROMKEY('"FKEY"') TOKEY('"FKEY"')"
 ADDRESS
 SAY 'REPRO RC' REPRO RC
 if rc = 12  then do
 x=outtrap("off");
 msgtrapstat = TRAPMSG("OFF") ;
 say 'ssysprint output ' cmd.0
 do i = 1 to cmd.0
 say cmd.i
 end
 end
 x=outtrap("off");
 ADDRESS TSO " FREE F(IN)"
 
 ADDRESS TSO  " FREE F(TE)"
 DO I = 1 to cmd.0
 say cmd.i
 end
 EXIT
 ERROR:
 SAY 'ERROR  OCCURRED WHILE PROCESSING '|| RC
 if rc > 0 then
 SAY  RC ":" || ERRORTEXT(RC)
 
 if sigl > 0 then
 say sigl || ":" || SOURCELINE(sigl)
 
 SAY "TRAPPED INFO" || CMD.0
 DO I = 1 to cmd.0
 say cmd.i
 end
 ADDRESS TSO " FREE F(IN)"
 
 ADDRESS TSO  " FREE F(TE)"
 EXIT
 syntax:
 SAY 'syntax ERROR OCCURRED WHILE PROCESSING '|| RC
 if rc > 0 then
 SAY  RC ":" || ERRORTEXT(RC)
 
 if sigl > 0 then
 say sigl || ":" || SOURCELINE(sigl)
 
 SAY "TRAPPED INFO" || CMD.0
 DO I = 1 to cmd.0
 say cmd.i
 end
 ADDRESS TSO " FREE F(IN)"
 
 ADDRESS TSO  " FREE F(TE)"
 EXIT
 
 | 
 
 In the former case, from the message
 IDC3006I FUNCTION TERMINATED DUE TO BEGINNING POSITIONING ERROR
 i could find that the pointer is going beyond end of file. But the following message from REXX, looks like SYTNAX Error
 
 12 :Clause too long
 
 How to get IDC3006I from REXX also
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| expat Intermediate
 
  
 Joined: 01 Mar 2007
 Posts: 475
 Topics: 9
 Location: Welsh Wales
 
 | 
			
				|  Posted: Fri Sep 28, 2018 1:44 am    Post subject: |   |  
				| 
 |  
				| I assume that you have read the meaning for the IDC3006I message and checked that all is well regarding the reord keys. i.e. the key does exist. 
 Should you not leave a space before the REPRO keyword in your generated control statement.
 _________________
 If it's true that we are here to help others,
 then what exactly are the others here for ?
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| deepa12 Beginner
 
 
 Joined: 05 Apr 2005
 Posts: 131
 Topics: 64
 Location: chennai
 
 | 
			
				|  Posted: Fri Sep 28, 2018 2:17 am    Post subject: |   |  
				| 
 |  
				| Am testing for the condition that the key does not exist and also that it is beyond the last key in  the file. If i provide a key that does not exist and is a key in between 2 keys which are already present in the file then the SYSPRINT JCL message & the 1 from REXX OUTTRAP is the same
 _________________
 deepa
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| expat Intermediate
 
  
 Joined: 01 Mar 2007
 Posts: 475
 Topics: 9
 Location: Welsh Wales
 
 | 
			
				|  Posted: Fri Sep 28, 2018 2:30 am    Post subject: |   |  
				| 
 |  
				| Checking that the key does not exist seems fair enough, but checking for a key that doesn't exist beyond the last key is just nonsense. 
 If you think about it, how can it exist beyond the last key in the dataset, because if it did it would itself be the last key in the dataset.
 _________________
 If it's true that we are here to help others,
 then what exactly are the others here for ?
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| deepa12 Beginner
 
 
 Joined: 05 Apr 2005
 Posts: 131
 Topics: 64
 Location: chennai
 
 | 
			
				|  Posted: Fri Sep 28, 2018 4:00 am    Post subject: |   |  
				| 
 |  
				| I just specified the test scenario and wanted to understand how to trap this specific message in REXX so that in the REXX program i would specifically check for this message (IDC3006I FUNCTION TERMINATED DUE TO BEGINNING POSITIONING ERROR) & understand that the key was not present in the file and that the REPRO failure is not due to anything else
 _________________
 deepa
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| kolusu Site Admin
 
  
 
 Joined: 26 Nov 2002
 Posts: 12394
 Topics: 75
 Location: San Jose
 
 | 
			
				|  Posted: Fri Sep 28, 2018 12:17 pm    Post subject: |   |  
				| 
 |  
				| deepa12, 
 It is quite amazing that you don't learn from your earlier mistakes.  A few days back you had this topic
 
 https://www.mvsforums.com/helpboards/viewtopic.php?t=12910
 
 and the error is "Clause too long" and here we are again with the same error.
 
 The resolution in the earlier topic was to allocate the message DD  SYSTSPRT. Since it is IDCAMS REPRO you need to allocate SYSPRINT.
 
 If you are coding a rexx to replicate the JCL version then make sure that you allocate ALL the ddnames needed.
 
 I still don't get this nonsense of using REXX for every request which results in a huge waste of resources.
 _________________
 Kolusu
 www.linkedin.com/in/kolusu
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| misi01 Advanced
 
 
 Joined: 02 Dec 2002
 Posts: 629
 Topics: 176
 Location: Stockholm, Sweden
 
 | 
			
				|  Posted: Sat Sep 29, 2018 1:11 am    Post subject: |   |  
				| 
 |  
				| Kolusu. 
 Sometimes, the reason for writing stuff in Rexx rather than as JCL is because you want to mollycoddle (there must be a better word) the end users.
 
 I have developed (deliberately) a panel based application in ISPF using rexx for that reason. The end users are management. To expect them to understand what SDSF is, to ensure they don't reset their prefix there by mistake etc, is totally unrealistic.
 
 Give them a panel and some PF keys that will check whether the job has run to completion etc. They will log onto TSO, come straight into the application and ONLY use the options available there.
 
 THAT is why you sometimes have to "protect" users from what they would consider the vagaries of TSO.
 _________________
 Michael
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| kolusu Site Admin
 
  
 
 Joined: 26 Nov 2002
 Posts: 12394
 Topics: 75
 Location: San Jose
 
 | 
			
				|  Posted: Sun Sep 30, 2018 12:01 pm    Post subject: |   |  
				| 
 |  
				|  	  | misi01 wrote: |  	  | Kolusu. 
 Sometimes, the reason for writing stuff in Rexx rather than as JCL is because you want to mollycoddle (there must be a better word) the end users.
 | 
 
 misi01,
 
 I agree that you need to provide an GUI interface for the end users. That is the *ONLY* thing you would provide for them. The actual process needs to be handled under the covers with an optimal solution. You don't write a REXX exec to read/update millions of records. You generate the Batch JCL and submit via INTRDR and then check for the return code and send the message/email back to the end user after successful/failure completion. For all the end user doesn't care how you got the desired results.
 _________________
 Kolusu
 www.linkedin.com/in/kolusu
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| deepa12 Beginner
 
 
 Joined: 05 Apr 2005
 Posts: 131
 Topics: 64
 Location: chennai
 
 | 
			
				|  Posted: Sun Sep 30, 2018 11:48 pm    Post subject: |   |  
				| 
 |  
				| I already allocated SYSPRINT, SYSTSPRT  and tried. They were empty. And i have presented the same once again
 
 The  SYSPRINT, SYSTSPRT datasets have been allocated as FB 133 . They are empty. It shows the error message on screen. But it remains the same
 
 
  	  | Code: |  	  | INFILE = 'XE57.X7.SMFILE' ADDRESS TSO
 "ALLOC FI(IN) DA('"INFILE"') OLD "
 "ALLOC FI(TE) DA('XE57.X7.SMFILE1') SHR REU"
 "ALLOC FI(SYSTSPRT) DA('XE57.PRINT') OLD"
 say rc
 "ALLOC FI(SYSPRINT) DA('XE57.PRINT.TEST') OLD"
 say rc
 ADDRESS
 x=msg("on") ;
 SIGNAL ON ERROR
 SIGNAL ON SYNTAX
 FKEY=STRIP(ZZZZ)
 ADDRESS TSO
 "REPRO IFILE(IN) OFILE(TE) FROMKEY('"FKEY"') TOKEY('"FKEY"')"
 ADDRESS
 x=msg("on") ;
 SIGNAL ON ERROR
 SIGNAL ON SYNTAX
 FKEY=STRIP(ZZZZ)
 ADDRESS TSO
 "REPRO IFILE(IN) OFILE(TE) FROMKEY('"FKEY"') TOKEY('"FKEY"')"
 ADDRESS
 SAY 'REPRO RC' REPRO RC
 ADDRESS TSO " FREE F(IN)"
 
 ADDRESS TSO  " FREE F(TE)"
 ADDRESS TSO  " FREE F(SYSPRINT)"
 ADDRESS TSO  " FREE F(SYSTSPRT)"
 EXIT
 ERROR:
 SAY 'ERROR  OCCURED WHILE PROCESSING '|| RC
 if rc > 0 then
 SAY  RC ":" || ERRORTEXT(RC)
 
 if sigl > 0 then
 say sigl || ":" || SOURCELINE(sigl)
 
 ADDRESS TSO " FREE F(IN)"
 
 ADDRESS TSO  " FREE F(TE)"
 ADDRESS TSO  " FREE F(SYSPRINT)"
 ADDRESS TSO  " FREE F(SYSTSPRT)"
 EXIT
 syntax:
 SAY 'syntax OCCURED WHILE PROCESSING '|| RC
 if rc > 0 then
 SAY  RC ":" || ERRORTEXT(RC)
 
 if sigl > 0 then
 say sigl || ":" || SOURCELINE(sigl)
 ADDRESS TSO " FREE F(IN)"
 
 ADDRESS TSO  " FREE F(TE)"
 ADDRESS TSO  " FREE F(SYSPRINT)"
 ADDRESS TSO  " FREE F(SYSTSPRT)"
 EXIT
 
 | 
 _________________
 deepa
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| Nic Clouston Advanced
 
 
 Joined: 01 Feb 2007
 Posts: 1075
 Topics: 7
 Location: At Home
 
 | 
			
				|  Posted: Mon Oct 01, 2018 3:47 am    Post subject: |   |  
				| 
 |  
				| Why waste space and time by showing the same code again? How about cutting and pasting the screen messages. 
 You can save yourself a lot of typing if you omit the ADDRESS TSO as TSO is the default.
 
 SYSPRINT & SYSTPRNT are not LRECL 133 or FB. You could try 121 & FBA.
 _________________
 Utility and Program control cards are NOT, repeat NOT, JCL.
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| deepa12 Beginner
 
 
 Joined: 05 Apr 2005
 Posts: 131
 Topics: 64
 Location: chennai
 
 | 
			
				|  Posted: Mon Oct 01, 2018 5:04 am    Post subject: |   |  
				| 
 |  
				| I have allocated RECFM=FBA ;LRECL=121 
 The following appear on screen
 
  	  | Code: |  	  | 0
 0
 NUMBER OF RECORDS PROCESSED WAS 0
 LASTCC=12
 ERROR  OCCURED WHILE PROCESSING 12
 12 :Clause too long
 17:    "REPRO IFILE(IN) OFILE(TE) FROMKEY('"FKEY"') TOKEY('"FKEY"')"
 
 
 | 
 SYSPRINT,SYSTSPRT are empty
 _________________
 deepa
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| expat Intermediate
 
  
 Joined: 01 Mar 2007
 Posts: 475
 Topics: 9
 Location: Welsh Wales
 
 | 
			
				|  Posted: Mon Oct 01, 2018 5:13 am    Post subject: |   |  
				| 
 |  
				|  	  | expat wrote: |  	  | I assume that you have read the meaning for the IDC3006I message and checked that all is well regarding the reord keys. i.e. the key does exist. 
 Should you not leave a space before the REPRO keyword in your generated control statement.
 | 
 
 Did you try this ???  This is how I code my REPRO in REXX
 
  	  | Code: |  	  | "REPRO IFILE(IN) OFILE(TE) FROMKEY('"FKEY"') TOKEY('"FKEY"')"
 
 | 
 Should become
 
  	  | Code: |  	  | " REPRO IFILE(IN) OFILE(TE) FROMKEY('"FKEY"') TOKEY('"FKEY"')"
 
 | 
 _________________
 If it's true that we are here to help others,
 then what exactly are the others here for ?
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| Nic Clouston Advanced
 
 
 Joined: 01 Feb 2007
 Posts: 1075
 Topics: 7
 Location: At Home
 
 | 
			
				|  Posted: Mon Oct 01, 2018 9:54 am    Post subject: |   |  
				| 
 |  
				| and what does your trace say for these two items? _________________
 Utility and Program control cards are NOT, repeat NOT, JCL.
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  | 
	
		|  |