View previous topic :: View next topic
|
Author |
Message |
dilson joseph
New User
Joined: 18 Apr 2008 Posts: 6 Location: pune
|
|
|
|
Hi all,
I am facing a problem in my jcl, where i trying to check whether a dataset exist or not using IDCAMS. but i was getting a jcl error. here is my jcl
//step0110 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
LISTCAT ENTRIES('XUTC515.&DTST.&LPART')
/*
later i came to know that i have to give the exact name of the dataset in listcat entries.
is there any other way to create a jcl with my current requirement. please do help. |
|
Back to top |
|
|
sri_mf
Active User
Joined: 31 Aug 2006 Posts: 218 Location: India
|
|
|
|
dilson joseph wrote: |
Hi all,
I am facing a problem in my jcl, where i trying to check whether a dataset exist or not using IDCAMS. but i was getting a jcl error. here is my jcl
//step0110 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
LISTCAT ENTRIES('XUTC515.&DTST.&LPART')
/*
later i came to know that i have to give the exact name of the dataset in listcat entries.
is there any other way to create a jcl with my current requirement. please do help. |
LISTCAT ENTRIES works fine for the original dataset.I have tried executing ur code.
It returns the MAxcc=4 if the dataset does not exist.
Code: |
IDCAMS SYSTEM SERVICES
LISTCAT ENTRIES('XXXXXX.LIST.FF')
IDC3012I ENTRY XXXXX.LIST.FF NOT FOUND
IDC3009I ** VSAM CATALOG RETURN CODE IS 8 - REASON CODE IS IGG0CLEG-42
IDC1566I ** ZXDEVIR.LIST.FF NOT LISTED
|
Provide more info abt ur requirement ... |
|
Back to top |
|
|
vasanthkumarhb
Active User
Joined: 06 Sep 2007 Posts: 275 Location: Bang,iflex
|
|
|
|
Hi,
Check this Link
ibmmainframes.com/about7634.html
LISTCAST will just give you info reg the all gen's and limit
and other parameters like AIX, INDEX, PATH ENTRIES PROCESSED,
but getting the file creat datea and procesing can ...
Still your requirement is not clear
you should give cataloged dataset |
|
Back to top |
|
|
dilson joseph
New User
Joined: 18 Apr 2008 Posts: 6 Location: pune
|
|
|
|
hi thank u very much for ur fast reply.
i have tried before the same jcl with the name of the original dataset it worked fine. that is if we are giving
LISTCAT ENTRIES('XUTC515.cca.dsos.waybill.d1804') it will work fine.
but when we are giving a variable name that has the name of the dataset then this does not work.
as if LISTCAT ENTRIES('XUTC515.&DTST.&LPART') that is it will return rc=4 if the dataset is not there. in my jcl "&DTST" will contain the body part of the original dataset and "&LPART" will contain the extension part of the original dataset and then i am concatenating them. thus we can consider XUTC515.&DTST.&LPART as a variable name for the original dataset. so what i wanted is when we give the variable name it should check whether the dataset incoprated is existing or not. |
|
Back to top |
|
|
dilson joseph
New User
Joined: 18 Apr 2008 Posts: 6 Location: pune
|
|
|
|
sorry for a mistake above in this part "as if LISTCAT ENTRIES('XUTC515.&DTST.&LPART') that is it will return rc=4 if the dataset is not there"
it wont return rc=4 when the dataset is not there rather it will show jcl error. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
That's because symbolic substitution is a JCL facility, not applicable for SYSIN cards.
You CAN NOT use &whatever in SYSIN cards |
|
Back to top |
|
|
Bill Dennis
Active Member
Joined: 17 Aug 2007 Posts: 562 Location: Iowa, USA
|
|
|
|
You could write a simple pgm to read the DSN from a PARM (where you can use symbolics) and write the dsn to an output file. Concatenate that file into the IDCAMS SYSIN as:
Code: |
//SYSIN DD *
LISTCAT ENTRIES(
// DD DSN=YOUR.DSN.CARD,DISP=SHR
// DD *
) /* final paren */
/* |
|
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
Try this, JCL can do the substitution in a parm.
Code: |
000224 // SET HLQ=hlq
// SET NODE2=testnode
//STEP1 EXEC PGM=IKJEFT01,
// PARM='%RUNPARM LISTCAT ENT(''&HLQ..&NODE2'')'
//SYSEXEC DD DSN=hlq.REXX.EXEC,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY |
Where hlq.REXX.EXEC(runparm) contains
Code: |
/* REXX RUNPARM */
Parse Upper Arg prm
SAY prm
prm
Exit RC |
|
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
Why do I try the hard way first? No Rexx needed.
Try this:
Code: |
// SET HLQ=hlq
// SET NODE2=testnode
//STEP1 EXEC PGM=IKJEFT01,
// PARM='LISTCAT ENT(''&HLQ..&NODE2'')'
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY |
|
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
Good one Douglas! |
|
Back to top |
|
|
veena_nagesh2002 Warnings : 1 Active User
Joined: 07 May 2005 Posts: 110 Location: hyderabad
|
|
|
|
//PUXXXXX JOB (@),LISTCAT,MSGCLASS=R,CLASS=0,NOTIFY=PU7052A
//step0110 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
LISTCAT ENTRIES('PUXXX.ADC1.COPYLIB')
/*
is it possible only when the file is present in the system need to take a copy or else need to through a RC specified. This should happen in a single step. note : suggest me with any JCL utility |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Veena,
Quote: |
is it possible only when the file is present in the system need to take a copy or else need to through a RC specified. This should happen in a single step. |
Post is confusing and not clear.
Quote: |
note : suggest me with any JCL utility |
Only when you tell us about your requirement. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Dint you get the solution in the other topic? Why posting the same question in multiple topics?
Thanks,
Arun |
|
Back to top |
|
|
|