View previous topic :: View next topic
|
Author |
Message |
somunote
New User
Joined: 23 Jan 2010 Posts: 7 Location: Toronto
|
|
|
|
Hi,
Is it possible for iebgener to receive the input data set name dynamically, then read it and copy it to the output file?
I don't have the data set name explicitly on the jcl. I have the name of the file I want to read in another data set.
Thanks. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
No. JCL does not support the concept of a dynamic file name. You'll have to do this process from inside a program, or generate the JCL with the proper dataset name dynamically.
Update:
Just a thought, but have you considered POSSIBLY using IDCAMS to do this? You can REPRO to/from a dataset name to/from a DD name. |
|
Back to top |
|
|
somunote
New User
Joined: 23 Jan 2010 Posts: 7 Location: Toronto
|
|
|
|
Do you mean with a repro?
Wouldn't I have to explicitly declare the input file name on the jcl anyway?
Thanks. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Did you consider using symbolic parameters, if iebgener resides in some PROC? By the way, "dynamically", in the context of your question leave many other questions...some more explanation about it might help us. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Maybe this will give you a clue or two
Code: |
//IEBGENER EXEC PGM=IEBGENER
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD DSN=&&TEMP,DISP=(,PASS),
// SPACE=(TRK,(2,2),RLSE),
// RECFM=FB,LRECL=80
//SYSUT1 DD *
dataset_name -
/*
//*
//IDCAMS01 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
PARM MARGINS(1 80)
LISTC ENT( -
// DD DSN=&&TEMP,DISP=(OLD,DELETE)
// DD *
)
/* |
|
|
Back to top |
|
|
jctgf Currently Banned Active User
Joined: 04 Nov 2006 Posts: 109
|
|
|
|
Hi,
I used repro INDATASET and it worked great.
with this command the file can be read without being declared in the jcl.
all one has to do is to created a card that will be used as idcams sysin.
Code: |
//idcams exec pgm=idcams
//fileout dd dsn=...
//sysin dd *
repro indataset('hello') outfile(fileout)
|
thanks. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
In fact, here is a complete solution as I have already used this myself.
The dataset with the dataset name is read by the SORT step and the IDCAMS card is generated and then IDCAMS does the copy
Code: |
//BUILDER EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=dataset with the name in it ,DISP=SHR
//SORTOUT DD DSN=&&TEMP001,DISP=(,PASS,DELETE),
// RECFM=FB,LRECL=80,
// SPACE=(CYL,(25,25),RLSE)
//SYSIN DD *
OPTION COPY
OUTFIL BUILD=(C' IDS(',1,44,1X,C') -',80:X)
/*
//*
//IDCAMS EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//OFILE DD SYSOUT=*
//SYSIN DD *
PARM MARGINS(1 80)
REPRO -
// DD DSN=&&TEMP001,DISP=SHR
// DD *
OFILE(OFILE)
/*
// |
|
|
Back to top |
|
|
somunote
New User
Joined: 23 Jan 2010 Posts: 7 Location: Toronto
|
|
|
|
expat,
I hadn't understood your first reply but that's exactly what I did.
good to know I did it right.
thanks. |
|
Back to top |
|
|
|