View previous topic :: View next topic
|
Author |
Message |
veena_nagesh2002 Warnings : 1 Active User
Joined: 07 May 2005 Posts: 110 Location: hyderabad
|
|
|
|
can we verify a dataset through the cobol pgm(whether it is available or not ) and also the file attributes can be retrieved or not. if so please provide me the sample code. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Hi,
If you READ a DSN & status-code is 35, then it means DSN doesn't exist, not sure how to check for attributes using COBOL. However, there are better methods than using a COBOL program to check for existance (non-existance) of a DSN. |
|
Back to top |
|
|
veena_nagesh2002 Warnings : 1 Active User
Joined: 07 May 2005 Posts: 110 Location: hyderabad
|
|
|
|
is there any way to identify since its is a ims db pgm
ex : listcat |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
Hi !
...and also the file attributes can be retrieved or not ???
==> For that, best is to call a Assembler Sub-Programm which will do that by using IHADCB ControlBlock Macro:
USING IHADCB,R11
L R11,=A(S3OLD) ...This is the File
IF DCBOFLGS,Z,DCBOFOPN,TM
THEN C='DCB IS NOT ALREADY OPEND'
OPEN ((R11),INPUT) ...open DCB
LH R7,DCBLRECL ...get LRECL
LH R8,DCBBLKSI ...get BLKSIZE
EIF
Regards, UmeySan |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
veena_nagesh2002,
keep in mind, any dsn you mention in your jcl that does not exist and the disp indicates that the ds should exist (old,shr) will cause the jcl to fail and the job will not run - which is a pretty good indicator of the existance of a ds.
so unless you are doing dynamic allocation - in which case your cobol program can react to the return code - you need the dataset to exist. |
|
Back to top |
|
|
veena_nagesh2002 Warnings : 1 Active User
Joined: 07 May 2005 Posts: 110 Location: hyderabad
|
|
|
|
sorry, i think you are not clear with my query
I have an online pgm which is in IMSDC, based on the inputs in this screen my imscobol pgm will collect the information and
validates it and finally writes into IMSDB database. note : in one of the inputs the user will specify the file name which
can be 1 to 44 char. I would like to validate the dataset which the user is provided in the online screen through the
exisiting pgm at validation part. here is not concept of JCL or select statements
kindly help me on this |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
Quote: |
here is not concept of JCL or select statements |
it' s just an issue of giving the right info to get the right answer |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
Hi Enrico !
What do you think is a DSINFO-CALL. It's just an other IBM standard-call.
So, if you prefere the Catalog Search Interface, you just use a sms-interface. It's just a component of DFSMS.
In Cobol, using DSINFO its just one simple call ant then test RC if zero or not.
PROCEDURE DIVISION.
Move 'DSINFO' to SERVICE
Move 'BlaBlaBla' to DATAID
CALL 'ISPLINK' USING SERVICE DATAID.
I used CSI in assembler a time ago and i had to provide a hudge numer of fileds. Perhaps i did something wrong. So plse be so kind and just post a little example, so i could see, what i did wrong.
Regards & buona Pasqua !!!
UmeySan |
|
Back to top |
|
|
Devzee
Active Member
Joined: 20 Jan 2007 Posts: 684 Location: Hollywood
|
|
|
|
Quote: |
you cann call DSINFO (ispf-Service) |
This will not work.
The requester is trying to validate the dataset name from IMS DC online environment.
veena_nagesh2002 You may have to go for assembler code for your reqt. |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
Hi Devzee !
Question was: can we verify a dataset through the cobol pgm(whether it is available or not )
...or did i missunderstood something ???
Mfg, UmeySan |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
You just lost track of one post |
|
Back to top |
|
|
Devzee
Active Member
Joined: 20 Jan 2007 Posts: 684 Location: Hollywood
|
|
|
|
Hi UmeySan,
Please see the 3rd post of the requestor which has requirement details. |
|
Back to top |
|
|
|