IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Is DSN can be verified through cobol


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
veena_nagesh2002
Warnings : 1

Active User


Joined: 07 May 2005
Posts: 110
Location: hyderabad

PostPosted: Wed Mar 19, 2008 12:25 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Mar 19, 2008 1:41 pm
Reply with quote

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
View user's profile Send private message
veena_nagesh2002
Warnings : 1

Active User


Joined: 07 May 2005
Posts: 110
Location: hyderabad

PostPosted: Wed Mar 19, 2008 4:38 pm
Reply with quote

is there any way to identify since its is a ims db pgm

ex : listcat
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Wed Mar 19, 2008 4:47 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Mar 19, 2008 4:52 pm
Reply with quote

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
View user's profile Send private message
veena_nagesh2002
Warnings : 1

Active User


Joined: 07 May 2005
Posts: 110
Location: hyderabad

PostPosted: Wed Mar 19, 2008 5:10 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Mar 19, 2008 5:17 pm
Reply with quote

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
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Wed Mar 19, 2008 5:28 pm
Reply with quote

Hi !

For that, you cann call DSINFO (ispf-Service) and test the return fields.
An IBM-Apar has to be installed at your system for correct use.

Plse look: www-1.ibm.com/support/docview.wss?uid=isg1OA01530

Regards, UmeySan
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Mar 19, 2008 5:35 pm
Reply with quote

I would go for a standard, mantained IBM safe approach

check on how to use the IGGCSI00 from a cobol program
or thru an assembler stub

IGGCSI00 is the standard module for the Catalog Search Interface

http://www.redbooks.ibm.com/redbooks/pdfs/sg245594.pdf
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Wed Mar 19, 2008 6:15 pm
Reply with quote

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
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Wed Mar 19, 2008 8:10 pm
Reply with quote

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
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Wed Mar 19, 2008 8:24 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Mar 19, 2008 11:00 pm
Reply with quote

You just lost track of one post icon_smile.gif
Back to top
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Thu Mar 20, 2008 11:48 am
Reply with quote

Hi UmeySan,

Please see the 3rd post of the requestor which has requirement details.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top