Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
how to make a dataset content as name to other dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: how to make a dataset content as name to other dataset
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    Post subject:
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    Post subject: Re: how to make a dataset content as name to other dataset
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: 436
Location: chennai, India

PostPosted: Thu Sep 22, 2005 6:25 pm    Post subject: Re: how to make a dataset content as name to other dataset
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
This topic is locked: you cannot edit posts or make replies. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us