Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Is DSN can be verified through cobol

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Is DSN can be verified through cobol
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

Senior Member


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

PostPosted: Wed Mar 19, 2008 1:41 pm    Post subject:
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    Post subject: Reply to: Is DSN can be verified through cobol
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: 757
Location: Germany

PostPosted: Wed Mar 19, 2008 4:47 pm    Post subject:
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: 6970
Location: porcelain throne

PostPosted: Wed Mar 19, 2008 4:52 pm    Post subject:
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    Post subject: Reply to: Is DSN can be verified through cobol
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10374
Location: italy

PostPosted: Wed Mar 19, 2008 5:17 pm    Post subject: Reply to: Is DSN can be verified through cobol
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: 757
Location: Germany

PostPosted: Wed Mar 19, 2008 5:28 pm    Post subject:
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: http://www-1.ibm.com/support/docview.wss?uid=isg1OA01530

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

Global Moderator


Joined: 14 Mar 2007
Posts: 10374
Location: italy

PostPosted: Wed Mar 19, 2008 5:35 pm    Post subject: Reply to: Is DSN can be verified through cobol
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: 757
Location: Germany

PostPosted: Wed Mar 19, 2008 6:15 pm    Post subject:
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    Post subject:
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: 757
Location: Germany

PostPosted: Wed Mar 19, 2008 8:24 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10374
Location: italy

PostPosted: Wed Mar 19, 2008 11:00 pm    Post subject: Reply to: Is DSN can be verified through cobol
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts COBOL - EXIT statement weird behavior anthony.pangestu COBOL Programming 0 Fri Oct 27, 2017 9:57 am
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us