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
 
Lpar in CObol batch

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Lpar in CObol batch
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    Post subject:
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    Post subject:
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    Post subject:
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: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Wed Jul 30, 2008 3:22 am    Post subject:
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: 2504
Location: Atlanta, Georgia, USA

PostPosted: Wed Jul 30, 2008 11:08 pm    Post subject: Re: Lpar in CObol batch
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.

http://gsf-soft.com/Freeware/COB2SYS.shtml

Regards,

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

Global Moderator


Joined: 14 Mar 2007
Posts: 10327
Location: italy

PostPosted: Thu Jul 31, 2008 12:13 am    Post subject: Reply to: Lpar in CObol batch
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    Post subject: Reply to: Lpar in CObol batch
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    Post subject:
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    Post subject:
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    Post subject:
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    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
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts Generate public-private key in batch ... vasanthz All Other Mainframe Topics 3 Fri Sep 15, 2017 9:20 am
No new posts Working with hex values in Filemanage... Emile Straker IBM Tools 0 Tue Sep 12, 2017 1:42 am

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