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

Lpar in CObol batch


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

New User


Joined: 06 Apr 2007
Posts: 33
Location: USA

PostPosted: Wed Jul 30, 2008 1:04 am
Reply with quote

Is there a way to know in Cobol batch program the system-id or the Lpar that the program is running under?
Back to top
View user's profile Send private message
vebs

New User


Joined: 27 Oct 2007
Posts: 19
Location: UK

PostPosted: Wed Jul 30, 2008 1:23 am
Reply with quote

In the JESMSGLG DD of your Job history, you can check which LPAR did your job get executed on... and a lot of other information about job execution.

- Cheers !
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Wed Jul 30, 2008 2:34 am
Reply with quote

I think Ami wants to know at execute time, not after the program has finished.
Back to top
View user's profile Send private message
ami777us

New User


Joined: 06 Apr 2007
Posts: 33
Location: USA

PostPosted: Wed Jul 30, 2008 3:10 am
Reply with quote

Yes, I want to know at the execute time.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Jul 30, 2008 3:22 am
Reply with quote

LPAR name can be derived by a COBOL program but you've got to chase through some memory blocks to find it. Google "lpar name" and you should be able to find a program to do what you want.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Jul 30, 2008 11:08 pm
Reply with quote

Link below to Gilbert Saint-Flour's program "COB2SYS". One of the fields resolved in this program (amongst many others) is the LPAR-Name.

gsf-soft.com/Freeware/COB2SYS.shtml

Regards,

Bill
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Thu Jul 31, 2008 12:13 am
Reply with quote

might look a sophisticated approach,
but it' s really one of the most foolish things to be done,

to have application programs rely on the hardware definitions and naming conventions

if You incur in a disaster recovery situation,
the environment and the hardware definitions will certainly be different,
and ... guess what icon_cool.gif

this kind of things would not certainly pass any audit on good IT practices,

just my 2€ , but that' s Your organization who might get into trouble
Back to top
View user's profile Send private message
ami777us

New User


Joined: 06 Apr 2007
Posts: 33
Location: USA

PostPosted: Thu Jul 31, 2008 12:43 am
Reply with quote

Thanks a lot. It worked!
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Thu Jul 31, 2008 12:45 am
Reply with quote

For the benefit of others, which option did you use?
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Thu Jul 31, 2008 4:24 am
Reply with quote

enrico-sorichetti:

Maybe they run or they will be running the same job/program on multiple LPARs and have printouts from them. They want the program to dynamically find the LPAR it is running on so they don't have to hard code that in the JCL as a parm.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Thu Jul 31, 2008 6:07 pm
Reply with quote

Here's another approach. I think it's what you want:
Code:
       IDENTIFICATION DIVISION.                             
       PROGRAM-ID. GETSYSID.                                 
       AUTHOR.                                               
       ENVIRONMENT DIVISION.                                 
       DATA DIVISION.                                       
       WORKING-STORAGE SECTION.                             
       LINKAGE SECTION.                                     
       01  PSA-DATA.                                       
           05  FILLER              PIC  X(016).             
           05  CVT-ADDR                  POINTER.                 
       01  CVT-DATA.                                       
           05  FILLER              PIC  X(196).             
           05  CVT-SMF-ADDR              POINTER.                 
       01  SMF-DATA.                                       
           05  FILLER              PIC  X(016).             
           05  SMF-SYS-ID          PIC  X(004).             
       PROCEDURE DIVISION.                                   
           SET ADDRESS OF PSA-DATA  TO NULL                 
           SET ADDRESS OF CVT-DATA  TO CVT-ADDR         
           SET ADDRESS OF SMF-DATA  TO CVT-SMF-ADDR     
           DISPLAY 'JOB RUNNING ON SYSID >' SMF-SYS-ID '<'       
           GOBACK                                           
           . 
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 Routing command Address SDSF to other... TSO/ISPF 2
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top