how to get a DD name specified in JCL to Rexx program



IBM's Command List programming language & Restructured Extended Executor

how to get a DD name specified in JCL to Rexx program

Postby prasanth G » Tue Aug 16, 2016 4:43 pm

hi,
i am running a REXX program using a JCl .below is the part of jcl which i am using
"/STEP2 EXEC PGM=IRXJCL,PARM='MAINBATC'
//SYSEXEC DD DSN=IDF.REXX.COCOV.DAUG15.TARGO,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
//FILEI DD DSN=IDF.REXX.DAUG15.NEW(TESTPGM1),DISP=SHR "

now, Dataset specified(IDF.REXX.DAUG15.NEW(TESTPGM1)) in FILEI i have to get this DD in a Rexx Program...,

how to get this we have to use PARSE or is there any some other possible ways
please help me out guys...,;)
prasanth G
 
Posts: 5
Joined: Tue Aug 16, 2016 3:33 pm
Has thanked: 0 time
Been thanked: 0 time

Re: how to get a DD name specified in JCL to Rexx program

Postby willy jensen » Tue Aug 16, 2016 7:37 pm

If you can change your job to run TSO batch, then the easiest solution would be to capture the output from a Address TSO 'LISTALC ST' and parse it. The output is not very friendly, but it is doable.
willy jensen
 
Posts: 455
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 69 times

Re: how to get a DD name specified in JCL to Rexx program

Postby Pedro » Tue Aug 16, 2016 9:31 pm

Simplest: I would pass it in like this:
//STEP2 EXEC PGM=IRXJCL,PARM='MAINBATC DD(FILEI) '


Also, I think MAINBATC should have a programming interface. One of the requirements should be to use a specific DD name.
Pedro Vera
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: how to get a DD name specified in JCL to Rexx program

Postby willy jensen » Tue Aug 16, 2016 9:37 pm

actually not clear on what you want -
- the dataset info for ddname FILEI ?
- a list of datasets allocated to your job?

in the first case you should look at the LISTDSI built-in REXX function, in the 2nd case see my previous reply
willy jensen
 
Posts: 455
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 69 times

Re: how to get a DD name specified in JCL to Rexx program

Postby prasanth G » Wed Aug 17, 2016 10:09 am

Pedro wrote:Simplest: I would pass it in like this:
//STEP2 EXEC PGM=IRXJCL,PARM='MAINBATC DD(FILEI) '


Also, I think MAINBATC should have a programming interface. One of the requirements should be to use a specific DD name.



hi,
Thanks for the reply,

The main objective is this MAINBATC (which is a member of IDF.REXX.COCOV.DAUG15.TARGO) have rexx code it will take a pds(IDF.REXX.DAUG15.NEW(TESTPGM1)) as input file and perform some operation and after that it will write a report like thing to a output file
I am using this JCL above(its not the full JCL i have used its a part) and IRXJCL utility for executing MAINBATC
i want this input file IDF.REXX.DAUG15.NEW(TESTPGM1) to be stored in a variable in (MAINBATC) so that i can use this variable for a display purpose
prasanth G
 
Posts: 5
Joined: Tue Aug 16, 2016 3:33 pm
Has thanked: 0 time
Been thanked: 0 time

Re: how to get a DD name specified in JCL to Rexx program

Postby NicC » Wed Aug 17, 2016 7:28 pm

If you simply want to read the file then use EXECIO e.g.

"EXECIO 0 DISKR FILEI(OPEN"               /* Open file for update    */        
"EXECIO 1 DISKR FILEI(STEM youstem"        /* Priming read            */
 

The dataset is already allocated via the JCL.
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 get a DD name specified in JCL to Rexx program

Postby Pedro » Wed Aug 17, 2016 9:45 pm

i want this input file IDF.REXX.DAUG15.NEW(TESTPGM1)

You will get better answers if you use more concise terms. Please use the terms DD name or data set name. In your example, the DD name is 'FILEI' and the data set name is 'IDF.REXX.DAUG15.NEW(TESTPGM1)'.

People get confused when you refer to a 'file'. Most people consider the DD name to be the file name. Some others think a file name refers to USS files.
Pedro Vera
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: how to get a DD name specified in JCL to Rexx program

Postby Akatsukami » Wed Aug 17, 2016 9:59 pm

Your problem is not entirely clear to me, but it seems as if you want the data set name associated with a given DD name. If so, would you not be better off running under background TSO and using the LISTDSI external function?
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: how to get a DD name specified in JCL to Rexx program

Postby willy jensen » Thu Aug 18, 2016 12:46 pm

I agree with Akatsukami. Unless you have a very compelling reason not to use TSO batch I strongly suggest that you use that in general. It makes life so much easier.
willy jensen
 
Posts: 455
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 69 times

Re: how to get a DD name specified in JCL to Rexx program

Postby prino » Thu Aug 18, 2016 5:14 pm

It's easier to read tea leaves then to make sense of the gobbledygook of the TS...

Give us a clear description of what you want!
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 635
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 28 times

Next

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post