How to pass input from Rexx to JCL



IBM's Command List programming language & Restructured Extended Executor

How to pass input from Rexx to JCL

Postby Sonal C » Mon Mar 25, 2013 4:38 pm

Hi,

I tried to search on this topic in google but couldn't find any sample of JCL.

I have piece of rexx code as:

/*REXX*/
Say "enter your name:"
pull name
Ref_JCL:
ADDRESS TSO
"Submit 'ABCD.JCLLIB(REFJCL)' "


My Requirement:

I have to pass the input NAME from this rexx to a JCL, which will show the output in SPOOL.

My Doubts:
1) Tried to use Utility as IRXJCL, job failed with MAXCC=3637
2) Tried to use Utility IEBGENER, job failed with MAXCC=12 and out was wrong
3) Tried to use Utility IEFBR14, job ran with MAXCC-0 but no output in Spool

Please help me in understansing how shall I pass input from Rexx to JCL

Thanks
Sonal
Sonal C
 
Posts: 17
Joined: Wed Nov 07, 2012 12:20 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to pass input from Rexx to JCL

Postby enrico-sorichetti » Mon Mar 25, 2013 6:51 pm

google and search the forum examples of ISPF FILE TAILORING
FTINCL is the buzzword

here ( this forum )

or here http://ibmmainframes.com

and here a direct link to a working snippet
http://ibmmainframes.com/about55549.html
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3003
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: How to pass input from Rexx to JCL

Postby Sonal C » Tue Mar 26, 2013 5:51 pm

Thank you for your reply Enrico.

I tried to go through the Snippet present in link given by you, but couldnt understand it.

Can you please help me in understanding the syntax of passing variable values from Rexx to JCL?

any simple syntax or code for a line or 2.

Regards,
Sonal
Sonal C
 
Posts: 17
Joined: Wed Nov 07, 2012 12:20 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to pass input from Rexx to JCL

Postby Robert Sample » Tue Mar 26, 2013 6:20 pm

any simple syntax or code for a line or 2.
Not everything people want to do on a mainframe can be handled so easily. Sometimes there is a lot of set up and background processing required. Many times people compare the task to doing the same thing on a PC, but there's no real comparison -- IBM mainframes have almost 50 years of development history and function entirely differently (architecture is different, screen processing is different, I/O is different, ..) than a PC.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: How to pass input from Rexx to JCL

Postby Sonal C » Tue Mar 26, 2013 6:27 pm

I want to have understatnding on the topic. If you will put any simple syntax I will try to modify it according to my requirement.

That's why I had asked you to give a sample code which will help me in understand the functinality.

Since I am beginner in Rexx I feel I should go step by step.

Regards,
Sonal
Sonal C
 
Posts: 17
Joined: Wed Nov 07, 2012 12:20 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to pass input from Rexx to JCL

Postby NicC » Tue Mar 26, 2013 6:39 pm

What you are wanting to do is not beginner's Rexx/ISPF. But it is doable if you study the manual along with the snippet linked to by Enrico and look at samples in the forum.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: How to pass input from Rexx to JCL

Postby Sonal C » Tue Mar 26, 2013 6:49 pm

I have already posted REXX code. Now I am giving the jcl which will be called by Rexx.

//JOBA JOB ,CLASS=B,MSGCLASS=A
//STEP01 EXEC PGM=IKJEFT01,DYNAMNBR=30
//SYSPRINT DD SYSOUT=*
//SYSEXEC DD DISP=SHR,DSN=MYREXX PDS
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
&name
/*
//

Let me know if I am doing it correctly? &name is correct way of taking input from Rexx or not?

The variable name name is same which I am using in Rexx.

Regards,
Sonal
Sonal C
 
Posts: 17
Joined: Wed Nov 07, 2012 12:20 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to pass input from Rexx to JCL

Postby NicC » Tue Mar 26, 2013 6:53 pm

Why do you not read the manual as requested and study the snippets. Yes &name will work IF you are using file tailoring to edit the job.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: How to pass input from Rexx to JCL

Postby enrico-sorichetti » Tue Mar 26, 2013 7:32 pm

OK, the snippet I pointed to was/is a bit sophisticated for a beginner

but since I am in a good mood here is a simpler snippet ( TESTED naturally )

the REXX SCRIPT
/*REXX - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                                                                   */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Trace "O"

Parse Source _sys _how _cmd .

If Sysvar(SYSISPF) /= "ACTIVE" Then Do
   Say left(_cmd,8)"- Ispf is not active. Command not executed"
   Exit 4
End
call $ispex "CONTROL ERRORS RETURN"

display  = "DISPLAY PANEL(MFTEST1)"
do while ($ispex("DISPLAY PANEL(MFTEST1)") = 0 )
   call  $ispex "FTCLOSE"
   zRC = $ispex("FTOPEN TEMP")
   if zRC /= 0   then do
       zerrsm = "FTOPEN ERROR"
       zerrlm = left(_cmd,8)"- FTOPEN RC("zRC")"
       call   $ispex "SETMSG MSG(ISRZ001) "
       iterate
   end
   zRC = $ispex("FTINCL MFTEST1")
   if zRC /= 0   then do
       zerrsm = "FTINCL ERROR"
       zerrlm = left(_cmd,8)"- FTINCL RC("zRC")"
       call   $ispex "SETMSG MSG(ISRZ001) "
       iterate
   end
   zRC = $ispex("FTCLOSE")
   if zRC /= 0   then do
       zerrsm = "FTCLOSE ERROR"
       zerrlm = left(_cmd,8)"- FTCLOSE RC("zRC")"
       call   $ispex "SETMSG MSG(ISRZ001) "
       iterate
   end
   call $ispex "VGET ZTEMPF"
   call $ispex "VIEW DATASET('"ZTEMPF"') "
end


Exit

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                                                                   */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
$tsoex:
   tso_0tr = trace("O")
   Address TSO arg(1)
   tso_0rc = rc
   trace value(tso_0tr)
   return tso_0rc

/*REXX - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                                                                   */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
$ispex:
   isp_0tr = trace("O")
   Address ISPEXEC arg(1)
   isp_0rc = rc
   trace value(isp_0tr)
   return isp_0rc

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/*                                                                   */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
$isred:
   isr_0tr = trace("O")
   Address ISREDIT arg(1)
   isr_0rc = rc
   trace value(isr_0tr)
   return isr_0rc



the PANEL
)ATTR DEFAULT(%+_)
      /*  % TYPE(TEXT) INTENS(HIGH)      defaults displayed for      */
      /*  + TYPE(TEXT) INTENS(LOW)       information only            */
      /*  _ TYPE(INPUT) INTENS(HIGH) CAPS(ON) JUST(LEFT)             */
  $ TYPE(INPUT) INTENS(LOW) PAD(_)    /* input field padded with '_' */
  ! TYPE(INPUT) INTENS(LOW) PAD(' ')  /* input field padded with ' ' */
)BODY
%--------------------  TITLE FOR ENTRY PANEL  --------------------------
%COMMAND ===>_ZCMD
%
+                  1         2         3         4         5
+      12345678901234567890123456789012345678901234567890123456
+   1 !var1                                                    +
+   2 !var2                                                    +
+   3 !var3                                                    +
+   3 !var4                                                    +
+
)INIT
&var1='something'
)PROC
)END


The SKEL
//XXXXXXXX JOB (TEST),'MFTEST1',NOTIFY=XXXXXXXX
//             CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1)
//* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
//*
//* VAR1 = &VAR1
//* VAR2 = &VAR2
//* VAR3 = &VAR3
//* VAR4 = &VAR4
//*
//G       EXEC PGM=IEFBR14
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3003
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: How to pass input from Rexx to JCL

Postby MrSpock » Tue Mar 26, 2013 7:43 pm

This would be my solution:

/* REXX */                                         
Say "Enter Name"                                   
Parse Pull name .                                 
Queue "TOP"                                       
Queue "C * 999999 /&name/"name"/"                 
Queue "TOP"                                       
Queue "END SAVE"                                   
"EDIT 'ABCD.JCLLIB(REFJCL)' OLD TEXT NONUM"             
"SUBMIT 'ABCD.JCLLIB(REFJCL)'"                         
Exit 0                                             
User avatar
MrSpock
Global moderator
 
Posts: 809
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Next

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post