MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Passing Dataset name from REXX Panel to REXX EXEC

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
priya_ranjan
Beginner


Joined: 26 Nov 2016
Posts: 4
Topics: 2

PostPosted: Wed Dec 07, 2016 8:40 am    Post subject: Passing Dataset name from REXX Panel to REXX EXEC Reply with quote

How can I pass my input dataset name from the REXX Panel to my REXX exec.?
The dataset is a FB File and will be used in the REXX EXEC Program as input file for a DFSORT Step. In the Panel, I have defined the Input File as INPFL and using it in the REXX EXEC in the SORT STEP as follows:
Code:

QUEUE  "//SORTIN   DD DISP=SHR,                                     "
QUEUE  "              DSN="INPFL"                                   "

I am getting an error that SORTIN not defined.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12357
Topics: 75
Location: San Jose

PostPosted: Wed Dec 07, 2016 10:42 am    Post subject: Reply with quote

priya_ranjan,

You need a PULL statement to get the dsn name, something like this.

Code:

PULL ARG               
INPFL = STRIP(ARG(1))   
SAY INPFL               

_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Thu Dec 08, 2016 4:17 am    Post subject: Reply with quote

no such thing as a rexx panel - panels are not a part of rexx but ispf. If yu are netering the dta set name into the panel, once you exit the panel then rexx should know the value in INPFL - as long as that is the variable used in the panel.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
priya_ranjan
Beginner


Joined: 26 Nov 2016
Posts: 4
Topics: 2

PostPosted: Thu Dec 08, 2016 6:00 am    Post subject: Reply with quote

Thank you Kolusu.
I tried the PULL statement.
I am getting 'DATASET NOT FOUND'.
It is not recognizing the dataset from the REXX Panel.
Following is the code I tried:

Code:

GET_INP_FILE:           
PARSE UPPER PULL 'INPFL'
SAY SYSDSN('INPFL')     
RETURN                 


In the Panel, I am using
Code:

* File Name     =>$INPFL 


where
Code:

$  TYPE(INPUT) INTENS(HIGH) COLOR(TURQ) HILITE(USCORE)
*  TYPE(TEXT) INTENS(HIGH) COLOR(GREEN)               


Please suggest.

Regards
Priyaranjan
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Thu Dec 08, 2016 6:28 am    Post subject: Reply with quote

Well, your $ attribute specifies an data entry field. Have you entered data into that field? What do you get when you display INPFL? What is the dataset name in your error message? has your user id been pre-pended onto it? If yes then try putting quotes around the name when you enter it.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
priya_ranjan
Beginner


Joined: 26 Nov 2016
Posts: 4
Topics: 2

PostPosted: Fri Dec 09, 2016 4:57 am    Post subject: Reply with quote

Hi Nic,
Following is what I enter on the ISPF panel:
Code:

                   FILE SORTING AND REMOVING DUPS                         
                                                                           
 File Name     => 'TEST.SORT.INPUT01.DEC0616'                           
 Record Length => 80                                                       
 Key Position  => 14                                                       
 Key Length    => 10                                                       
                                                                           
 MESSAGE       =>                                                         
                                                                           
 ENTER -> Execute    PF3 -> End                                           


where 'TEST.SORT.INPUT01.DEC0616' is an existing file. As suggested, I had given the DS name insed single quotes.
Following is the Trace o/p for the following piece of REXX exec code and the code after that:
Code:

GET_INP_FILE:           
 PARSE UPPER PULL 'INPFL'
 SAY SYSDSN('INPFL')     
 RETURN


Trace:
Code:

    29 *-*  CALL GET_INP_FILE                                                 
    55 *-*   GET_INP_FILE:                                                     
    56 *-*   PARSE UPPER PULL 'INPFL'                                         
                                                                               
    57 *-*   SAY SYSDSN('INPFL')                                               
DATASET NOT FOUND                                                             
    58 *-*   RETURN                                                           
    30 *-*  USER = USERID()                                                   
    31 *-*  QUEUE  "//"USER"N JOB (1,50290),'COPY',CLASS=G,MSGCLASS=Y,         
 "                                                                             
    32 *-*  QUEUE  "// USER=&SYSUID,MSGLEVEL=(1,1),COND=(0,LT)                 
 "                                                                             
    33 *-*  QUEUE  "//**************SORT ON KEY AND REMOVE DUPLICATES**********
*"                                                                             
    34 *-*  QUEUE  "//SORT01   EXEC PGM=SORT                                   
 "                                                                             
    35 *-*  QUEUE  "//SYSPRINT DD SYSOUT=*                                     
 "                                                                             
    36 *-*  QUEUE  "//SYSOUT   DD SYSOUT=*                                     
 "                                                                             
    37 *-*  QUEUE  "//SORTIN   DD DISP=SHR,DSN="INPFL"                         
 "                                                                             
    38 *-*  QUEUE  "//SORTOUT  DD DSN=TRWTAMR.SORT.OUTPT01.DEC0716,           
 "                                                                             
    39 *-*  QUEUE  "//            DISP=(NEW,CATLG,DELETE),                     
 "                                                                             
    40 *-*  QUEUE  "//            UNIT=SYSDA,                                 
 "                                                                             
    41 *-*  QUEUE  "//            DCB=(RECFM=FB,LRECL="RL",BLKSIZE=0),         
 "                                                                             
    42 *-*  QUEUE  "//            SPACE=(CYL,(10,10),RLSE)                     
 "                                                 
    43 *-*  QUEUE  "//SYSIN    DD *               
 "                                                 
    44 *-*  QUEUE  "  SORT FIELDS=("KP","KL",CH,A)
 "                                                 
    45 *-*  QUEUE  "  SUM FIELDS=NONE             
 "                                                 
    46 *-*  QUEUE  "/*                             
 "                                                 
    47 *-*  QUEUE  "$$                             
 "                                                 
    48 *-*  O = OUTTRAP("OUTPUT.",,"CONCAT")       
    49 *-*  "SUBMIT * END($$)"                     
       >>>    "SUBMIT * END($$)"                   
    50 *-*  O = OUTTRAP(OFF)                       
    51 *-*  RETURN                                 
***                                               


As seen above in the Trace 'DATASET NOT FOUND' for INPFL.
When I checked the SPOOL, following is what I hade for JESJCL:
Code:

//SORT01   EXEC PGM=SORT                           
//SYSPRINT DD SYSOUT=*                             
//SYSOUT   DD SYSOUT=*                             
//SORTIN   DD DISP=SHR,DSN=                         
//SORTOUT  DD DSN=TRWTAMR.SORT.OUTPT01.DEC0716,     
//            DISP=(NEW,CATLG,DELETE),             
//            UNIT=SYSDA,                           
//            DCB=(RECFM=FB,LRECL=,BLKSIZE=0),     
//            SPACE=(CYL,(10,10),RLSE)             
//SYSIN    DD *                                     
/*                                                 

As seen above DSN name for SORTIN is blanked which is the I/p file I am trying to give through the ISPF Panel.

Please suggest.

Regards
Priyaranjan
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Fri Dec 09, 2016 7:17 am    Post subject: Reply with quote

Priya

End your code snippets with [/code].

I do not see your panel being called. Your get_inp_file procedure is being called from somewhere which you do not show. It is also unnecessary if you are entering the data set (not file) name on a panel. Rexx will know about it once you have pressed enter or pf3. You should initialise INPFL before use - at the top of your program. If it is created in a sub-routine then a higher level of code may not know about it.

PULL defaults to UPPER so your PULL statement should be
Code:
Pull inpfl
Say 'INPFL = 'inpfl

Rexx is case insensitive.
However, as noted before, you do not need a pull statement.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group