View previous topic :: View next topic
|
Author |
Message |
sakrat
Active User
Joined: 05 Feb 2014 Posts: 164 Location: India
|
|
|
|
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 |
|
|
TheMFKid
New User
Joined: 20 Nov 2013 Posts: 91 Location: India
|
|
|
|
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 |
|
|
sakrat
Active User
Joined: 05 Feb 2014 Posts: 164 Location: India
|
|
|
|
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.....
/*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 |
|
|
TheMFKid
New User
Joined: 20 Nov 2013 Posts: 91 Location: India
|
|
|
|
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 |
|
|
sakrat
Active User
Joined: 05 Feb 2014 Posts: 164 Location: India
|
|
|
|
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 |
|
|
sakrat
Active User
Joined: 05 Feb 2014 Posts: 164 Location: India
|
|
|
|
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 |
|
|
TheMFKid
New User
Joined: 20 Nov 2013 Posts: 91 Location: India
|
|
|
|
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 |
|
|
TheMFKid
New User
Joined: 20 Nov 2013 Posts: 91 Location: India
|
|
|
|
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 |
|
|
David Robinson
Active User
Joined: 21 Dec 2011 Posts: 199 Location: UK
|
|
|
|
Which job scheduler do you have? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
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 |
|
|
sakrat
Active User
Joined: 05 Feb 2014 Posts: 164 Location: India
|
|
|
|
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 |
|
|
sakrat
Active User
Joined: 05 Feb 2014 Posts: 164 Location: India
|
|
|
|
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 |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
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 |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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". |
|
Back to top |
|
|
TheMFKid
New User
Joined: 20 Nov 2013 Posts: 91 Location: India
|
|
|
|
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 |
|
Back to top |
|
|
TheMFKid
New User
Joined: 20 Nov 2013 Posts: 91 Location: India
|
|
|
|
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 |
rightly said. You can run your code with both IEFBR14 and IDCAMS and see for yourself how both utilities work. |
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
Back to top |
|
|
David Robinson
Active User
Joined: 21 Dec 2011 Posts: 199 Location: UK
|
|
|
|
That's why I asked what scheduler he used, but I did not get a reply. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
and without any scheduler concern
that ' s the reason I suggested to evaluate the use of
Gilbert Saint Flour CLEANUP |
|
Back to top |
|
|
sakrat
Active User
Joined: 05 Feb 2014 Posts: 164 Location: India
|
|
|
|
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 |
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 |
|
|
TheMFKid
New User
Joined: 20 Nov 2013 Posts: 91 Location: India
|
|
|
|
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 |
|
|
sakrat
Active User
Joined: 05 Feb 2014 Posts: 164 Location: India
|
|
|
|
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 |
|
|
|