View previous topic :: View next topic |
Author |
Message |
deepa12 Beginner
Joined: 05 Apr 2005 Posts: 131 Topics: 64 Location: chennai
|
Posted: Wed Sep 05, 2018 12:37 am Post subject: VSAM record delete using insync from REXX |
|
|
i tried to delete a record using INSYNC and invoking the same from a REXX program I am getting an error as below.
Clause too long
49 : "CALL 'OEML.INSYNC.V6800C.SMINLOAD(INSYNC)' 'MVS REGION=0M'"
I have also allocated OEML.INSYNC.V6800C.SMINLOAD in my 1st time clist to ISPLLIB
I have provided the REXX code for the same
Pls help me rectify the problem
Code: |
/**REXX**/
DSN1 = USERID() || ".PARMIN"
SIGNAL ON ERROR
SIGNAL ON SYNTAX
SIGNAL ON FAILURE
/* tsoe msg tracking*/
msgval=msg(on)
trapit = OUTTRAP('line.')
trapmsg_stat = TRAPMSG('ON')
ADDRESS TSO
"ALLOC DA('"DSN1"') UNIT(TEMP) SPACE(4 4) CY FI(#PARM) NEW REU"
ADDRESS
PRM.0 =7
PRM.1='FUNCTION=DELETE'
PRM.2='RDW=OFF'
PRM.3='LANGUAGE=COB'
PRM.4='LINESPERPAGE=00065'
PRM.5='FORMATDSN=(ZX.PROD.COPY)'
PRM.6='FORMATMBR=(PZRECORD)'
PRM.7="SEARCHDATA=(PRODUCT-ID-PZ,EQ,Z'0001824')"
"EXECIO * DISKW #PARM (FINIS STEM PRM."
ADDRESS TSO
"FREE DD(#PARM)"
ADDRESS
X = OUTTRAP("CMD.");
ADDRESS TSO
X=OUTTRAP("OFF")
"ALLOC DA('OEML.INSYNC.V6800C.SMINLOAD') DD(#LLIBDD) SHR REU"
"ALLOC DA('OEML.INSYNC.V6800C.SMINEXEC') DD(#ELIBDD) SHR REU"
"ALLOC UNIT(TEMP) SPACE(4 4) CY DD(#LOG) NEW REU"
"ALLOC UNIT(TEMP) SPACE(4 4) CY DD(#PRINT) NEW REU"
"ALLOC UNIT(TEMP) SPACE(4 4) CY DD(#STATS) NEW REU"
"ALLOC DA('XE57.PZFILE') DD(INDD) SHR REU"
"ALLOC DA('CICST.X7.PZFILE.BKUP') DD(OUTDD) SHR REU"
"ALLOC DA('"DSN1"') DD(#PARM) SHR REU"
SAY RC
PARM1=MVS
ADDRESS TSO
"CALL 'OEML.INSYNC.V6800C.SMINLOAD(INSYNC)' 'MVS REGION=0M'"
DO I = 1 to cmd.0
say cmd.i
end
DO I = 1 to line.0
say line.i
end
ADDRESS
SIGNAL OFF
trapit =OUTTRAP('OFF')
trapmsg_stat = TRAPMSG('OFF')
ADDRESS TSO
"FREE DD(#LLIBDD)"
"FREE DD(#ELIBDD)"
"FREE DD(#LOG)"
"FREE DD(#PRINT)"
"FREE DD(#STATS)"
"FREE DD(INDD)"
"FREE DD(OUTDD)"
"FREE DD(#PARM)"
ADDRESS
ERROR:
SAY ERROR
if rc > 0 then
SAY ERRORTEXT(RC)
if sigl > 0 then
say sigl ":" SOURCELINE(sigl)
DO I = 1 to cmd.0
say cmd.i
end
DO I = 1 to line.0
say line.i
end
EXIT
SYNTAX:
SAY SYNTAX
if rc > 0 then
do
SAY ERRORTEXT(RC)
end
if sigl > 0 then
say SOURCELINE(sigl)
DO I = 1 to cmd.0
say cmd.i
end
DO I = 1 to line.0
say line.i
end
EXIT
FAILURE:
SAY FAILURE
if rc > 0 then
SAY ERRORTEXT(RC)
if sigl > 0 then
say SOURCELINE(sigl)
DO I = 1 to cmd.0
say cmd.i
end
DO I = 1 to line.0
say line.i
end
EXIT
|
_________________ deepa |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Wed Sep 05, 2018 11:48 am Post subject: |
|
|
deepa12,
How many times are we going to have this discussion about your topic titles? You will loose your privileges to post on this board if you continue with the same weird/chat language titles. Remember that this is the last time I am going to warn you about this. Here is a snap shot of this discussion before
As for debugging you could use TRACE I command to debug your rexx.
Unless Insync is reading the REGION=0M as a parm you are incorrectly passing the parameter. The call statement should be
Code: |
"CALL 'OEML.INSYNC.V6800C.SMINLOAD(INSYNC)' 'MVS'"
|
_________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
deepa12 Beginner
Joined: 05 Apr 2005 Posts: 131 Topics: 64 Location: chennai
|
Posted: Thu Sep 06, 2018 1:51 am Post subject: |
|
|
Sorry and will be careful.
I have tried this But for this also it gives me the same error
Please suggest _________________ deepa |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Thu Sep 06, 2018 2:47 am Post subject: |
|
|
show the trace. _________________ 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: Thu Sep 06, 2018 3:56 am Post subject: |
|
|
The following is the trace dump for trace I
Code: |
3 *-* DSN1 = USERID() || ".PARMIN"
>F> "XE57"
>L> ".PARMIN"
>O> "XE57.PARMIN"
***
4 *-* SIGNAL ON ERROR
5 *-* SIGNAL ON SYNTAX
6 *-* SIGNAL ON FAILURE
7 *-* /* tsoe msg tracking*/
8 *-* msgval=msg(on)
>L> "ON"
>F> "ON"
9 *-* trapit = OUTTRAP('line.')
>L> "line."
>F> "LINE."
10 *-* trapmsg_stat = TRAPMSG('ON')
>L> "ON"
>F> "OFF"
12 *-* X = OUTTRAP("CMD.")
>L> "CMD."
>F> "CMD."
13 *-* ADDRESS TSO
14 *-* X=OUTTRAP("OFF")
>L> "OFF"
>F> "OFF"
15 *-* "ALLOC DA('OEML.INSYNC.LOADLIB') DD(#LLIBDD) SHR REU"
>L> "ALLOC DA('OEML.INSYNC.LOADLIB') DD(#LLIBDD) SHR REU"
16 *-* "ALLOC DA('OEML.INSYNC.ELIB') DD(#ELIBDD) SHR REU"
***
>L> "ALLOC DA('OEML.INSYNC.ELIB') DD(#ELIBDD) SHR REU"
17 *-* "ALLOC UNIT(TEMP) SPACE(4 4) CY DD(#LOG) NEW REU"
>L> "ALLOC UNIT(TEMP) SPACE(4 4) CY DD(#LOG) NEW REU"
18 *-* "ALLOC UNIT(TEMP) SPACE(4 4) CY DD(#PRINT) NEW REU"
>L> "ALLOC UNIT(TEMP) SPACE(4 4) CY DD(#PRINT) NEW REU"
19 *-* "ALLOC UNIT(TEMP) SPACE(4 4) CY DD(#STATS) NEW REU"
>L> "ALLOC UNIT(TEMP) SPACE(4 4) CY DD(#STATS) NEW REU"
20 *-* "ALLOC DA('XE57.PZFILE') DD(INDD) SHR REU"
>L> "ALLOC DA('XE57.PZFILE') DD(INDD) SHR REU"
21 *-* "ALLOC DA('CICST.X7.PZFILE.BKUP') DD(OUTDD) SHR REU"
>L> "ALLOC DA('CICST.X7.PZFILE.BKUP') DD(OUTDD) SHR REU"
22 *-* "ALLOC DA('"DSN1"') DD(#PARM) SHR REU"
>L> "ALLOC DA('"
>V> "XE57.PARMIN"
>O> "ALLOC DA('XE57.PARMIN"
>L> "') DD(#PARM) SHR REU"
>O> "ALLOC DA('XE57.PARMIN') DD(#PARM) SHR REU"
23 *-* SAY RC
>V> "0"
0
25 *-* PARM1=MVS
>L> "MVS"
26 *-* ADDRESS TSO
***
27 *-* "CALL 'OEML.INSYNC.LOADLIB(INSYNC)' 'MVS'"
>L> "CALL 'OEML.INSYNC.LOADLIB(INSYNC)' 'MVS'"
+++ RC(12) +++
50 *-* ERROR:
51 *-* SAY ERROR
>L> "ERROR"
ERROR
52 *-* if rc > 0
>V> "12"
>L> "0"
>O> "1"
*-* then
53 *-* SAY ERRORTEXT(RC)
>V> "12"
>F> "Clause too long"
Clause too long
54 *-* if sigl > 0
>V> "27"
>L> "0"
>O> "1"
*-* then
55 *-* say sigl ":" SOURCELINE(sigl)
>V> "27"
***
>L> ":"
>O> "27 :"
>V> "27"
>F> " "CALL 'OEML.INSYNC.LOADLIB(INSYNC)' 'MVS'"
"
>O> "27 : "CALL 'OEML.INSYNC.LOADLIB(INSYNC)' 'MVS'"
"
27 : "CALL 'OEML.INSYNC.LOADLIB(INSYNC)' 'MVS'"
56 *-* DO I = 1 to cmd.0
>L> "1"
>V> "0"
59 *-* DO I = 1 to line.0
>L> "1"
>V> "0"
62 *-* EXIT
***
|
Without trace it shows
Clause too long
27 : "CALL 'OEML.INSYNC.LOADLIB(INSYNC)' 'MVS'"
*** _________________ deepa |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Thu Sep 06, 2018 3:38 pm Post subject: |
|
|
deepa12,
Couple of issues.
1. I think INSYNC needs SYSTSPRT dd which you haven't allocated. This actually will show you more information messages about what went wrong with your call.
2. I would just try with simple exec to see if I can even invoke the program INSYNC
so try this
Code: |
/* REXX EXEC TO INVOKE INSYNC */
TRACE I
"ALLOC F(#ELIBDD) DA('OEML.INSYNC.V6800C.SMINEXEC') SHR REUSE"
"ALLOC F(SYSTSPRT) DA(*)"
"ALLOC F(#LOG) DA(*)"
"ALLOC F(#PRINT) DA(*)"
"ALLOC F(#INDD) DA('XE57.PZFILE') SHR REUSE"
"ALLOC F(#OUTDD) DA('XE57.PZFILE.BKUP') SHR REUSE"
DSN1 = USERID() || ".PARMIN"
"ALLOC FILE(#PARM) DA('"DSN1"') SPACE(1 1) CY",
"NEW CATALOG RELEASE RECFM(F B) LRECL(80) BLK(27920) DSORG(PS)",
"UNIT(TEMP) REUS"
PRM.1='FUNCTION=DELETE'
PRM.2='RDW=OFF'
PRM.3='INDD=#INDD'
PRM.4='OUTDD=#OUTDD'
PRM.5='LANGUAGE=COB'
PRM.6='LINESPERPAGE=00065'
PRM.7='FORMATDSN=(ZX.PROD.COPY)'
PRM.8='FORMATMBR=(PZRECORD)'
PRM.9="SEARCHDATA=(PRODUCT-ID-PZ,EQ,Z'0001824')"
"EXECIO * DISKW #PARM (STEM PRM. FINIS"
"CALL 'OEML.INSYNC.LOADLIB(INSYNC)'"
SAY RC
|
_________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
deepa12 Beginner
Joined: 05 Apr 2005 Posts: 131 Topics: 64 Location: chennai
|
Posted: Fri Sep 07, 2018 2:30 am Post subject: |
|
|
1. Thanks a lot. Its working now.
I made some changes & hence reproducing the code. It is throwing STATS,LOG,PRINT DATASET contents on screen since it is allocated as DA(*)
I tried changing it to
ALLOC F(#PRINT) DUMMY
Then it gave RC 12
Pls suggest
Code: | /**REXX**/
/* REXX EXEC TO INVOKE INSYNC */
MSGSTAT=MSG(OFF)
X = OUTTRAP("CMD.");
TRACE I
"ALLOC F(#ELIBDD) DA('OEML.INSYNC.ELIB') SHR REUSE"
"ALLOC F(SYSTSPRT) DA(*) SHR REU"
"ALLOC F(#LOG) DA(*)"
"ALLOC F(#PRINT) DA(*)"
"ALLOC F(#STATS) DA(*)"
"ALLOC F(#INDD) DA('XE57.PZFILE') SHR REUSE"
"ALLOC F(#OUTDD) DA('XE57.PZFILE.BKUP') SHR REUS"
CALL MAKE_PARM
"CALL 'OEML.INSYNC.LOADLIB(INSYNC)'"
SAY RC
X = OUTTRAP("OFF");
"FREE F(#PARM)"
"FREE F(#ELIBDD)"
"FREE F(SYSTSPRT)"
"FREE F(#LOG)"
"FREE F(#PRINT)"
"FREE F(#STATS)"
"FREE F(#INDD)"
"FREE F(#OUTDD)"
EXIT
MAKE_PARM:
TRACE ?R
ADDRESS TSO
"ALLOC FILE(#PARM) SPACE(1 1) CY NEW CATALOG RELEASE RECFM(F B)",
"BLK(27920) DSORG(PS) UNIT(TEMP) REUS"
ADDRESS
PRM.0 =9
PRM.1='FUNCTION=DELETE'
PRM.2='RDW=OFF'
PRM.3='INDD=#INDD'
PRM.4='OUTDD=#OUTDD'
PRM.5='LANGUAGE=COB'
PRM.6='LINESPERPAGE=00065'
PRM.7='FORMATDSN=(ZX.PROD.COPY)'
PRM.8='FORMATMBR=(PZRECORD)'
PRM.9="SEARCHDATA=(PRODUCT-ID-PZ,EQ,Z'0019736')"
"EXECIO * DISKW #PARM (FINIS STEM PRM."
ADDRESS
TRACE OFF
RETURN
|
2. In this scenario how do we translate the JCL STEP region PARM of 0M, so that maximum memory will be given to this REXX
3. I extend this to request for more advise.
The application is a single user application in ISPF, REXX to maintain a VSAM FILE
We are using REPRO to read 1 record & then modify & replace/ insert that into VSAM Cluster
For delete option we are thinking of INSYNC or REPRO or Easytrieve
In case of REPRO we unload the entire cluster data into stem variable and take a copy into sequential file.
Then omit the record to be deleted record & repro it back into the cluster
In case of Insync, it also takes a copy into PS But memory large enough to hold the stem variable is not required
I do understand that DSC copy in FILE Manager is also an option to delete but when i tried, it also requires a copy to be taken & creates another dataset
Which one will be a better option _________________ deepa |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Fri Sep 07, 2018 3:46 am Post subject: |
|
|
Why all the ADDRESS TSO? You are already in TSO and that is where your commands will go unless you change to another command processor e.g. ISPEXEC.
Also, nothing is being 'thrown', it is being 'displayed'. Things are not thrown on the mainframe unless you are using C or Java in OMVS (actually, 'throw' is not known to C so that just leaves Java and any other OO language on OMVS). _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Fri Sep 07, 2018 12:05 pm Post subject: |
|
|
deepa12 wrote: | 1. Thanks a lot. Its working now.
I made some changes & hence reproducing the code. It is throwing STATS,LOG,PRINT DATASET contents on screen since it is allocated as DA(*)
|
As Nic pointed out, please use correct terms. The Errors are DISPLAYED and are not thrown.
deepa12 wrote: |
I tried changing it to
ALLOC F(#PRINT) DUMMY
Then it gave RC 12
Pls suggest |
Your TRACE I should have given you a detailed explanation of what the error is. It is a simple ALLOCATE syntax and by now you should be able to refer the manuals and look up the right syntax.
Go to SYS1.HELP dataset from 3.4 and look up ALLOCATE member and read upon it.
Or you can simply type TSO HELP ALLOC and it will show you the same contents from sys1.help dataset.
Try this
Code: |
"ALLOC F(#PRINT) DUMMY REUSE"
"ALLOC F(#STATS) DUMMY REUSE"
"ALLOC F(#LOG) DUMMY REUSE"
|
deepa12 wrote: |
2. In this scenario how do we translate the JCL STEP region PARM of 0M, so that maximum memory will be given to this REXX
|
Your rexx runs under TSO and your region size depends on your LOGON Procedure. If your shop allows you can change the SIZE parm to increase your TSO region size to max. Try input all 9's for size and see if it allows
Code: |
------------------------------- TSO/E LOGON -----------------------------------
Enter LOGON parameters below: RACF LOGON parameters:
Userid ===> xxxxx
Password ===> New Password ===>
Procedure ===> TSOLOGON Group Ident ===>
Acct Nmbr ===> xxx/XXX//xxx
Size ===> 2096120
Perform ===>
Command ===> ispf
Enter an 'S' before each option desired below:
-Nomail -Nonotice S -Reconnect -OIDcard
PF1/PF13 ==> Help PF3/PF15 ==> Logoff PA1 ==> Attention PA2 ==> Reshow
You may request specific help information by entering a '?' in any entry field
|
deepa12 wrote: |
3. I extend this to request for more advise.
The application is a single user application in ISPF, REXX to maintain a VSAM FILE
We are using REPRO to read 1 record & then modify & replace/ insert that into VSAM Cluster
For delete option we are thinking of INSYNC or REPRO or Easytrieve
In case of REPRO we unload the entire cluster data into stem variable and take a copy into sequential file.
Then omit the record to be deleted record & repro it back into the cluster
In case of Insync, it also takes a copy into PS But memory large enough to hold the stem variable is not required
I do understand that DSC copy in FILE Manager is also an option to delete but when i tried, it also requires a copy to be taken & creates another dataset
Which one will be a better option |
I am not even sure as to why you want to use REXX in the first place and all this nonsense of reading into the stem and updating when you can run the same in BATCH. You do realize that REXX is interpreted(unless you compiled the exec into a load module) every time and it runs like a SNAIL if you are processing millions of records.
Run all 3 variations multiple times and compare the CPU/Elapsed times for each run and pick the best solution. You have the input files and the software that needs to be compared where most of us don't even have the software to run or compare.
Pick a solution that is easier to understand and maintain. If you are writing an easytrieve program , make sure you write it in the optimal way with respect to the usage of excps. _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
|
|