View previous topic :: View next topic
|
Author |
Message |
Atpsmp
New User
Joined: 23 Sep 2008 Posts: 14 Location: Chennai
|
|
|
|
hi all,
I have created a tool in which the Production JCL's will be converted to Test Regions. It will be prompting the users for the input like High Level Qualifier, etc etc.
In concern of this, in my Mainframe ID, there is a option called "JOBCARD". By simply typing the command JOBCARD in the command line, the jobcard which contains the User Information will be added in the JCL.
I want this command to be invoked in the REXX routine such that, after all my PDS members getting copied, as a first step, the jobcard should be changed.
I coded like below:
Code: |
JUNK_JC = OUTTRAP(JB_LINE.)
ADDRESS TSO "JOBCARD"
JUNK_JC = OUTTRAP("OFF")
|
But it not capturing the job card.
Can anyone throw light on the resolution or suggest any other way to satisfy my request. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
This is some sort of site-specific routine, so you need to contact your site support group to find out how to use it. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Atpsmp wrote: |
... there is a option called "JOBCARD". By simply typing the command JOBCARD in the command line, the jobcard which contains the User Information will be added in the JCL. |
OK, time for a dumb question. When you type the command "JOBCARD", how does it know what member of what PDS you want the jobcard to go to? Are there parameters you have to pass to it? I noticed you tried to OUTTRAP it. Does it just display the jobcard details onto the screen, where I guess you would cut-and-paste them into the job? |
|
Back to top |
|
|
Debabrata Pruseth
New User
Joined: 11 Dec 2008 Posts: 59 Location: Pune , India
|
|
|
|
I have a similar JOBCARD ISPF macro. The member is defined in my CLIST library allocated to TSO/ISPF profile.
Code: |
VIEW VND6Z5.CLIST(JOBCARD) - 01.10 Columns 00001 00072
Command ===> Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 /* */
000002 /* INSERTS A JOBCARD AT TOP OF MEMBER */
000003 /* */
000004 ISREDIT MACRO
000005 CONTROL NOCONLIST
000006 ISREDIT RECOVERY OFF
000007 ISREDIT RESET
000008 INSERT: +
000009 ISREDIT LINE_AFTER 0 = "//VND6Z5J1 JOB (DWARD,SYS),'DEBABRATA' "
000010 ISREDIT LINE_AFTER 1 = "// CLASS=6, "
000011 ISREDIT LINE_AFTER 2 = "// MSGCLASS=T, "
000012 ISREDIT LINE_AFTER 3 = "// NOTIFY=&SYSUID, "
000013 ISREDIT LINE_AFTER 4 = "// MSGLEVEL=(1,1) "
000014 ISREDIT LINE_AFTER 5 = "//* "
000015 EXIT CODE(0)
****** **************************** Bottom of Data **************************** |
Inside any PDS member if you type JOBCARD in the command line it inserts the jobcard defined in the above JOBCARD member . Rest of the data in the new member can be filled accordingly as per requirement. I think Atpsmp wants to invoke this macro logic in another process to build the jobcard and the job details together in a new member. If anyone can provide the technique it will be a great help to me also. |
|
Back to top |
|
|
Atpsmp
New User
Joined: 23 Sep 2008 Posts: 14 Location: Chennai
|
|
|
|
Hey hi..
I can invoke the JOBCARD command in one member at a time by entering the JOBCARD in the respective member command line.(See the below)
Code: |
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
VIEW U174821.REXX.SAMPLE.PDS(PUREX1) - 01.24 Columns 00001 00072
Command ===> jobcard Scroll ===> CSR
****** ***************************** Top of Data *****************************
000001 //U174821 JOB CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1)
000002 //* REGION=256K
000003 //SYSIN DD SYSOUT=O
000004 //DELS EXEC EQQDELDS
000005 //S1 EXEC PGM=IEFBR14
000006 //SYSUT1 DD DISP=(NEW,CATLG,DELETE),DSN=TA.HANDSON.JCL1.PS,
|
I can use this command if i keep the code as a macro. I have tried it... its working fine.
What my concern is, am copying the PDS which contains 'n' members, so that macro cannot be invoked. So am not able to use the macro too.
I have to insert the jobcard by invoking JOBCARD command in all the members of my PDS which has been copied.
As my clarification regarding Superk doubt regarding OUTTRAP function,
I have coded as though it can display the jobcard by moving into a stem variable from OUTTRAP. But it is not getting displayed since it doesn't capture the lines. So i can't copy and paste too from the screen.
My requirement is in one shot all the members in a particular PDS should be copied and it should be converted to TEST JCL's. All my requirements are getting satisfied except this JOBCARD.(since it will take time to open each member and entering the JOBCARD in the command line, i want to do it as a whole for all members in a single go).....
Please anyone help me out....... |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
From a previous post - to conditionally update members, but you can easily change it to update whatever you want
Driving REXX exec - to list the PDS members and invoke the macro
Code: |
/* REXX *** LIST PDS AND INVOKE EDIT MACRO TO UPDATE MEMBERS */
Address Ispexec "Control Errors Return"
Pds = "pds name"
mac = 'UPDATPD1'
x = msg('off')
x=outtrap(list.)
"LISTDS '"Pds"' MEM "
x=outtrap(off)
Do aa = 7 to list.0
"Ispexec edit dataset('"Pds||"("||Strip(list.aa)||")') MACRO("mac")"
End |
And the macro itself - which obviously you will need to change to fit your own needs. Maybe just invoking JOBCARD will do it, without you needing to use this code.
Code: |
/* REXX *** ISPF EDIT MACRO */
"ISREDIT MACRO"
"ISREDIT F 'PGM=NOB' FIRST"
Rcx = RC
"ISREDIT F 'PGM=NEM' FIRST"
Rcy = RC
If Rcx = 0 & Rcy = 4 then do
"ISREDIT F 'PGM=' LAST"
"ISREDIT (CRSLINE) = " CURSOR
"ISREDIT COPY member BEFORE "CRSLINE
End
|
|
|
Back to top |
|
|
Atpsmp
New User
Joined: 23 Sep 2008 Posts: 14 Location: Chennai
|
|
|
|
HEY HI..
Thanks expat for your immediate response.
I have tried your logic as you mentioned below. It is working.. i have few concerns. See below:
1) Is it possible to do this JOBCARD with macro in my Full REXX routine including Copying the PDS and few other requirements which i did for the test version of the JCL??? Can i club the JOBCARD requirement with my entire logic???
2) JOBCARD command will just include the new job card. It wont delete or comment out the existing job card. I want the old job card to be deleted or commented out.. How to do this???? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Finds the first EXEC card and then deletes everything up until the EXEC card
Code: |
"ISREDIT F 'EXEC' FIRST"
IF RC <> 0 THEN EXIT
"ISREDIT (CRSLINE,CRSCOL) = CURSOR"
"ISREDIT CURSOR = 1"
DO A = 1 TO CRSLINE-1
"ISREDIT DELETE 1"
END
|
|
|
Back to top |
|
|
Atpsmp
New User
Joined: 23 Sep 2008 Posts: 14 Location: Chennai
|
|
|
|
hey hi,
I have done the changes what you told. See my observations below:
There are two members: MEM1 and MEM3.
MEM3 -> Macro
MEM1 -> REXX routine
See the MEM1 codings below(including the deletion of the job card and also the including of new job card)
Code: |
/* REXX */
"ISREDIT F 'JOB' FIRST"
IF RC <> 0 THEN EXIT
"ISREDIT (CRSLINE,CRSCOL) = CURSOR"
"ISREDIT CURSOR = 1"
DO A = 1 TO CRSLINE-1
"ISREDIT DELETE 1"
END
ADDRESS ISPEXEC "CONTROL ERRORS RETURN"
PDS = "U174821.REXX.SAMPLE.PDS1"
MAC = 'MEM3'
X = MSG('OFF')
X=OUTTRAP(LIST.)
"LISTDS '"PDS"' MEM "
X=OUTTRAP(OFF)
DO AA = 7 TO LIST.0
"ISPEXEC EDIT DATASET('"PDS||"("||STRIP(LIST.AA)||")') MACRO("MAC")"
END
|
See to the member MEM3 which has the macro:
Code: |
/* rexx */
ADDRESS ISREDIT
"MACRO"
"JOBCARD"
"SAVE"
"END"
|
The job card is inserted but hte new job card is not deleted. Any other changes should i do in the code? Have i done any mistake?? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
The code that I gave you should be executed as an edit macro. |
|
Back to top |
|
|
Atpsmp
New User
Joined: 23 Sep 2008 Posts: 14 Location: Chennai
|
|
|
|
Hi,
The existing job card is not getting deleted.
See my main code and the macro below:
My main code is:
Code: |
/* REXX */
/* DELETING THE JOB CARD ALONE - MAIN ROUTINE */
ADDRESS ISPEXEC "CONTROL ERRORS RETURN"
PDS = "U174821.REXX.JOBCARD.INPUT1.DTMAR2"
MAC = 'MEM5'
X = MSG('OFF')
X=OUTTRAP(LIST.)
"LISTDS '"PDS"' MEM "
X=OUTTRAP(OFF)
DO AA = 7 TO LIST.0
"ISPEXEC EDIT DATASET('"PDS||"("||STRIP(LIST.AA)||")') MACRO("MAC")"
END
|
My macro routine for this deleting the job card is:
Code: |
/* REXX */
/* DELETING THE JOB CARD - MACRO ROUTINE */
ADDRESS ISREDIT
"MACRO"
"ISREDIT F 'JOB' FIRST"
IF RC <> 0 THEN EXIT
"ISREDIT (CRSLINE,CRSCOL) = CURSOR"
"ISREDIT CURSOR = 1"
DO A = 1 TO CRSLINE-1
"ISREDIT DELETE 1"
END
|
Once i execute this macro, the job card is not getting deleted. INstead of that, it just points the first JOB occurence and highlights that particular word alone, thats it. (Pls find the attachment for your reference)
pls help me out.. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
expat wrote: |
Finds the first EXEC card and then deletes everything up until the EXEC card |
Beware of that, you may have a JOBLIB DD before the 1st EXEC! |
|
Back to top |
|
|
Atpsmp
New User
Joined: 23 Sep 2008 Posts: 14 Location: Chennai
|
|
|
|
hey hi all,
I got the whole tool. My job card is getting deleted by finding the JOB keyword..
A new job card is also inserted.
I have embedded these two concepts in my REXX tool, and it is working fine too.
Thanks a lot to everyone for your support. |
|
Back to top |
|
|
Atpsmp
New User
Joined: 23 Sep 2008 Posts: 14 Location: Chennai
|
|
|
|
There is one more concern reg the above issue.
See my code below for the edit macro:
Code: |
/* REXX */
/** JCLPREP EDIT MACRO TO DELETE THE EXISINT JOB CARD **/
/** AND INSERTING THE NEW JOB CARD **/
ADDRESS ISREDIT
"MACRO"
"F ' JOB ' FIRST"
IF RC = 0 THEN
DO
"LABEL .ZCSR = .JS"
"FIND P'¬' 3 3 "
"(CR CC) = CURSOR"
CR = CR - 1
"LABEL " CR " = .JE"
"(JS) = LINENUM .JS"
IF JS = 0 THEN
"DELETE ALL .JE .JE"
ELSE
"DELETE ALL .JS .JE"
ADDRESS ISREDIT
"JOBCARD"
"SAVE"
"END"
END
|
After deleting the existing job card, i want to inser the new job card. IN my client mainframe , after mentioning JOBCARD in command line, i have to specify the label 'A' or 'B' such that it will be inserting the job card after or before respectively. How can i do this????
I have to add this code after deleing the job card functionality. |
|
Back to top |
|
|
Atpsmp
New User
Joined: 23 Sep 2008 Posts: 14 Location: Chennai
|
|
|
|
Prior to the below reply, the label should be set as A or B such that it adds the job card after deleting the existing job card as shown below (reg label)
Code: |
Command ===> jobcard Scroll ===> CSR
****** ***************************** Top of Data ******************************
00A001 /* REXX */
000002 /** JCLPREP EDIT MACRO TO DELETE THE EXISINT JOB CARD **/
000003 /** AND INSERTING THE NEW JOB CARD **/
000004
|
|
|
Back to top |
|
|
Fathima Begum S
New User
Joined: 02 May 2012 Posts: 3 Location: India
|
|
|
|
Hi Atpsmp
When i try to use the code for inserting the jobcard, i m getting the error
IKJ56500I COMMAND CONTROL NOT FOUND
5 *-* CONTROL NOCONLIST
+++ RC(-3) +++
8 +++ +
Pls try to solve this......
Thanks in advance... |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Solve it ? Isn't that realistically YOUR job
With the amount of information you share with us maybe we can have a great game of 128 questions before we get enough information.
Have you traced your code during execution, have you posted your code, is it background or foreground execution, ad infinitum |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Your JOBCARD member is in the wrong library. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
What code for inserting a JOBCARD? Your topic title indicates that it is a command. It is not available here so I guess it is a local facility so the people to ask are you own. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
And it's the second page of an existing thread - why do you tail-gate an existing topic, it confuses usually.
JOBCARD is a local command (an ISEREDIT macro) used by the thread starter; having said that if you've used exactly what this thread implies to in earlier posts - why in the heaven do you get this error:
Quote: |
IKJ56500I COMMAND CONTROL NOT FOUND |
-- have you used some other local command for you?
Said that, I agree with expat, this is very less information to help you. There are so many loose ends in your post. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Clearly, it is a CLIST being executed as a rexx program. |
|
Back to top |
|
|
Fathima Begum S
New User
Joined: 02 May 2012 Posts: 3 Location: India
|
|
|
|
Actually, I am learning REXX , and not sure abt many concepts clearly.
Got this piece of code from forum only.
Curious to execute it and got an error in line 5.
/* */
/* INSERTS A JOBCARD AT TOP OF MEMBER */
/* */
ISREDIT MACRO
CONTROL NOCONLIST
ISREDIT RECOVERY OFF
ISREDIT RESET
ISREDIT INSERT: +
ISREDIT LINE_AFTER 0 = "//RAEGVGJ1 JOB (DWARD,SYS),'ACCOUNTS' "
ISREDIT LINE_AFTER 1 = "// CLASS=6, "
ISREDIT LINE_AFTER 2 = "// MSGCLASS=T, "
ISREDIT LINE_AFTER 3 = "// NOTIFY=&SYSUID, "
ISREDIT LINE_AFTER 4 = "// MSGLEVEL=(1,1) "
ISREDIT LINE_AFTER 5 = "//* "
EXIT CODE(0)
@expat: since it is not exactly my code, i have mentioned as to "SOLVE"
Anything wrong in that........ thanks for ur reply. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
This is an edit macro - you issue the command on the command line whilst editing a dataset - not by TSO commandname. How did you invoke it? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
If you look at what Pedro wrote...
The code you show does not have a single line of rexx in it.
Everything prefixed by ISREDIT gets shipped out for processing. Leaving:
Code: |
/* */
CONTROL NOCONLIST
EXIT CODE(0)
|
The CONTROL and the EXIT are CLIST commands. Stuff them through the rexx interpreter and certainly the CONTROL will get busted as invalid.... which it did.
It is not rexx, so not such a good example for learning rexx... |
|
Back to top |
|
|
Fathima Begum S
New User
Joined: 02 May 2012 Posts: 3 Location: India
|
|
|
|
Thank you for ur informations.. |
|
Back to top |
|
|
|