IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to make a dataset content as name to other dataset


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
murthy79

New User


Joined: 22 Sep 2005
Posts: 2

PostPosted: Thu Sep 22, 2005 2:21 pm
Reply with quote

Hi All,
I have one dataset named G2SZ00AT.DUMMY.TEST1. It has content as G2SZ00AT.MURTHY.TEST(only one line). I need to write a jcl to read the dataset G2SZ00AT.DUMMY.TEST1 and make the content "G2SZ00AT.MURTHY.TEST" as name to the one newly created dataset. How can i do that?

Thanks
Murthy
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Thu Sep 22, 2005 5:54 pm
Reply with quote

Your question is really rare, if I've correctly understand.
You have a file
G2SZ00AT.DUMMY.TEST1
that has within the record
G2SZ00AT.MURTHY.TEST
that's the name of a existing file.
You want to copy the second file to a third?

If I'm correct:
I think that in Rexx you can do this(I think that other method are available).
Do you need a source to do this?
Which name will have the output of this copy?

If I'm not I apologize to you.
Back to top
View user's profile Send private message
Kevin

Active User


Joined: 25 Aug 2005
Posts: 234

PostPosted: Thu Sep 22, 2005 6:24 pm
Reply with quote

This might work for you. It creates an output job that you can submit and create the dataset:

Code:

//STEPXXXX EXEC PGM=SORT                                               
//SORTIN   DD   DSN=G2SZ00AT.DUMMY.TEST1,DISP=(SHR,DELETE,KEEP)       
//JCLOUT   DD   SYSOUT=* <= output job                                             
//SYSOUT   DD   SYSOUT=*                                               
//SYSIN    DD   *                                                     
   OPTION COPY                                                           
   OUTFIL FNAMES=JCLOUT,ENDREC=1,                                       
     OUTREC=(1:C'//JOBNAME JOB (X,YYYYY,ZZZ),',X'7D',                   
      C'PROGNAME',X'7D',C',CLASS=X,',/,                                 
      C'//       MSGCLASS=X,MSGLEVEL=(1,1),NOTIFY=&SYSUID',/,           
      C'//*',/,                                                         
      C'//STEPXXXX EXEC PGM=IEFBR14',/,                                 
      C'//FILE1    DD   DISP=(,CATLG,DELETE),UNIT=UNIT,',/,             
      C'//         SPACE=(UNT,(PRI,SEC),RLSE),RECFM=FB,LRECL=NNNN,',/,   
      C'//         DSN=',1,44,80:X)                                     
/*                                                                     
//*                                                                   
Back to top
View user's profile Send private message
radhakrishnan82

Active User


Joined: 31 Mar 2005
Posts: 435
Location: chennai, India

PostPosted: Thu Sep 22, 2005 6:25 pm
Reply with quote

Quote:
I have one dataset named G2SZ00AT.DUMMY.TEST1. It has content as G2SZ00AT.MURTHY.TEST(only one line). I need to write a jcl to read the dataset G2SZ00AT.DUMMY.TEST1 and make the content "G2SZ00AT.MURTHY.TEST" as name to the one newly created dataset. How can i do that?


As per his query ,I think the output file name should be created as G2SZ00AT.MURTHY.TEST.
My understanding is this:A dataset G2SZ00AT.DUMMY.TEST1 contains one and only record which is G2SZ00AT.MURTHY.TEST.This record should be created as a dataset.

murthy,
is this your requirement?
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Thu Sep 22, 2005 7:05 pm
Reply with quote

Great solution Mr Kevin.
This is the Rexx sample
Code:
/*% NOCOMMENT REXX */                                             
"PROFILE NOPREFIX"                                               
SAY COPIES('-',80)                                               
SAY CENTER(' INITIAL DISPLAY ',80,' ')                           
SAY COPIES('-',80)                                               
LRECL = '80'                                                     
RECFM = 'F,B'                                                     
DSORG = 'PS'                                                     
DISP  = 'NEW CATALOG'                                             
SPC   = '1,1'                                                     
TSPC  = 'CYL'                                                     
DSNAME= 'DSNAME = STRIP(LIST.I,B)'                               
"EXECIO * DISKR INDD(STEM LIST. FINIS"                           
DO I = 1 TO LIST.0  /* TO ALLOCATE MULTIPLE DATASET*/             
   INTERPRET DSNAME                                               
   X = SYSDSN("'"DSNAME"'")                                       
   IF X = 'OK' THEN "DELETE ('"DSNAME"') "; /*DELETE OUTPUT FILE*/
   "ALLOC DA('"DSNAME"') "DISP,                                   
   "SPACE("SPC") "TSPC" DSORG("DSORG")",                         
   " RECFM("RECFM") LRECL("LRECL") BLKSIZE(0)" 
   IF RC = 0 THEN DO                           
   SAY ' DATASET ALLOCATED = ' DSNAME           
   END                                         
END                                             
SAY COPIES('-',80)                             
SAY CENTER(' FINAL DISPLAY ',80,' ')           
SAY COPIES('-',80)                             
EXIT RC                                         

To run it there are several sample in this forum looking for Rexx
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts trying to make sense of keylists TSO/ISPF 11
Search our Forums:

Back to Top