how to find the length of name of a gdg



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

how to find the length of name of a gdg

Postby rawatdewan » Fri Apr 11, 2008 1:51 pm

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
rawatdewan
 
Posts: 14
Joined: Tue Jan 15, 2008 5:28 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby arunprasad.k » Fri Apr 11, 2008 4:32 pm

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.
arunprasad.k
 
Posts: 110
Joined: Thu Dec 27, 2007 5:18 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby rawatdewan » Fri Apr 11, 2008 5:30 pm

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.
rawatdewan
 
Posts: 14
Joined: Tue Jan 15, 2008 5:28 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby MrSpock » Fri Apr 11, 2008 5:46 pm

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.
User avatar
MrSpock
Global moderator
 
Posts: 807
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

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

Postby rawatdewan » Fri Apr 11, 2008 6:29 pm

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.
rawatdewan
 
Posts: 14
Joined: Tue Jan 15, 2008 5:28 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby MrSpock » Fri Apr 11, 2008 9:25 pm

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.
User avatar
MrSpock
Global moderator
 
Posts: 807
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

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

Postby dick scherrer » Sat Apr 12, 2008 12:05 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post