Page 1 of 1

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

PostPosted: Fri Aug 03, 2018 6:21 am
by dhansr
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.

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

PostPosted: Fri Aug 03, 2018 6:34 am
by Robert Sample
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.

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

PostPosted: Fri Aug 03, 2018 8:09 am
by steve-myers
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!?

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

PostPosted: Fri Aug 03, 2018 8:55 am
by dhansr
Hi Robert,

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

Regards,
Dhananjaya.

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

PostPosted: Fri Aug 03, 2018 9:04 am
by dhansr
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,