|
View previous topic :: View next topic
|
| Author |
Message |
murthy79
New User
Joined: 22 Sep 2005 Posts: 2
|
|
|
|
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 |
|
 |
MGIndaco
Active User

Joined: 10 Mar 2005 Posts: 432 Location: Milan, Italy
|
|
|
|
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 |
|
 |
Kevin
Active User

Joined: 25 Aug 2005 Posts: 234
|
|
|
|
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 |
|
 |
radhakrishnan82
Active User

Joined: 31 Mar 2005 Posts: 435 Location: chennai, India
|
|
|
|
| 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 |
|
 |
MGIndaco
Active User

Joined: 10 Mar 2005 Posts: 432 Location: Milan, Italy
|
|
|
|
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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|