Page 1 of 1

how to find the length of name of a gdg

PostPosted: Fri Apr 11, 2008 1:51 pm
by rawatdewan
Hi,
i need to find out the length of a gdg through cobol pgm
and display it

eg.

DB2P.IMAGCPY.COTSP1

has a length of 19

so how can i get the name of the gdg in cobol pgm

Re: how to find the length of name of a gdg

PostPosted: Fri Apr 11, 2008 4:32 pm
by arunprasad.k
so how can i get the name of the gdg in cobol pgm


I do not understand this point. If you know the name provide it to the program using linkage section or by some files??

Post your requirements clearly, so that you will get a better chance of getting the results.

Arun.

Re: how to find the length of name of a gdg

PostPosted: Fri Apr 11, 2008 5:30 pm
by rawatdewan
actually the thing is that there are a lots of gdg's and i need to find out the length of the names of all the gdg's
so i want the names to be stored in a file with all related information of gdgs so that one by one i could read them and find out the length of each gdg and display them.

but the main thing is that i have to find the length of the gdg name.

Re: how to find the length of name of a gdg

PostPosted: Fri Apr 11, 2008 5:46 pm
by MrSpock
I'm not a COBOL guy, but isn't there an INSPECT verb? Something like

INSPECT WS-DSNAME TALLYING WS-SPACE-CNT FOR ALL SPACES.

then

WS-DSNAME-LENGTH = 44 - WS-SPACE-CNT.

Re: how to find the length of name of a gdg

PostPosted: Fri Apr 11, 2008 6:29 pm
by rawatdewan
sorry i think i am was not able to clarify my requirement
actually i dont have the gdg's names in any file
i have to read them from the system(catalog table)
and get there dsn in a cobol variable on which i can use inspect.

Re: how to find the length of name of a gdg

PostPosted: Fri Apr 11, 2008 9:25 pm
by MrSpock
Maybe you should take a couple of steps back and described your process workflow. What's the input? What's the output? What are the necessary steps to achieve your desired results? I don't really see why you'd want to write a COBOL program instead of using some basic scripts or some standard utilities, or both.

Re: how to find the length of name of a gdg

PostPosted: Sat Apr 12, 2008 12:05 am
by dick scherrer
Hello,

actually i dont have the gdg's names in any file
i have to read them from the system(catalog table)
If you list the catalog entries, you can place the output in a file (ratgher than the print queue) and then read that file into your cobol code and calculate the length of each dsn.