COBOL challenge 
Author Message
 COBOL challenge


Quote:

>>Do any of you COBOL experts out there have solution to this problem?  I need
>>to retrieve the DSN of the sequential disk file that I am opening in COBOL
>>OS/390.  So far, the only suggestion I have is run a LISTCAT to a file and
>>read the file.  I need a more elegant and reliable solution than that.

>>The file in question will be a GDG member.  I need the fully-qualified name:
>>eg aaa.bbb.ccc.g0010v00 to build a parameter to be passed off to a started
>>task.

>>Any help would be appreciated.

>You need an assembler subroutine.  That's a nono at some
>installations, so if you're interested, say so and I'll post the code
>here.  It's not very long.

No you don't. You can do it in COBOL. You can issue TSO requests from programs
written in high level languages. I'm on the road right now, and I don't have
the notes with me, but in our Advanced TSO REXX class we do just that.

Check out

TSO/E Programming Services (SC28-1971-01); or file ikj3b701 on Book Manager or
READMVS.

Good luck,

Steve Comstock
Telephone: 303-393-8716
www.trainersfriend.com

256-B S. Monaco Parkway
Denver, CO 80224
USA



Sat, 23 Sep 2000 03:00:00 GMT  
 COBOL challenge

Of course, this assumes that the program is running under IKJEFT01. If
so, then a call to IRXJCL or IRXEXEC passing the rexx to execute as a
parm will do the trick. If the job is not running under TSO batch, you
can still call a rexx, but it cannot issue the required "LISTA ST".

mickey

Quote:



> >>Do any of you COBOL experts out there have solution to this problem?  I need
> >>to retrieve the DSN of the sequential disk file that I am opening in COBOL
> >>OS/390.  So far, the only suggestion I have is run a LISTCAT to a file and
> >>read the file.  I need a more elegant and reliable solution than that.

> >>The file in question will be a GDG member.  I need the fully-qualified name:
> >>eg aaa.bbb.ccc.g0010v00 to build a parameter to be passed off to a started
> >>task.

> >>Any help would be appreciated.

> >You need an assembler subroutine.  That's a nono at some
> >installations, so if you're interested, say so and I'll post the code
> >here.  It's not very long.

> No you don't. You can do it in COBOL. You can issue TSO requests from programs
> written in high level languages. I'm on the road right now, and I don't have
> the notes with me, but in our Advanced TSO REXX class we do just that.

> Check out

> TSO/E Programming Services (SC28-1971-01); or file ikj3b701 on Book Manager or
> READMVS.

> Good luck,

> Steve Comstock
> Telephone: 303-393-8716
> www.trainersfriend.com

> 256-B S. Monaco Parkway
> Denver, CO 80224
> USA



Sat, 23 Sep 2000 03:00:00 GMT  
 COBOL challenge


Quote:
>Do any of you COBOL experts out there have solution to this problem?  I need
>to retrieve the DSN of the sequential disk file that I am opening in COBOL
>OS/390.  So far, the only suggestion I have is run a LISTCAT to a file and
>read the file.  I need a more elegant and reliable solution than that.

>The file in question will be a GDG member.  I need the fully-qualified name:
>eg aaa.bbb.ccc.g0010v00 to build a parameter to be passed off to a started
>task.

>Any help would be appreciated.

Probably the easiest way is a call to Assembler, but that probably
isn't the answer you wanted to hear   :)

Dave




Sat, 23 Sep 2000 03:00:00 GMT  
 COBOL challenge

Quote:

> You can probably follow the chain of control blocks to get the dataset name.  I
> have written a Cobol program that starts at the CVT which if I remember
> correctly is at location 16.  That in turn points to TCB words which points to
> something else, etc, etc.  Eventually I got to the job & stepnames which is what
> I wanted,  I'm sure you could follow the pointers to wherever the dsn is
> stored.  The tricky parts were the CVT address (16), getting the 16 into a
> pointer address (use a redefines of a 4 byte area), using the "set address of

<snip>

In Unisys A Series Cobol (85 or 74) we say "MOVE ATTRIBUTE FILENAME OF
<file> TO <dataname>".  If it's harder on your computer, you should have
bought a better computer.

--
I  |\   Randall Bart, A Series Bigot

o  |\   1-310-542-6013                       Please reply without spam
v  | \  
e    |\ Todd McCormick jailed for using Marinol with prescription:
Y    |/        http://{*filter*}magazine.com/toc/articles/toddheld.html
o    |\ Panic in the Year Zero Zero:   http://www.*-*-*.com/ ;
u    |/ Is it easy yet?: http://www.*-*-*.com/



Sat, 23 Sep 2000 03:00:00 GMT  
 COBOL challenge

Quote:

> You can (eventually) get the DDname that way, but you have to read the
> job file control block to get the DSname.  There are no pointers to
> chase to get the DSname.

*
* Chase the DS Name...
*

* Address the CVT
        Set address of Comm-Vect-Tbl to '16'

* Address the head of the TCB list
        Set address of Task-Cntl-Blk to 'first word in CVT'

* Address the TCB for the currently running task
        Set address of Task-Cntl-Blk to 'first word in TCB'

* Address the TIOT
        Set address of Task-IO-Tbl to '12-bytes into the TCB'

* find the job step control block using TCBJSCB
        Set address of Job-Step-Cntl-Blk to '180 bytes into the TIOT'

* find the data set assn blk using JSCDSABQ
        Set address of Data-Set-Assn-Blk to '140 bytes into the JSCB'

* Surf the DSAB List looking for your DDname
        set not-done to true
        Perform until 'pointer 4 bytes into DSAB' = Null or done
                set address of my-ddname to '16 bytes into dsab'
                if it-is-the-one-I-am-looking-for
                        set address of my-ds-name to '28 bytes into the dscb'
                        set done to true
                end-if
        End-perform

Please note, in the set address to '...' the '...' represents a pointer,
the ofset and record of where to find that pointer are within the
tickmarks...

Best of luck, but if you want my advice, write a small asm program to do
the
dynamic information retrival, you can do all your text units from Cobol
and
just have the subprogram to do the dynalloc.



Sun, 24 Sep 2000 03:00:00 GMT  
 COBOL challenge

Quote:


> > You can (eventually) get the DDname that way, but you have to read the
> > job file control block to get the DSname.  There are no pointers to
> > chase to get the DSname.

> *
> * Chase the DS Name...
> *

> * Address the CVT
>         Set address of Comm-Vect-Tbl to '16'

> * Address the head of the TCB list
>         Set address of Task-Cntl-Blk to 'first word in CVT'

> * Address the TCB for the currently running task
>         Set address of Task-Cntl-Blk to 'first word in TCB'

> * Address the TIOT
>         Set address of Task-IO-Tbl to '12-bytes into the TCB'

> * find the job step control block using TCBJSCB
>         Set address of Job-Step-Cntl-Blk to '180 bytes into the TIOT'

> * find the data set assn blk using JSCDSABQ
>         Set address of Data-Set-Assn-Blk to '140 bytes into the JSCB'

> * Surf the DSAB List looking for your DDname
>         set not-done to true
>         Perform until 'pointer 4 bytes into DSAB' = Null or done
>                 set address of my-ddname to '16 bytes into dsab'
>                 if it-is-the-one-I-am-looking-for
>                         set address of my-ds-name to '28 bytes into the dscb'
>                         set done to true
>                 end-if
>         End-perform

> Please note, in the set address to '...' the '...' represents a pointer,
> the ofset and record of where to find that pointer are within the
> tickmarks...

> Best of luck, but if you want my advice, write a small asm program to do
> the
> dynamic information retrival, you can do all your text units from Cobol
> and
> just have the subprogram to do the dynalloc.

  very nice!  my compliments.  well worth saving.


Sun, 24 Sep 2000 03:00:00 GMT  
 COBOL challenge

However, the assembler routine will use about 0.1% as much CPU as starting
a TSO space.  Also, many assembler routines to do this sort of thing can
actually be converted to COBOL if you have COBOL II or later (and hence
'SET ADDRESS OF...').  The downside of that approach, however, is that when
IBM changes the layout of the system data areas, you have to manually
update your layouts (hopefully copybooks).  Therefore, better to use the
assembler routine and reference the structures from the IBM supplied
macros.

I'll also try to find our assembler routine at work and pass it along.




Quote:
> Of course, this assumes that the program is running under IKJEFT01. If
> so, then a call to IRXJCL or IRXEXEC passing the rexx to execute as a
> parm will do the trick. If the job is not running under TSO batch, you
> can still call a rexx, but it cannot issue the required "LISTA ST".

> mickey




> > >>Do any of you COBOL experts out there have solution to this problem?
I need
> > >>to retrieve the DSN of the sequential disk file that I am opening in
COBOL
> > >>OS/390.  So far, the only suggestion I have is run a LISTCAT to a
file and
> > >>read the file.  I need a more elegant and reliable solution than
that.

> > >>The file in question will be a GDG member.  I need the

fully-qualified name:

- Show quoted text -

Quote:
> > >>eg aaa.bbb.ccc.g0010v00 to build a parameter to be passed off to a
started
> > >>task.

> > >>Any help would be appreciated.

> > >You need an assembler subroutine.  That's a nono at some
> > >installations, so if you're interested, say so and I'll post the code
> > >here.  It's not very long.

> > No you don't. You can do it in COBOL. You can issue TSO requests from
programs
> > written in high level languages. I'm on the road right now, and I don't
have
> > the notes with me, but in our Advanced TSO REXX class we do just that.

> > Check out

> > TSO/E Programming Services (SC28-1971-01); or file ikj3b701 on Book
Manager or
> > READMVS.

> > Good luck,

> > Steve Comstock
> > Telephone: 303-393-8716
> > www.trainersfriend.com

> > 256-B S. Monaco Parkway
> > Denver, CO 80224
> > USA



Wed, 27 Sep 2000 03:00:00 GMT  
 COBOL challenge



---------- snip -----------

Quote:
> In Unisys A Series Cobol (85 or 74) we say "MOVE ATTRIBUTE FILENAME OF
> <file> TO <dataname>".  If it's harder on your computer, you should have
> bought a better computer.

I thought on a Unisys Series A you said

  IF NEXT-LAYOFF-IMMINENT = 'YES'
     PERFORM PRINT-RESUME
  ELSE
     PERFORM STOP-KIDDING-YOURSELF.

Or is this only for people who actually work *for* Unisys (or whatever
their newest owners call them this week...).                              


-----------------
   "Nobody ever got fired for buying IBM...."



Wed, 27 Sep 2000 03:00:00 GMT  
 COBOL challenge

Quote:

> I thought on a Unisys Series A you said

>   IF NEXT-LAYOFF-IMMINENT = 'YES'
>      PERFORM PRINT-RESUME
>   ELSE
>      PERFORM STOP-KIDDING-YOURSELF.

It was that way, but Y2K is Jurassic Park for us niche dinosaurs, too.

Actually the Unisys "Heterogeneous" machines have some potential.  Using
the WinNT side to front end an internet face with the A Series hosting a
DMS II database just might turn into a platform that Unisys can sell to
non-Unisys shops.  Then again it might not.

--
I  |\   Randall Bart

o  |\   1-310-542-6013                       Please reply without spam
v  | \  Cancer victim/Medical {*filter*} activist Todd McCormick jailed
e    |\ for using Marinol w/ prescription: http://www.*-*-*.com/ {*filter*}.org
Y    |/        http://{*filter*}magazine.com/toc/articles/toddheld.html
o    |\ Panic in the Year Zero Zero:   http://www.*-*-*.com/ ;
u    |/ Is it easy yet?: http://www.*-*-*.com/



Wed, 27 Sep 2000 03:00:00 GMT  
 COBOL challenge

Quote:

> However, the assembler routine will use about 0.1% as much CPU as starting
> a TSO space.

Agreed. However, a DB2 program running without a CAF is already in a TSO
address space, so why not use it.

mickey

Quote:
>  Also, many assembler routines to do this sort of thing can
> actually be converted to COBOL if you have COBOL II or later (and hence
> 'SET ADDRESS OF...').  The downside of that approach, however, is that when
> IBM changes the layout of the system data areas, you have to manually
> update your layouts (hopefully copybooks).  Therefore, better to use the
> assembler routine and reference the structures from the IBM supplied
> macros.

> I'll also try to find our assembler routine at work and pass it along.




> > Of course, this assumes that the program is running under IKJEFT01. If
> > so, then a call to IRXJCL or IRXEXEC passing the rexx to execute as a
> > parm will do the trick. If the job is not running under TSO batch, you
> > can still call a rexx, but it cannot issue the required "LISTA ST".

> > mickey




> > > >>Do any of you COBOL experts out there have solution to this problem?
> I need
> > > >>to retrieve the DSN of the sequential disk file that I am opening in
> COBOL
> > > >>OS/390.  So far, the only suggestion I have is run a LISTCAT to a
> file and
> > > >>read the file.  I need a more elegant and reliable solution than
> that.

> > > >>The file in question will be a GDG member.  I need the
> fully-qualified name:
> > > >>eg aaa.bbb.ccc.g0010v00 to build a parameter to be passed off to a
> started
> > > >>task.

> > > >>Any help would be appreciated.

> > > >You need an assembler subroutine.  That's a nono at some
> > > >installations, so if you're interested, say so and I'll post the code
> > > >here.  It's not very long.

> > > No you don't. You can do it in COBOL. You can issue TSO requests from
> programs
> > > written in high level languages. I'm on the road right now, and I don't
> have
> > > the notes with me, but in our Advanced TSO REXX class we do just that.

> > > Check out

> > > TSO/E Programming Services (SC28-1971-01); or file ikj3b701 on Book
> Manager or
> > > READMVS.

> > > Good luck,

> > > Steve Comstock
> > > Telephone: 303-393-8716
> > > www.trainersfriend.com

> > > 256-B S. Monaco Parkway
> > > Denver, CO 80224
> > > USA



Wed, 27 Sep 2000 03:00:00 GMT  
 
 [ 12 post ] 

 Relevant Pages 

1. a challenge for mf-cobol wizards

2. COBOL COBOL COBOL

3. COBOL//COBOL//COBOL

4. COBOL COBOL COBOL

5. COBOL-COBOL-COBOL

6. C# challenge closed

7. Empty array challenge ''=i.0

8. Clock Challenge II

9. GCD (was Clock Challenge II)

10. Clock Challenge II

11. Challenge: ACM Ball Clock Problem

12. Challenge: ACM Ball Clock Problem (was: The SIGAPL Web

 

 
Powered by phpBB® Forum Software