IBM i (旧AS400）の自己学習メモ０４　フリーのIBM i 開発環境構築

# 自己学習メモインデックス

[IBM i (旧AS400）の自己学習メモ　インデックス](https://qiita.com/You_name_is_YU/items/3964849e7803c8eaf767)

# 概要

Youtubeの[Mohammed Yusuf M](https://www.youtube.com/channel/UCsqXwU5_DFLJcRdEVCNkNNQ)というチャンネルの動画で、フリーでIBM iの開発環境が入手できるというのが紹介されていました。

この動画を参考に、まずは環境構築をしてみます。


## Request New Profile

以下にアクセス
http://www.pub400.com/cgi/signup.nd/start?ymode=NEW

![screencapture-pub400-cgi-signup-nd-start-2020-03-19-07_45_04.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/246556/5b390067-43ca-4e9a-f87a-64410003543c.png)

必要な情報を入力してSubmitボタンを押下
画面下部に、しばらくすると確認メールが届くよとメッセージが出力される。

<img width="895" alt="スクリーンショット 2020-03-19 7.45.49.png" src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/246556/69bca63b-49b5-7502-0a32-ffaac9a2a0c6.png">

Gmailでアカウントを申請したところ、迷惑メールに入ってしまっていたので気付くのが遅くなった。。。
以下のような感じのメールが届く。

```
件名：PUB400 - your user profile request
本文：
********************************************
*** NOTE - This message has been created
***        by a machine. Please do not reply
***        to this email. See below!
********************************************

Hello Yu ********,
this is PUB400.COM, your public IBM i hosted by POWERbunker.com

We received a request for a new user profile from IP 126.234.48.208.
To confirm this request and your email address, please
click this link:

http://pub400.com/cgi/signup.nd/vfy?yu=********&ys=328473

If it was not YOU requesting the account, you can ignore
this email and just do nothing.

Otherwise you will receive a second email with further
information on how to get started with the public IBM i.

Please allow the system 15 minutes to deliver this email.

Best regards
your RZKH operations team
RZKH GmbH, Weinsheim, Germany

- - - - - -
Please report all technical issues to ticket@rzkh.de
due to high number of requests processing might need some time.

If you receive an error after clicking the link above, please
send us a secreenshot by mail.
```

メール本文にあるリンクをクリックし、メールアドレスの検証が完了すると、
また数分後にメールが届く。

```
件名：PUB400 - your user profile
本文：
********************************************
*** NOTE - This message has been created
***        by a machine. Please do not reply
***        to this email. See below!
********************************************

Hello Yu ********,
this is PUB400.COM, your public IBM i hosted by POWERbunker.com

Thanks for confirming your eMail-Address (which only will be used
to communicate with you if you need to reset your password).

Your user profile ******** has been created for you. Your
initial password for signon is: ********

To connect, follow these steps:
- install a 5250 compatible telnet client. For example:
  > http://tn5250j.org
  > https://www-01.ibm.com/support/docview.wss?uid=isg3T1026805
    (signon with a free IBM ID is required)
  > or use a search engine for "tn5250"
- there is no "web access" for IBM i.

- configure your client to connect to PUB400.COM  (yes, that is a
  valid DNS name. Do not enter an IP address!)
- when you connect, you should see a signon screen
- enter your user name and your initial password
- press enter or rCTL key (depending on your client config)
- at first signon you are forced to change your password
  (see the messages at the bottom of the screen)
- enter your initial password, and your new password twice.
- after the password change, you should see IBM i main menu
- as soon as you set your final password, you also can use
ssh to connect to the system for open source projects.

At the moment, there still is some work to be done by us.
We just set up a simple forum. See http://PUB400.COM  and
scroll down. You can signon with your IBM i password.

If you are new to IBM i, please use the internet to gather some
information; at the moment we do not have much time to
help with start in programming etc.
We are going to add some interesting links on the main page.

If you have issues in connecting to the system, first check
your internet, firewall etc. Sometimes, access to port 23 (telnet)
is blocked by providers, use SSL to port 992 instead.
(we recently heard about issues from users from south africa)

IMPORTANT! Please respect the following:
- do not disturb other users in any way!
- do not try to peek into other users data!
- this system is not intended for commercial use
- no sharing of data with other user profiles allowed
- system might be offline for maintenance. In that case please do
not send a problem report, simply retry some hours later.
- Performance of the system may vary depending on number of
users and load of other environments.
- Do NOT create objects in Library QGPL - they will be deleted!
- there is no backup of your data. We sometimes might run a
system backup but you cannot rely on us being able to restore
data of a specified date.
- check out http://rzkh.de for professional IBM i hosting.


Best regards
your RZKH operations team
RZKH GmbH, Weinsheim, Germany

- - - - - -
Please report all technical issues to ticket@rzkh.de
due to high number of requests processing might need some time.
```

## MacにMocha TN5250 Liteをセットアップ

MacでIBM iに接続するための5250エミュレータをインストールします。
無料で入手できる`Mocha TN5250 Lite`を使います。

App Storeで`Mocha TN5250 Lite`を検索しインストール。

Configure

- IP
    - PUB400.COM
    - メールにあるように、IPアドレスは使わないでドメインでアクセスする。
- EBCDIC codepage
    - 1399とか5026とかがなかったので、とりあえずUS(037)
- User
    - プロファイルをリクエストした際に指定したユーザID
- Password
    - メールで届いたパスワード
<img width="595" alt="68747470733a2f2f71696974612d696d6167652d73746f72652e73332e61702d6e6f727468656173742d312e616d617a6f6e6177732e636f6d2f302f3234363535362f66373863303662362d366265652d646238372d383862362d3831616139396535386165632e706e67.png" src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/246556/a361ed34-16ed-023c-0959-cba4205d2ce9.png">


この状態で接続すると、いきなりパスワードの変更を求められる。

<img width="712" alt="スクリーンショット 2020-03-19 20.30.27.png" src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/246556/0b0e9fa3-1e58-d273-0daf-4cdf026f844b.png">

Enterを押下

<img width="712" alt="99.png" src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/246556/2c173125-b170-9d8e-fe38-2d258eaeae9b.png">

- Current Password
    - メールに記載されたパスワード
- New password / New password (to verify)
    - 変更後のパスワード

を入力してEnterを押下

<img width="712" alt="スクリーンショット 2020-03-19 20.31.41.png" src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/246556/fae82c57-5f6a-9c67-ab89-3edc769a08f8.png">

これでASの環境にアクセスできた。
`call qcmd`を打ってみる

<img width="712" alt="スクリーンショット 2020-03-19 20.32.08.png" src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/246556/133afe52-9682-6d67-296d-5a184d50256b.png">

<img width="712" alt="スクリーンショット 2020-03-19 20.32.12.png" src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/246556/53e9f8ec-35ad-4efe-613a-38483cae5a85.png">

AS400にアクセスできているようです。

バージョンを確認してみると`V7R4`だったので最新でしたw

<img width="712" alt="スクリーンショット 2020-03-19 20.41.46.png" src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/246556/56f1f969-0839-b296-189f-676dc49c9414.png">