Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Invoking the "Jobcard" command in the REXX routine
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
Atpsmp

New User


Joined: 23 Sep 2008
Posts: 14
Location: Chennai

PostPosted: Wed Feb 25, 2009 5:29 pm    Post subject: Invoking the "Jobcard" command in the REXX routine
Reply with quote

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
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7909
Location: Bellevue, IA

PostPosted: Wed Feb 25, 2009 6:13 pm    Post subject:
Reply with quote

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
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Wed Feb 25, 2009 8:06 pm    Post subject: Re: Invoking the "Jobcard" command in the REXX rou
Reply with quote

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
View user's profile Send private message
Debabrata Pruseth

New User


Joined: 11 Dec 2008
Posts: 59
Location: Pune , India

PostPosted: Thu Feb 26, 2009 3:15 am    Post subject:
Reply with quote

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
View user's profile Send private message
Atpsmp

New User


Joined: 23 Sep 2008
Posts: 14
Location: Chennai

PostPosted: Fri Feb 27, 2009 1:51 pm    Post subject: Invoking the "Jobcard" command in the REXX routine
Reply with quote

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....... icon_sad.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Feb 27, 2009 2:02 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Atpsmp

New User


Joined: 23 Sep 2008
Posts: 14
Location: Chennai

PostPosted: Fri Feb 27, 2009 2:51 pm    Post subject: Invoking the "Jobcard" command in the REXX routine
Reply with quote

HEY HI..
Thanks expat for your immediate response.
I have tried your logic as you mentioned below. It is working.. icon_biggrin.gif 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???? icon_redface.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Feb 27, 2009 3:41 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Atpsmp

New User


Joined: 23 Sep 2008
Posts: 14
Location: Chennai

PostPosted: Fri Feb 27, 2009 4:01 pm    Post subject:
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Feb 27, 2009 4:05 pm    Post subject:
Reply with quote

The code that I gave you should be executed as an edit macro.
Back to top
View user's profile Send private message
Atpsmp

New User


Joined: 23 Sep 2008
Posts: 14
Location: Chennai

PostPosted: Mon Mar 02, 2009 11:06 am    Post subject:
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1219
Location: Israel

PostPosted: Mon Mar 02, 2009 2:36 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Atpsmp

New User


Joined: 23 Sep 2008
Posts: 14
Location: Chennai

PostPosted: Mon Mar 02, 2009 3:48 pm    Post subject:
Reply with quote

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. icon_lol.gif icon_biggrin.gif
Back to top
View user's profile Send private message
Atpsmp

New User


Joined: 23 Sep 2008
Posts: 14
Location: Chennai

PostPosted: Tue Mar 03, 2009 2:55 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Atpsmp

New User


Joined: 23 Sep 2008
Posts: 14
Location: Chennai

PostPosted: Tue Mar 03, 2009 3:00 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Fathima Begum S

New User


Joined: 02 May 2012
Posts: 3
Location: India

PostPosted: Fri May 04, 2012 3:18 pm    Post subject:
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri May 04, 2012 4:49 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2019
Location: Silicon Valley

PostPosted: Fri May 04, 2012 7:10 pm    Post subject: Reply to: Invoking the "Jobcard" command in the RE
Reply with quote

Your JOBCARD member is in the wrong library.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1714
Location: UK

PostPosted: Fri May 04, 2012 8:12 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri May 04, 2012 8:21 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Amount field is getting corrupted whe... thesumitk SYNCSORT 5 Tue Oct 18, 2016 8:20 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us