Page 1 of 2

To copy the name of dataset as a content of another dataset

PostPosted: Wed Sep 15, 2010 3:41 pm
by diptisaini
Can you please help me to resolve below query ?
//NTLBAT.CMWKF01 DD DSN= TCLAST15.B836.CHAMP.IMPORT.DAT ,DISP=(OLD,,KEEP)
//NTLBAT.CMWKF02 DD DSN=TCLAST15.B836.CHAMP.IMPORT.ACK,DISP=(OLD,,KEEP)
//NTLBAT.CMWKF03 DD DSN= TCLAST15.B836.CHAMP.IMPORT.NDMPARM (+1),
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
// SPACE=(TRK,(1,1),RLSE),
// DCB=(RECFM=FB,LRECL=80)
//NTLBAT.CMWKF04 DD DSN=TCLAST15.B836.CHAMP.IMPORT.CTRLDAT,
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
// SPACE=(TRK,(1,1),RLSE),
// DCB=(RECFM=FB,LRECL=200)


My requirement is to copy the name of TCLAST15.B836.CHAMP.IMPORT.DAT dataset as a content of TCLAST15.B836.CHAMP.IMPORT.CTRLDAT dataset.

After completion of job TCLAST15.B836.CHAMP.IMPORT.CTRLDAT dataset contain following data ?

EDIT TCLAST15.B836.CHAMP.IMPORT.CTRLDAT Columns 00001 00072

Command ===> Scroll ===> CSR

****** ***************************** Top of Data *****************************

000001 TCLAST15.B836.CHAMP.IMPORT.DAT

Re: To copy the name of dataset as a content of another dataset

PostPosted: Wed Sep 15, 2010 4:06 pm
by MrSpock
OK, so include that name as input to a copy step (IEBGENER or SORT or whatever). What am I missing or not understanding about this topic?

Re: To copy the name of dataset as a content of another dataset

PostPosted: Wed Sep 15, 2010 5:07 pm
by diptisaini
My requirement is to copy name of file NTLBAT.CMWKF01 DD DSN= TCLAST15.B836.CHAMP.IMPORT.DAT ,DISP=(OLD,,KEEP) which is "TCLAST15.B836.CHAMP.IMPORT.DAT " in above jcl as a data in NTLBAT.CMWKF04 DD DSN=TCLAST15.B836.CHAMP.IMPORT.CTRLDAT. So if i'll read TCLAST15.B836.CHAMP.IMPORT.CTRLDAT file then the file should contain following contents:-

EDIT TCLAST15.B836.CHAMP.IMPORT.CTRLDAT Columns 00001 00072

Command ===> Scroll ===> CSR

****** ***************************** Top of Data *****************************

000001 TCLAST15.B836.CHAMP.IMPORT.DAT

Is there any utility is available through which i can do ? I am tring to search in mainframe forum but still i didn't get any thing.

Re: To copy the name of dataset as a content of another dataset

PostPosted: Wed Sep 15, 2010 5:28 pm
by Robert Sample
If you are using a program, you can write code to chase the task control blocks pointers and provide the data set name. As far as I am aware, however, there are no system utilities that will provide you with a data set name given a DD name. You can use IDCAMS LISTCAT to get a data set name given a partial data set name, of course.

Re: To copy the name of dataset as a content of another dataset

PostPosted: Wed Sep 15, 2010 5:43 pm
by diptisaini
My requirement is to do the changes without the use of program. Can you please send me a sample JCL of IDCAMS LISTCAT so that i can try with that ?

Re: To copy the name of dataset as a content of another dataset

PostPosted: Wed Sep 15, 2010 5:48 pm
by Robert Sample
Go to the IBM web site, find the DF/SMS Access Method Services for Catalogs manual, and look up the format for the LISTCAT command yourself. Expecting to be spoon-fed everything is not the sign of a professional IT person.

Re: To copy the name of dataset as a content of another dataset

PostPosted: Wed Sep 15, 2010 5:48 pm
by diptisaini
Hi,

I have checked IDCAMS LISTCAT description but its main purpose to check whether file is available or not . But my requiremnet is not that please read above conversation once again.

Re: To copy the name of dataset as a content of another dataset

PostPosted: Wed Sep 15, 2010 5:52 pm
by Robert Sample
There is no utility or other system function that will provide the data set name given a DD name, period. Either you write (or modify) a program to get the data set name from the DD name, or you go back to whoever gave you the assignment and tell them that the requirement cannot be met under the current conditions. Your choice.

Re: To copy the name of dataset as a content of another dataset

PostPosted: Wed Sep 15, 2010 6:15 pm
by diptisaini
Hi,

My team mate is trying by using below utility :-

The complete jcl is given below :-

//BBOX     EXEC  PGM=ENVUPD,PARM='BMT'                         
//*************************************************************
//* JOB DESCRIPTION       - RETRIEVE CA DATA                   
//*************************************************************
//S1       EXEC  PGM=SORT                                     
//SYSOUT   DD  SYSOUT=*                                       
//SORTIN   DD  DSN=TCLAST15.B836.CHAMP.EXPORT.ACKCPY1,DISP=SHR
//SORTOUT  DD  DSN=WGS0227.BLBRGCA.UNIQ,DISP=OLD               
//SYSIN    DD  *                                               
  SORT FIELDS=COPY                                             
  OUTREC FIELDS=(C'TCLAST15.B836.CHAMP.EXPORT.ACK ',35:1,10)   
/* 


TCLAST15.B836.CHAMP.EXPORT.ACKCPY1 this dataset contains the following data :-

BROWSE TCLAST15.B836.CHAMP.EXPORT.ACKCPY1 Line 00000000 Col 001 080
Command ===> Scroll ===> PAGE
******************************** Top of Data *********************************
&OUTDSN='aclr/data/F45652.DAT' -
&PATH='aclr/control/F45652.DAT.end' -

So finally the the data available in WGS0227.BLBRGCA.UNIQ dataset is given below :-
TCLAST15.B836.CHAMP.EXPORT.ACK F45652.DAT

Can you please tell us are we doing correct or not ?

Re: To copy the name of dataset as a content of another dataset

PostPosted: Wed Sep 15, 2010 6:28 pm
by MrSpock
Your output dataset would look like:

TCLAST15.B836.CHAMP.EXPORT.ACK    &OUTDSN='a
TCLAST15.B836.CHAMP.EXPORT.ACK    &PATH='acl