Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 8121
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: 2502
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: 10277
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 XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us