Help with Accept command to know i am on Mainframe or Linux



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

Help with Accept command to know i am on Mainframe or Linux

Postby dhansr » Fri Aug 03, 2018 6:21 am

Hi,

We are migrating Mainframe COBOL code to LINUX and this COBOL code will work both in Mainframe and Linux in MicroFocus environment. I have a requirement where i need to perform certain function based on whether i am Mainframe or Linux. Is there a system information which i can get while i am on Mainframe by using ACCEPT command or any other command which will tell me that i am on mainframe? It could be OS name or OS version or anything because it will not be same on Linux.

My only requirement is to know whether program is executing in Mainframe or LINUX. We do not want to change JCL because we have large number of JCLS to be changed.

Thanks,
Dhananjaya.
dhansr
 
Posts: 5
Joined: Wed Jun 29, 2016 11:21 pm
Has thanked: 3 times
Been thanked: 0 time

Re: Help with Accept command to know i am on Mainframe or Li

Postby Robert Sample » Fri Aug 03, 2018 6:34 am

Since the mainframe is EBCDIC and Linux is ASCII, I think your best best is
MOVE FUNCTION ORD('A') TO <variable>
where <variable> is a 3-digit zoned decimal value. If the value returned is 194, you're working with an EBCDIC A; if the value returned is 66, you're working with an ASCII A. Note that the ORD function returns values in the range 1 to 256, not 0 to 255, and hence the values I mentioned are one higher than the collating sequence value.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Help with Accept command to know i am on Mainframe or Li

Postby steve-myers » Fri Aug 03, 2018 8:09 am

dhansr wrote:... We are migrating Mainframe COBOL code to LINUX and this COBOL code will work both in Mainframe and Linux ...

My only requirement is to know whether program is executing in Mainframe or LINUX. We do not want to change JCL because we have large number of JCLS to be changed. ...

There is no JCL in Linux! You have to reimplement your operating environment!

What bonehead came up with that idea!?
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Help with Accept command to know i am on Mainframe or Li

Postby dhansr » Fri Aug 03, 2018 8:55 am

Hi Robert,

Thanks a ZILLION :D for the solution and appreciate your quick response, i believe this would solve my problem.

Regards,
Dhananjaya.
dhansr
 
Posts: 5
Joined: Wed Jun 29, 2016 11:21 pm
Has thanked: 3 times
Been thanked: 0 time

Re: Help with Accept command to know i am on Mainframe or Li

Postby dhansr » Fri Aug 03, 2018 9:04 am

Hi Steve,

We have hosted the Mainframe applications in MicroFocus container which runs on Linux with DB2 LUW on AIX box. It is a plain a LIFT and SHIFT with minor compatibility changes.

Regards,
dhansr
 
Posts: 5
Joined: Wed Jun 29, 2016 11:21 pm
Has thanked: 3 times
Been thanked: 0 time


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post