Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting TSO UserID into DSN Node 1

Status
Not open for further replies.

iadithot

Programmer
Jul 24, 2006
18
US
I am creating a script to convert Production JCL into Test JCL. One of our shop standards is that I must rename all files by adding a UserID. Is there a way to add a node to the end of a DSN that contains the TSO UserID?
For example
this.is.a.dummy.file would become this.is.a.dummy.file.userid

Thanks in advance for any suggestions.

Kirby Haley
 
s = userid()
"ALLOC F(INPUT) DA('this.is.a.dummy.file."s"') SHR REUSE"
 
Thanks kevinf2349 that will create the new file. But how do I change the DSN= statement in the JCL to reflect the new name?

DSN=this.is.a.dummy.file
DSN=this.is.a.dummy.file.userid

Kirby Haley
 
my bad....you need to use SYSUID not sysid. This is a JCL feature rather than REXX
 
That will work if I already know the name of the DSN.

But my situation is the User will copy a Production JCL module into their personal JCL library. Then they will run my Rexx script to make the changes necessary to convert a Production JCL into Test JCL.

This conversion script needs to change the jobcard, DB2 qualifiers, DSN nodes, etc.

My problem is that while
ADDRESS ISREDIT "C 'DSN=P.IN.BN' 'DSN=T.IN.BN' ALL"
will change the first node for all the DSN= statements in the JCL. But how do I add a UserID node to the end of all the DSNs when I have no idea what the DSN names are?

Kirby Haley
 
That assumes you know the DSN name and how many nodes are in the JCL. Due to my shops standards I know the first 3 nodes, but there could be 2 to 4 additional nodes I would know nothing about. The Rexx script needs to be able to figure out where the DSN name ends and add the Users TSO ID as an additional node on the end.

Kirby Haley
 

I've been watching this thread for a while, not quite sure what the user was asking and perplexed over the nature of the base problem: changing 'production JCL' to 'test JCL'.

To me, it's complete nonsense that production data and test data are distinguished by the low-level qualifier (LLQ). Every other place I've worked for the past 36 years it has been the HLQ or (at one site) the two HLQs.

Secondly, what site doesn't have DSNs (or at least parts of DSNs) as symbolics in PROCs? Why would anyone look for a REXX solution for something that should be no more difficult than swapping out an INCLUDE?

Third, there might be a solution to this which is less complicated than re-writing the Converter/Interpreter but I doubt it. There's no one on this site or any other who will provide that level of code without a very expensive long-term contract. If that's what the poster is after, he's barking up the wrong tree.


Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
OK apparently in an attempt to keep the size of my post down I left something out that confused everyone. I’ll try again.

First off, I have no intention of re-writing the Converter/Interpreter, or any other big project.

As for Rexxhead’s question about PROC’s. We use PROCs in Bind and Compile JCL, but that’s about it. Most of our Production JCL is just straight JCL, not JCL calling PROCs.

I just want to be able to copy a Production JCL member into my test JCL PDS. Bring that member, from my PDS, up in the ISPF Editor, and run a Rexx macro to make the tedious changes to the JCL that are required to make the JCL run in the test environment.

The tedious changes: Change the job card, the DB2 region, the environment, the DSN’s etc.

I know how to make most of the changes. The only thing that I have not figured out are the DSN name changes. At this shop the DSN naming standards for test DSNs are in 2 parts. Part 1 - change the high level qualifier from “P” to “T”. Part 2 – In order to distinguish between System Test DSNs and Development DSNs. Development DSNs have an additional node added to the end of the DSN with your TSO User ID. I can change the high level qualifier, but I am stymied on how to add the User ID node at the end.

Sorry for the confusion. I hope my problem is clearer this time.

Kirby Haley
 
Code:
//JOB4 JOB (acctg-info),...
// NOTIFY=&SYSUID
//*
//*  SET HLQ=PAPPL
//*  SET LLQ=CICS
//   SET HLQ=TAPPL
//   SET LLQ=CICS.JOE
//*
//STEP1 EXEC PGM=PROGA
//INPUT  DD DSN=&HLQ..SOME.DATASET.NAME.&LLQ
//....
No PROCs required, but the 'problem' is solved permanently. No REXX required, either.


Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
That JCL would require adding the symbolic parameters. Maybe an example would better illustrate what I seem to having trouble stating.

Start with this Production version of the JCL

//*
//*
//DEL01 EXEC PGM=IEFBR14
//D1 DD DSN=P.AA.BBBBBBBB.CCCCCCCC.DDDDDDDD,DISP=(MOD,DELETE)
//D2 DD DSN=P.AA.BBBBBBBB.CCCCCCCC.EEEEEEEE,DISP=(MOD,DELETE)
//D3 DD DSN=P.AA.BBBBBBBB.CCCCCCCC.FFFFFFFF,DISP=(MOD,DELETE)
//*
//*********************************************************************
//*
//STEP01 EXEC PGM=PROGA,COND=(4,LT)
//CMWKF01 DD DSN=P.AA.XXXXXXXX.YYYYYYYY.ZZZZZZZZ,DISP=SHR
//CMWKF02 DD DSN=P.AA.BBBBBBBB.CCCCCCCC.DDDDDDDD,DISP=(,CATLG),
// UNIT=DASD,
// SPACE=(CYL,(10,10),RLSE),
// DCB=(RECFM=FB,LRECL=200,BLKSIZE=0)
//CMWKF03 DD DSN=P.AA.BBBBBBBB.CCCCCCCC.EEEEEEEE,DISP=(,CATLG),
// UNIT=DASD,
// SPACE=(CYL,(10,10),RLSE),
// DCB=(RECFM=FB,LRECL=76,BLKSIZE=0)
//CMWKF04 DD DSN=P.AA.BBBBBBBB.CCCCCCCC.FFFFFFFF,DISP=(,CATLG),
// UNIT=DASD,
// SPACE=(CYL,(10,10),RLSE),
// DCB=(RECFM=FB,LRECL=200,BLKSIZE=0)
//*
//*


Execute the Rexx macro to change the DSNs.


Test version of JCL after Rexx macro

//*
//*
//DEL01 EXEC PGM=IEFBR14
//D1 DD DSN=T.AA.BBBBBBBB.CCCCCCCC.DDDDDDDD.USERID,DISP=(MOD,DELETE)
//D2 DD DSN=T.AA.BBBBBBBB.CCCCCCCC.EEEEEEEE.USERID,DISP=(MOD,DELETE)
//D3 DD DSN=T.AA.BBBBBBBB.CCCCCCCC.FFFFFFFF.USERID,DISP=(MOD,DELETE)
//*
//*********************************************************************
//*
//STEP01 EXEC PGM=PROGA,COND=(4,LT)
//CMWKF01 DD DSN=T.AA.XXXXXXXX.YYYYYYYY.ZZZZZZZZ.USERID,DISP=SHR
//CMWKF02 DD DSN=T.AA.BBBBBBBB.CCCCCCCC.DDDDDDDD.USERID,DISP=(,CATLG),
// UNIT=DASD,
// SPACE=(CYL,(10,10),RLSE),
// DCB=(RECFM=FB,LRECL=200,BLKSIZE=0)
//CMWKF03 DD DSN=T.AA.BBBBBBBB.CCCCCCCC.EEEEEEEE.USERID,DISP=(,CATLG),
// UNIT=DASD,
// SPACE=(CYL,(10,10),RLSE),
// DCB=(RECFM=FB,LRECL=76,BLKSIZE=0)
//CMWKF04 DD DSN=T.AA.BBBBBBBB.CCCCCCCC.FFFFFFFF.USERID,DISP=(,CATLG),
// UNIT=DASD,
// SPACE=(CYL,(10,10),RLSE),
// DCB=(RECFM=FB,LRECL=200,BLKSIZE=0)
//*

 

I understand what you're asking. The recommendation of someone who has been writing REXX (for a living) for >16 years is: do it a different way.

Code you write to do this task will require constant maintenance and upgrades to handle oddities you haven't yet begun to consider. If your company/firm has a policy against using symbolics, update your resume and move on; they're doomed and you don't want to be associated with fools.


Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
I was afraid of that. I'll try a different approach.

Thanks.
 
Try this.

/* REXX */
'ISREDIT MACRO NOPROCESS (parm)'

'ISREDIT (FrstLne) = LINENUM .ZFIRST'
'ISREDIT (LastLne) = LINENUM .ZLAST'

Do Lne = FrstLne to LastLne
'ISREDIT (LineX) = LINE' Lne
LineX = Strip(LineX,T)
If left(LineX,2) = "//" & left(LineX,3) <> "//*" then
Do
parse var LineX LineA "DSN=" Dsn
If Dsn <> "" then
Do
trmchars = ",( "
i = verify(Dsn" ",trmchars,'M')-1
Dsn = Left(Dsn,i)
parse var LineX LineA (Dsn) LineZ
LineX = LineA||Dsn"."UserID()||lineZ
End
'ISREDIT LINE' Lne '= (LineX) '
End
End

Return
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top