IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

ISREDIT insert delete step


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 164
Location: India

PostPosted: Wed Feb 12, 2014 3:16 pm
Reply with quote

Hi,
I want to insert delete step in a JCL for which i have created a tool, but if suppose the dataset name is having symbolic parameters like &HLQ..&SS&ENV..JCL then i will have to change all those parameters and then use that dataset name in my delete step....how do i convert all those symbolic parameters into normal dataset and use it....can some please suggest me some idea of how to achieve this....
Back to top
View user's profile Send private message
TheMFKid

New User


Joined: 20 Nov 2013
Posts: 91
Location: India

PostPosted: Wed Feb 12, 2014 4:01 pm
Reply with quote

What is the issue in using IEFBR14?

Otherwise you can take all those symbolic parameters from your proc components and define the same in your rexx tool. This way you can replace everything in your tool itself.

Post the code so we will get the right picture.
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 164
Location: India

PostPosted: Wed Feb 12, 2014 5:13 pm
Reply with quote

In the code i will capture the dataset name and move it to stem variable by using which i will insert the delete step....But now my requirement is :
I will be having Symbolic parameters like &HLQ..&SS&ENV..JCL instead of mentioning it as TTE.IDFG.JCL i would have used SET statement for each qualifier so when i capture the dataset name by using my tool it would have been captured as &HLQ..&SS&ENV..JCL but i want it to be captured as TTE.IDFG.JCL ....how do i change each qualifier and capture it to insert the delete step in my JCL.....some please give me idea for achieving that.....


Code:

/*REXX*/
"ISREDIT MACRO"
TRACE (?R)
TEMP="NEW,CATLG,DELETE"
TEMP2=",CATLG,DELETE"
K=0
I=1
J=1
"ISREDIT SEEK ALL '"TEMP"' "
"ISREDIT (TOT) = SEEK_COUNTS"
SAY "TOT" TOT
CALL NEWPGM
"ISREDIT SEEK ALL WORD '"TEMP2"'"
"ISREDIT (CNT) = SEEK_COUNTS"
SAY "CNT" CNT
CALL CATLGPGM
INSLIN=K
TEMP1=EXEC
"ISREDIT FIND FIRST '"TEMP1"'"
IF RC=0 THEN DO
"ISREDIT (NUM) = LINENUM .ZCSR"
SAY NUM
NUM1=NUM-5
SAY NUM1
END
"ISREDIT CURSOR = "NUM1" 1"
"ISREDIT (LINE2) = LINE .ZCSR"
SAY LINE2
RES1=TOT+CNT+3
I=1
"ISREDIT LINE_BEFORE .ZCSR = '//JS0010 EXEC PGM=IDCAMS'"
"ISREDIT LINE_BEFORE .ZCSR = '//SYSPRINT DD SYSOUT=*'"
"ISREDIT LINE_BEFORE .ZCSR = '//SYSOUT DD SYSOUT=*'"
"ISREDIT LINE_BEFORE .ZCSR = '//SYSIN DD *'"
DO WHILE INSLIN > 0
OUT=' ' || DELETE ||' ' || OUTPUT.I
"ISREDIT LINE_BEFORE .ZCSR = '"OUT"' "
INSLIN=INSLIN-1
I=I+1
END
INS=" SET MAXCC=0"
"ISREDIT LINE_BEFORE .ZCSR = '"INS"' "
"ISREDIT LINE_BEFORE .ZCSR = '/*'"
"ISREDIT END"
EXIT
/* CALLS NEWPGM WHEN TEMP IS "NEW,CATLG,DELETE" */
NEWPGM:
I=1
COUNT=TOT
COUNT1=TOT
DO WHILE COUNT > 0
SAY "COUNT VALUE" COUNT
IF RC=0 THEN DO
"ISREDIT (VAL) = LINENUM .ZCSR"
VAL1=VAL-1
SAY VAL1
"ISREDIT (LINE) = LINE " VAL1
INPUT.I = STRIP(LINE)
PARSE VALUE "'"INPUT.I"'" WITH PREC ','
OUT=POS('=',PREC)
RES=SUBSTR(PREC,OUT+1)
SAY RES
PARSE VALUE "'"RES"'" WITH PRE '(' POST ')'
SAY POST
IF POST = "" THEN DO
OUTPUT.I=RES
K=K+1
COUNT=COUNT-1
I=I+1
J=I
END
ELSE DO
IF DATATYPE(POST) == NUM THEN DO
NOP
COUNT=COUNT-1
END
ELSE DO
OUTPUT.I=RES
K=K+1
COUNT=COUNT-1
I=I+1
J=I
END
END
END
"ISREDIT FIND NEXT '"TEMP"' "
END
RETURN
/* CALLS CATLGPGM WHEN TEMP IS ",CATLG,DELETE" */
CATLGPGM:
SAY "J VALUE" J
COUNT=CNT
COUNT1=CNT
DO WHILE COUNT > 0
IF RC=0 THEN DO
"ISREDIT (VAL) = LINENUM .ZCSR"
VAL1=VAL-1
SAY VAL1
"ISREDIT (LINE) = LINE " VAL1
INPUT.J = STRIP(LINE)
PARSE VALUE "'"INPUT.J"'" WITH PREC ','
OUT=POS('=',PREC)
RES=SUBSTR(PREC,OUT+1)
SAY RES
OUTPUT.J=RES
PARSE VALUE "'"RES"'" WITH PRE '(' POST ')'
SAY POST
IF POST = "" THEN DO
OUTPUT.J=RES
K=K+1
COUNT=COUNT-1
J=J+1
END
ELSE DO
IF DATATYPE(POST) == NUM THEN DO
NOP
COUNT=COUNT-1
END
ELSE DO
OUTPUT.J=RES
K=K+1
COUNT=COUNT-1
J=J+1
END
END
END
"ISREDIT FIND NEXT '"TEMP2"' "
END
RETURN
Back to top
View user's profile Send private message
TheMFKid

New User


Joined: 20 Nov 2013
Posts: 91
Location: India

PostPosted: Wed Feb 12, 2014 5:39 pm
Reply with quote

If you use IEFBR14 instead of IDCAMS, and use MOD,DELETE,DELETE disp parameter for each dataset, I guess you may not have to worry about sybmolic parms. You can use the same JCLLIB ORDER and INCLUDE in the job with IEFBR14 and do not worry about symbolic parms
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 164
Location: India

PostPosted: Wed Feb 12, 2014 5:49 pm
Reply with quote

TheMFKid wrote:
If you use IEFBR14 instead of IDCAMS, and use MOD,DELETE,DELETE disp parameter for each dataset, I guess you may not have to worry about sybmolic parms. You can use the same JCLLIB ORDER and INCLUDE in the job with IEFBR14 and do not worry about symbolic parms


i think you dont understand what i am trying to say.....Already there is a JCL with some nrely created files in it....so each when i run the JCL i have to delte those files..instead of doing that i decided to add the delete step with all the newly created DSN and delete it each time when the JCL is run....so in that how can i use IEFBR14 for deleting all the Dataset at the same time in a single step.....for that purpose only i have used IDCAMS to include in my JCL.....If suppose i have used some 100 newly creating Dataset in my JCL and while runnign the JCL each time i have to delte all those datasets so i am inserting this IDCAMS steps containing the delete dataset name of all those 100 newly creating datasets....since it is difficult to enter manually for all those 100 i created rexx tool for inserting that step by capturing the newly creating dataset alone from my JCL and writing delete dataset step using IDCAMS.....but if suppose i have specified my dataset name with symbolic parameter.....then capturing that DS and writing the delete step will be of no use so how do i change those DS containing the symbolic parameter to normal one and write the delete step.....
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 164
Location: India

PostPosted: Wed Feb 12, 2014 5:52 pm
Reply with quote

Code:
//*
//JS0010   EXEC PGM=IDCAMS
//SYSPRINT DD   SYSOUT=*
//SYSOUT   DD   SYSOUT=*
//SYSIN    DD   *
       DELETE TRE.UMON387.JCL2
       DELETE TRE.UMON387.JCL4
       DELETE TRE.UMON387.JCL3
       SET MAXCC=0
/*
//*
//*********************************************************
//*   THIS STEP WILL CREATE A NEW DATASET
//*
//************************************************************
//JS0010   EXEC PGM=IEFBR14
//DD1      DD   DSN=TRE.UMON387.JCL2,
//        DISP=(NEW,CATLG,DELETE),
//        SPACE=(TRK,(1,2),RLSE),
//        DCB=(LRECL=80,RECFM=FB,BLKSIZE=800)
//JS0020   EXEC PGM=IEFBR14
//DD2      DD   DSN=TRE.UMON387.JCL3,
//        DISP=(,CATLG,DELETE),
//        SPACE=(TRK,(1,2),RLSE),
//        DCB=(LRECL=80,RECFM=FB,BLKSIZE=800)
//JS0030   EXEC PGM=IEFBR14
//DD2      DD   DSN=TRE.UMON387.JCL4,
//        DISP=(NEW,CATLG,DELETE),
//        SPACE=(TRK,(1,2),RLSE),
//        DCB=(LRECL=80,RECFM=FB,BLKSIZE=800)
//JS0040   EXEC PGM=IEFBR14
//DD3      DD   DSN=TRE.UMON387.JCL(+1),
//        DISP=(NEW,CATLG,DELETE),
//        SPACE=(TRK,(1,2),RLSE),
//        DCB=(LRECL=80,RECFM=FB,BLKSIZE=800)




This is how my JCL will look like when i execute the above rexx tool....so my delete step using IDCAMS is inserted in the JCL....but what if i use symbolic parameter how should i change it.....
Back to top
View user's profile Send private message
TheMFKid

New User


Joined: 20 Nov 2013
Posts: 91
Location: India

PostPosted: Wed Feb 12, 2014 5:57 pm
Reply with quote

Swathi Muralidharan wrote:
so in that how can i use IEFBR14 for deleting all the Dataset at the same time in a single step.....for that purpose only i have used IDCAMS to include in my JCL.....If suppose i have used some 100 newly creating Dataset in my JCL and while runnign the JCL each time i have to delte all those datasets so i am inserting this IDCAMS steps containing the delete dataset name of all those 100 newly creating datasets......


You can delete any number of datasets in same IEFBR14 step. All you need to do is define all those datasets as DD statements automatically using REXX.
If you want you can also code ADDRESS TSO DELETE 'data set name' line in your rexx code and remove all those IDCAMS steps. This will directly delete the datasets within rexx code.
Back to top
View user's profile Send private message
TheMFKid

New User


Joined: 20 Nov 2013
Posts: 91
Location: India

PostPosted: Wed Feb 12, 2014 6:02 pm
Reply with quote

a little tweek in your code:
Code:

I=1
"ISREDIT LINE_BEFORE .ZCSR = '//JS0010 EXEC PGM=IEFBR14"
"ISREDIT LINE_BEFORE .ZCSR = '//SYSPRINT DD SYSOUT=*'"
"ISREDIT LINE_BEFORE .ZCSR = '//SYSOUT DD SYSOUT=*'"
DO WHILE INSLIN > 0
OUT="//DD"||I||"   DISP=(MOD,DELETE,DELETE),DSN="||OUTPUT.I
"ISREDIT LINE_BEFORE .ZCSR = '"OUT"' "
INSLIN=INSLIN-1
I=I+1
END
[/code]
Back to top
View user's profile Send private message
David Robinson

Active User


Joined: 21 Dec 2011
Posts: 199
Location: UK

PostPosted: Wed Feb 12, 2014 6:21 pm
Reply with quote

Which job scheduler do you have?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Wed Feb 12, 2014 7:38 pm
Reply with quote

if You are able to get the proper authorizations to install it and use it
look at Gilbert Saint Flour ( RIP ) freeware

www.gsf-soft.com/Freeware/

for the cleanup program

Quote:
CLEANUP Assembler program. Automatically searches the MVS
catalog for non-GDG data sets that will be created
in subsequent steps of your job and deletes them.
HSM-migrated data sets are deleted with HDELETE.

//MYJOB JOB acct#
//*
//CLEANUP EXEC PGM=CLEANUP
//*
//STEP1 EXEC PGM=MYPROG1
//OUTDD DD DSN=MY.FILE1,DISP=(,CATLG)
//STEP2 EXEC PGM=MYPROG2
//OUTDD DD DSN=MY.FILE2,DISP=(,CATLG)

Can also be executed as the LAST step of a job to
delete non-GDG data sets that were created during
job execution.


very reliable ...
started using it more than 10 years ago and survived all the operating systems migrations
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 164
Location: India

PostPosted: Wed Feb 12, 2014 9:13 pm
Reply with quote

TheMFKid wrote:
a little tweek in your code:
Code:

I=1
"ISREDIT LINE_BEFORE .ZCSR = '//JS0010 EXEC PGM=IEFBR14"
"ISREDIT LINE_BEFORE .ZCSR = '//SYSPRINT DD SYSOUT=*'"
"ISREDIT LINE_BEFORE .ZCSR = '//SYSOUT DD SYSOUT=*'"
DO WHILE INSLIN > 0
OUT="//DD"||I||"   DISP=(MOD,DELETE,DELETE),DSN="||OUTPUT.I
"ISREDIT LINE_BEFORE .ZCSR = '"OUT"' "
INSLIN=INSLIN-1
I=I+1
END
[/code]


Hi,
Thank you for helping me with the code what you said is right i can do the same process with IEFBR14.....But the project which i work in uses always IDCAMS for delete i dont whether they will accept this or not....I also have a doubt here....If i use IEFBR14 how do you say that it will delete properly even if i use symbolic parameter.....
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 164
Location: India

PostPosted: Wed Feb 12, 2014 9:22 pm
Reply with quote

TheMFKid wrote:
If you use IEFBR14 instead of IDCAMS, and use MOD,DELETE,DELETE disp parameter for each dataset, I guess you may not have to worry about sybmolic parms.



How do you say that there will not be any problem regarding symbolic parameter.....
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1787
Location: Bloomington, IL

PostPosted: Wed Feb 12, 2014 9:32 pm
Reply with quote

Swathi Muralidharan wrote:
TheMFKid wrote:
If you use IEFBR14 instead of IDCAMS, and use MOD,DELETE,DELETE disp parameter for each dataset, I guess you may not have to worry about sybmolic parms.



How do you say that there will not be any problem regarding symbolic parameter.....

Think for a moment about what this would look like icon_rolleyes.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Thu Feb 13, 2014 12:56 am
Reply with quote

Hello,

Quote:
You can delete any number of datasets in same IEFBR14 step.
Well, not quite . . . . If you try too many, it will fail.

The max is over 3000. And i do not believe we need another rambling of just how many DDs are ok "depending". icon_cool.gif
Back to top
View user's profile Send private message
TheMFKid

New User


Joined: 20 Nov 2013
Posts: 91
Location: India

PostPosted: Thu Feb 13, 2014 11:07 am
Reply with quote

Swathi Muralidharan wrote:
TheMFKid wrote:
If you use IEFBR14 instead of IDCAMS, and use MOD,DELETE,DELETE disp parameter for each dataset, I guess you may not have to worry about sybmolic parms.



How do you say that there will not be any problem regarding symbolic parameter.....


In case of IDCAMS you are coding dataset names with symbolic parameters inside SYSIN DD *, and these variables will not expand when used within SYSIN DD *. In case of IEFBR14, this will not be the case as dataset names are coded in DD statements.
Hope now its clear icon_smile.gif
Back to top
View user's profile Send private message
TheMFKid

New User


Joined: 20 Nov 2013
Posts: 91
Location: India

PostPosted: Thu Feb 13, 2014 11:23 am
Reply with quote

Akatsukami wrote:
Swathi Muralidharan wrote:
TheMFKid wrote:
If you use IEFBR14 instead of IDCAMS, and use MOD,DELETE,DELETE disp parameter for each dataset, I guess you may not have to worry about sybmolic parms.



How do you say that there will not be any problem regarding symbolic parameter.....

Think for a moment about what this would look like icon_rolleyes.gif


rightly said. You can run your code with both IEFBR14 and IDCAMS and see for yourself how both utilities work.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Thu Feb 13, 2014 3:11 pm
Reply with quote

Are we rewriting EQQDELDS ?
publib.boulder.ibm.com/tividd/td/TWS/SC32-1265-00/en_US/HTML/Eqqc1mst322.htm
Back to top
View user's profile Send private message
David Robinson

Active User


Joined: 21 Dec 2011
Posts: 199
Location: UK

PostPosted: Thu Feb 13, 2014 5:26 pm
Reply with quote

GuyC wrote:
Are we rewriting EQQDELDS ?
publib.boulder.ibm.com/tividd/td/TWS/SC32-1265-00/en_US/HTML/Eqqc1mst322.htm


That's why I asked what scheduler he used, but I did not get a reply.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Thu Feb 13, 2014 5:34 pm
Reply with quote

and without any scheduler concern
that ' s the reason I suggested to evaluate the use of
Gilbert Saint Flour CLEANUP
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 164
Location: India

PostPosted: Tue Feb 18, 2014 11:52 am
Reply with quote

TheMFKid wrote:
Swathi Muralidharan wrote:
TheMFKid wrote:
If you use IEFBR14 instead of IDCAMS, and use MOD,DELETE,DELETE disp parameter for each dataset, I guess you may not have to worry about sybmolic parms.



How do you say that there will not be any problem regarding symbolic parameter.....


In case of IDCAMS you are coding dataset names with symbolic parameters inside SYSIN DD *, and these variables will not expand when used within SYSIN DD *. In case of IEFBR14, this will not be the case as dataset names are coded in DD statements.
Hope now its clear icon_smile.gif



Hi,
I am in need of using only IDCAMS in my code as we are not allowed to used IEFBR14 in delete step in our working environment.....so kindly help me with this problem to solve the issue by using IDCAMS itself...
Back to top
View user's profile Send private message
TheMFKid

New User


Joined: 20 Nov 2013
Posts: 91
Location: India

PostPosted: Tue Feb 18, 2014 11:57 am
Reply with quote

Swathi Muralidharan wrote:
I am in need of using only IDCAMS in my code as we are not allowed to used IEFBR14 in delete step in our working environment.....so kindly help me with this problem to solve the issue by using IDCAMS itself...


Then I guess you may need to define all your symbolic variables in your REXX program so they would be populated with value.
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 164
Location: India

PostPosted: Tue Feb 18, 2014 12:00 pm
Reply with quote

TheMFKid wrote:
Swathi Muralidharan wrote:
I am in need of using only IDCAMS in my code as we are not allowed to used IEFBR14 in delete step in our working environment.....so kindly help me with this problem to solve the issue by using IDCAMS itself...


Then I guess you may need to define all your symbolic variables in your REXX program so they would be populated with value.


But it would vary for each JCL right..In some JCL i might use three set statements for symbolic parameter and in some more than 3 or n number of SET statements.....so in that case it will not be possible to defind the symbolic variables in REXX....
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Starting a PROC with parameters from ... CLIST & REXX 6
No new posts DELETE SPUFI DB2 1
No new posts DSNTIAUL driven delete IBM Tools 0
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts How to delete a user's alias from the... JCL & VSAM 11
Search our Forums:

Back to Top