How to pass used id inside sysin dd *?



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

How to pass used id inside sysin dd *?

Postby lopa patro » Thu Jun 07, 2012 12:58 pm

I need to pass userid to a proc through sysin .Can anyone pls provide me the syntax?
Thanks in advance.
lopa patro
 
Posts: 2
Joined: Wed May 30, 2012 5:45 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to pass used id inside sysin dd *?

 

Re: How to pass used id inside sysin dd *?

Postby halfteck » Thu Jun 07, 2012 2:09 pm

If by 'userid' you mean any character string, and if by 'inside SYSIN DD' you mean a //SYSIN DD *, then the syntax you should be checking on is 'overriding a DD statement within a procedure' .

Or

//stepname.SYSIN DD *
userid (or any other text you require)
halfteck
 
Posts: 42
Joined: Tue Nov 08, 2011 8:47 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to pass used id inside sysin dd *?

Postby Akatsukami » Thu Jun 07, 2012 4:08 pm

lopa patro wrote:I need to pass userid to a proc through sysin .Can anyone pls provide me the syntax?
Thanks in advance.

As you should know, symbolics are not resolved in in-stream data. Either generate a small data set containing needed input in a prior step, or pass it as a parameter.
"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: 1053
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: How to pass used id inside sysin dd *?

Postby Monitor » Thu Jun 07, 2012 7:54 pm

My assumption is that you also want to write a program to receive the userid. If you pass the userid as a Parm-value to the program like this:
//STEP1   EXEC PGM=MYPGM,PARM=&SYSUID

you can easily get hold of the value in a COBOL-program like this:
000100  id division.                                 
000200  Program-id. PGM1.                           
000300  Data Division.                               
000400  Linkage Section.                             
000500  01 Parm1.                                   
000600    05 Plen  Pic S9(04) Binary.               
000700    05 Pdata Pic x(10).                       
000800  Procedure Division using Parm1.             
000900      If Plen = 0                             
001000         Display 'Parameter missing'           
001100      Else                                     
001200         Display 'Parameter >> ' Pdata(1:Plen)
001300      End-If                                   
001400      Goback                                   
001500      .                                       

With this solution there is no need to enter the data/userid in a file, and the value is always the correct value, as long as you just code the parm.
Monitor
 
Posts: 98
Joined: Wed Jan 18, 2012 8:59 pm
Has thanked: 0 time
Been thanked: 7 times

Re: How to pass used id inside sysin dd *?

Postby lopa patro » Fri Jun 08, 2012 12:10 pm

Thanks for ur reply guys..

Below is my requirement.
//DELETE EXEC PGM=IDCAMS,REGION=256K
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE AH1216A.GOTCOPY.IMS0.TOIMSO NONVSAM SCRATCH PURGE
IF LASTCC > 0 THEN SET MAXCC = 0

I need to delete a dataset 'AH1216A.GOTCOPY.IMS0.TOIMSO' where AH1216A is the RACF id of the user.
lopa patro
 
Posts: 2
Joined: Wed May 30, 2012 5:45 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to pass used id inside sysin dd *?

Postby prino » Fri Jun 08, 2012 12:56 pm

Are you thick or just pretending?

You've been told that you cannot use symbolics in sysin, and here you go again with the same requirement...

You've been told to write a program that writes the required data to a (temporary) file that is read by IDCAMS.

Now go away and do what you have been told to do!
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 536
Joined: Wed Mar 11, 2009 12:22 am
Location: Oostende, Belgium
Has thanked: 3 times
Been thanked: 21 times

Re: How to pass used id inside sysin dd *?

Postby steve-myers » Fri Jun 08, 2012 7:08 pm

As Prino, Monitor and others have said, you cannot do symbol substitution in data.

If you think outside the box, you can do what you want to do other ways. This will always work.
//A       EXEC PGM=IKJEFT01,
// PARM='DEL ''&SYSUID..GOTCOPY.IMS0.TOIMSO'' NONVSAM PURGE SCRATCH'
//SYSTSPRT DD  SYSOUT=*
//SYSTSIN  DD  DUMMY
The TSO DELETE command is sort of an alias for the IDCAMS DELETE command and takes the same parameters, and it is not widely appreciated that the JCL PARM for the TSO Terminal Monitor Program is treated as a TSO command.

Now, of course, as you have probably noted, there is a space problem here: it may not be possible to fit the JCL PARM into a single JCL line, but you can remove the default SCRATCH parameter and you probably do not need the NONVSAM parameter, and you can use JCL symbols, like this -
//TSODEL  PROC D='?'
//A       EXEC PGM=IKJEFT01,
// PARM='DEL ''&SYSUID..&D'' PURGE'
//SYSTSPRT DD  SYSOUT=*
//SYSTSIN  DD  DUMMY
//        PEND
//EXEC    EXEC TSODEL,D='GOTCOPY.IMS0.TOIMSO'


Of course, there is the simpler solution -
//A       EXEC PGM=IKJEFT01
//SYSTSPRT DD  SYSOUT=*
//SYSTSIN  DD  *
 DEL GOTCOPY.IMS0.TOIMSO NONVSAM PURGE
TSO will insert your userid for you!

These users thanked the author steve-myers for the post:
Peter_Mann (Sat Jun 09, 2012 2:14 am)
steve-myers
Global moderator
 
Posts: 1885
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 197 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post