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



Post anything related to mainframes (IBM & UNISYS) if not fit in any of the above categories

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

Postby diptisaini » Wed Sep 15, 2010 3:41 pm

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
diptisaini
 
Posts: 90
Joined: Sun Mar 14, 2010 5:12 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby MrSpock » Wed Sep 15, 2010 4:06 pm

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?
User avatar
MrSpock
Global moderator
 
Posts: 809
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

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

Postby diptisaini » Wed Sep 15, 2010 5:07 pm

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.
diptisaini
 
Posts: 90
Joined: Sun Mar 14, 2010 5:12 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby Robert Sample » Wed Sep 15, 2010 5:28 pm

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.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

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

Postby diptisaini » Wed Sep 15, 2010 5:43 pm

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 ?
diptisaini
 
Posts: 90
Joined: Sun Mar 14, 2010 5:12 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby Robert Sample » Wed Sep 15, 2010 5:48 pm

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.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

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

Postby diptisaini » Wed Sep 15, 2010 5:48 pm

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.
diptisaini
 
Posts: 90
Joined: Sun Mar 14, 2010 5:12 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby Robert Sample » Wed Sep 15, 2010 5:52 pm

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.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

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

Postby diptisaini » Wed Sep 15, 2010 6:15 pm

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 ?
diptisaini
 
Posts: 90
Joined: Sun Mar 14, 2010 5:12 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby MrSpock » Wed Sep 15, 2010 6:28 pm

Your output dataset would look like:

TCLAST15.B836.CHAMP.EXPORT.ACK    &OUTDSN='a
TCLAST15.B836.CHAMP.EXPORT.ACK    &PATH='acl
User avatar
MrSpock
Global moderator
 
Posts: 809
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Next

Return to All other Mainframe Topics

 


  • Related topics
    Replies
    Views
    Last post