Copyright © Blog yang lainnya
Design by Dzignine
Sabtu, 07 Januari 2012

[Tutorial] Membuat display hello world pemrograman AS/400

Tutorial by: belajarbersama

Sumber : http://kask.us/2998843

Mari belajar bersama :)

Kebetulan saya cukup mengerti sedikit2 mengenai pemograman AS400.

Saya coba sediakan tutorial untuk menampilkan hello world ini, apabila ada kekurangan boleh langsung di complain :)

Langkah2 membuat display hello world adalah,
1. Membuat Display File (DSPF) dam Compile
2. Membuat Coding RPGLE dan Compile
3. Run Test

Akan kita bahas 1 1 ya.

Pertama, saya anggap semua sudah bisa melakukan login ke AS400 ya,
Untuk tutorial ini saya menggunakan telnet ke rzkh.de

> membuat file dspf

Halaman petama setelah halaman login

Code:

GUEST                       GUEST menu

Select one of the following:

1. Start PDM program development manager
2. work with active jobs
3. send message to HOLLE (operator)
4. work with system status
5. some games
6. start chat (or enter CHAT in command line and press F4)
(chat also viewable at http://www.holgerscherer.de/chatf.html )
7. start TN5250-based WWW-browser
8. show help (or enter HELP and command prompt)

10. display AS/400 main menu

90. Log off

Ketikkan WRKMBRPDM, lalu tekan F4


Code:

                     Work with Members Using PDM (WRKMBRPDM)

Type choices, press Enter.

File . . . . . . . . . . . . . . FILE qddssrc
Library . . . . . . . . . . . belajar1
Member . . . . . . . . . . . . . MBR *ALL
Member type . . . . . . . . . . MBRTYPE *ALL


Code:

                          Work with Members Using PDM                 PUB1

File . . . . . . QDDSSRC
Library . . . . BELAJAR1 Position to . . . . .

Type options, press Enter.
2=Edit 3=Copy 4=Delete 5=Display 6=Print 7=Rename
8=Display description 9=Save 13=Change text 14=Compile 15=Create module..

Opt Member Type Text

(No members in file)

QDDSSRC, akan berisikan semua attribute *FILE.
Di sini kita akan membuat Display File (DSPF) yang akan kita gunakan untuk menampilkan tulisan “hello world”

Tekan F6 – Create, dan isikan seperti berikut


Code:

                       Start Source Entry Utility (STRSEU)

Type choices, press Enter.

Source file . . . . . . . . . . SRCFILE > QDDSSRC
Library . . . . . . . . . . . > BELAJAR1
Source member . . . . . . . . . SRCMBR HELLOWF
Source type . . . . . . . . . . TYPE DSPF
Text 'description' . . . . . . . TEXT hello world dspf


Code:

Columns . . . :    1  71            Edit                      BELAJAR1/QDDSSRC
SEU==> HELLOWF
FMT DP .....AAN01N02N03T.Name++++++RLen++TDpBLinPosFunctions++++++++++++++++++
*************** Beginning of data *************************************
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
****************** End of data ****************************************

Lumayan sulit membuat DSPF menggunakan model text ini, kita akan mencoba yang lebih mudah menggunakan display layar

Tekan F3, jangan lupa ganti ‘Y’ di Change/Create member untuk menyimpan member yang telah kita buat


Code:

                                     Exit

Type choices, press Enter.

Change/create member . . . . . . . Y Y=Yes, N=No
Member . . . . . . . . . . . . . HELLOWF Name, F4 for list
File . . . . . . . . . . . . . . QDDSSRC Name, F4 for list
Library . . . . . . . . . . . . BELAJAR1 Name
Text . . . . . . . . . . . . . . hello world dspf

Resequence member . . . . . . . . Y Y=Yes, N=No
Start . . . . . . . . . . . . . 0001.00 0000.01-9999.99
Increment . . . . . . . . . . . 01.00 00.01-99.99

Print member . . . . . . . . . . . N Y=Yes, N=No

Return to editing . . . . . . . . . N Y=Yes, N=No

Go to member list . . . . . . . . . N Y=Yes, N=No

Setelah tekan Enter, akan muncul display seperti di bawah.

Masukkan Option 17 di member HELLOWF


Code:

                           Work with Members Using PDM                 PUB1

File . . . . . . QDDSSRC
Library . . . . BELAJAR1 Position to . . . . .

Type options, press Enter.
2=Edit 3=Copy 4=Delete 5=Display 6=Print 7=Rename
8=Display description 9=Save 13=Change text 14=Compile 15=Create module..

Opt Member Type Text
17 HELLOWF DSPF hello world dspf

Bottom
Parameters or command


Code:

                      Work with Display Records
File . . . . . . : QDDSSRC Member . . . . . . : HELLOWF
Library . . . . : BELAJAR1 Source type . . . : DSPF

Type options, press Enter.
1=Add 2=Edit comments 3=Copy 4=Delete
7=Rename 8=Select keywords 12=Design image

Opt Order Record Type Related Subfile Date DDS Error

(No records in file)

Ketikkan seperti berikut


Code:

                     Work with Display Records

File . . . . . . : QDDSSRC Member . . . . . . : HELLOWF
Library . . . . : BELAJAR1 Source type . . . : DSPF

Type options, press Enter.
1=Add 2=Edit comments 3=Copy 4=Delete
7=Rename 8=Select keywords 12=Design image

Opt Order Record Type Related Subfile Date DDS Error
1 #DISP1

(No records in file)

Tekan Enter


Code:

                               Add New Record

File . . . . . . : QDDSSRC Member . . . . . . : HELLOWF
Library . . . . : BELAJAR1 Source type . . . : DSPF

Type choices, press Enter.

New record . . . . . . . . . . . . . . . #DISP1 Name

Type . . . . . . . . . . . . . . . . . . RECORD RECORD, USRDFN
SFL, SFLMSG
WINDOW, WDWSFL
PULDWN, PDNSFL
MNUBAR

F3=Exit F5=Refresh F12=Cancel


Tekan Enter


Code:

Work screen for record #DISP1: Press Help for function keys.



Code:

                     +O(20)



Code:

                    ?OOOOOOOOOOOOOOOOOOOO


Ketikkan ‘?’ di depan karakter tersebut, untuk mengganti nama field


Code:

FLD003     Length: 00020 TEXT:



Code:

TEXT1      Length: 00020 TEXT:


Enter.

Tekan F3, isi selection dengan ‘1’


Code:

                                Exit SDA Work Screen

Select one of the following:

1. Save work since last Enter and exit work screen
2. Exit without saving any work done on the work screen
3. Resume work screen session

Selection
1

F12=Cancel



Code:

                     Work with Display Records

File . . . . . . : QDDSSRC Member . . . . . . : HELLOWF
Library . . . . : BELAJAR1 Source type . . . : DSPF

Type options, press Enter.
1=Add 2=Edit comments 3=Copy 4=Delete
7=Rename 8=Select keywords 12=Design image

Opt Order Record Type Related Subfile Date DDS Error

10 #DISP1 RECORD 04/13/10



Code:

Record #DISP1 added to member HELLOWF.


Tekan F3 lagi untuk keluar dari screen, lalu Enter


Code:

                         Save DDS - Create Display File

Type choices, press Enter.

Save DDS source . . . . . . . . . . . . Y Y=Yes
Source file . . . . . . . . . . . . . QDDSSRC F4 for list
Library . . . . . . . . . . . . . . BELAJAR1 Name, *LIBL ...
Member . . . . . . . . . . . . . . . . HELLOWF F4 for list
Text . . . . . . . . . . . . . . . . . hello world dspf

Create display file . . . . . . . . . . Y Y=Yes
Prompt for parameters . . . . . . . . Y=Yes
Display file . . . . . . . . . . . . . HELLOWF F4 for list
Library . . . . . . . . . . . . . . BELAJAR1 Name, *CURLIB
Replace existing file . . . . . . . . Y=Yes

Submit create job in batch . . . . . . . Y Y=Yes

Specify additional
save or create options . . . . . . . . Y=Yes

F3=Exit F4=Prompt F12=Cancel
Member HELLOWF already exists. Press Enter to replace.



Code:

 Type reply (if required), press Enter.
Job 418729/BELAJAR/HELLOWF completed normally on 04/13/10 at 16:07:18.


‘Completed normally’ berarti Pembuatan DSPF kita berhasil
Tekan Enter untuk kembali ke halaman awal

Demikian lah cara membuat Display File,

Kita akan membuat RPGLE untuk Hello world
Ganti header File dengan QRPGLESRC


Code:

                           Work with Members Using PDM                 PUB1

File . . . . . . QRPGLESRC
Library . . . . BELAJAR1 Position to . . . . .

Type options, press Enter.
2=Edit 3=Copy 4=Delete 5=Display 6=Print 7=Rename
8=Display description 9=Save 13=Change text 14=Compile 15=Create module.

Opt Member Type Text

(No members in file)

Parameters or command
===>
F3=Exit F4=Prompt F5=Refresh F6=Create
F9=Retrieve F10=Command entry F23=More options F24=More keys
(C) COPYRIGHT IBM CORP. 1981, 2003.


Tekan F6


Code:

                       Start Source Entry Utility (STRSEU)

Type choices, press Enter.

Source file . . . . . . . . . . SRCFILE > QRPGLESRC
Library . . . . . . . . . . . > BELAJAR1
Source member . . . . . . . . . SRCMBR hellow
Source type . . . . . . . . . . TYPE rpgle
Text 'description' . . . . . . . TEXT hello world

Bottom
F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display
F24=More keys



Code:

Columns . . . :    6  76            Edit                    BELAJAR1/QRPGLESRC
SEU==> HELLOW
FMT H HKeywords++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*************** Beginning of data *************************************
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
'''''''
****************** End of data ****************************************

F3=Exit F4=Prompt F5=Refresh F9=Retrieve F10=Cursor F11=Toggle
F16=Repeat find F17=Repeat change F24=More keys
Member HELLOW added to file BELAJAR1/QRPGLESRC. +


Tekan Enter


Code:

Columns . . . :    6  76            Edit                    BELAJAR1/QRPGLESRC
SEU==> HELLOW
FMT H HKeywords++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*************** Beginning of data *************************************
****************** End of data ****************************************


Ketikkan IPF (insert new line), di sisi kiri


Code:

Columns . . . :    6  76            Edit                    BELAJAR1/QRPGLESRC
SEU==> HELLOW
FMT H HKeywords++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
IPF *************** Beginning of data *************************************
****************** End of data ****************************************


Akan muncul half window, inputkan seperti di bawah


Code:

Columns . . . :    6  76            Edit                    BELAJAR1/QRPGLESRC
SEU==> HELLOW
FMT H HKeywords++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*************** Beginning of data *************************************
'''''''
****************** End of data ****************************************
Prompt type . . . F Sequence number . . . '''''''

File File End of File
Filename Type Designation File Addition Sequence
hellowf c f
File Record Limits Length of Record
Format Length Processing Key Field Address Type
e
File
Organization Device Keywords
workstn
Comment

F3=Exit F4=Prompt F5=Refresh F11=Previous record
F12=Cancel F23=Select prompt F24=More keys



Code:

Columns . . . :    6  76            Edit                    BELAJAR1/QRPGLESRC
SEU==> HELLOW
FMT F FFilename++IPEASFRlen+LKlen+AIDevice+.Keywords+++++++++++++++++++++++++
*************** Beginning of data *************************************
0001.00 Fhellowf cf e workstn
****************** End of data ****************************************


Ketikkan I, lalu ketik spasi (Hanya untuk memberi space)
Ketikkan IPCX di sebelah kiri


Code:

Columns . . . :    6  76            Edit                    BELAJAR1/QRPGLESRC
SEU==> HELLOW
FMT F FFilename++IPEASFRlen+LKlen+AIDevice+.Keywords+++++++++++++++++++++++++
*************** Beginning of data *************************************
0001.00 Fhellowf cf e workstn
0002.00
0003.00 C
'''''''
****************** End of data ****************************************

Prompt type . . . CX Sequence number . . . '''''''

Level N01 Factor 1 Operation
Eval
Extended
Factor 2 Comment
TEXT1 = ‘Hello World’

F3=Exit F4=Prompt F5=Refresh F11=Previous record
F12=Cancel F23=Select prompt F24=More keys



Code:

Columns . . . :    6  76            Edit                    BELAJAR1/QRPGLESRC
SEU==> HELLOW
FMT F FFilename++IPEASFRlen+LKlen+AIDevice+.Keywords+++++++++++++++++++++++++
*************** Beginning of data *************************************
0001.00 Fhellowf cf e workstn
0002.00
''''''' C
****************** End of data ****************************************

Prompt type . . . CX Sequence number . . . '''''''

Level N01 Factor 1 Operation
EXFMT
Extended
Factor 2 Comment
#DISP1

F3=Exit F4=Prompt F5=Refresh F11=Previous record
F12=Cancel F23=Select prompt F24=More keys
Factor 2 operand is not specified for this operation.



Code:

Columns . . . :    6  76            Edit                    BELAJAR1/QRPGLESRC
SEU==> HELLOW
FMT F FFilename++IPEASFRlen+LKlen+AIDevice+.Keywords+++++++++++++++++++++++++
*************** Beginning of data *************************************
0001.00 Fhellowf cf e workstn
0002.00
0003.00 C EXFMT #DISP1
****************** End of data ****************************************



Code:

Columns . . . :    6  76            Edit                    BELAJAR1/QRPGLESRC
SEU==> HELLOW
FMT F FFilename++IPEASFRlen+LKlen+AIDevice+.Keywords+++++++++++++++++++++++++
*************** Beginning of data *************************************
0001.00 Fhellowf cf e workstn
0002.00
0003.00 C EXFMT #DISP1
'''''''
****************** End of data ****************************************

Prompt type . . . CX Sequence number . . . '''''''

Level N01 Factor 1 Operation
Eval
Extended
Factor 2 Comment
*InLR = *On

F3=Exit F4=Prompt F5=Refresh F11=Previous record
F12=Cancel F23=Select prompt F24=More keys



Code:

Columns . . . :    6  76            Edit                    BELAJAR1/QRPGLESRC
SEU==> HELLOW
FMT F FFilename++IPEASFRlen+LKlen+AIDevice+.Keywords+++++++++++++++++++++++++
*************** Beginning of data *************************************
0001.00 Fhellowf cf e workstn
0002.00
0002.01 C Eval TEXT1 = 'Hello World'
0003.00 C EXFMT #DISP1
0004.00 C Eval *InLR = *On
****************** End of data ****************************************



Code:

                                     Exit

Type choices, press Enter.

Change/create member . . . . . . . Y Y=Yes, N=No
Member . . . . . . . . . . . . . HELLOW Name, F4 for list
File . . . . . . . . . . . . . . QRPGLESRC Name, F4 for list
Library . . . . . . . . . . . . BELAJAR1 Name
Text . . . . . . . . . . . . . . hello world

Resequence member . . . . . . . . Y Y=Yes, N=No
Start . . . . . . . . . . . . . 0001.00 0000.01-9999.99
Increment . . . . . . . . . . . 01.00 00.01-99.99

Print member . . . . . . . . . . . N Y=Yes, N=No

Return to editing . . . . . . . . . N Y=Yes, N=No

Go to member list . . . . . . . . . N Y=Yes, N=No

F3=Exit F4=Prompt F5=Refresh F12=Cancel
Have you tried the modern alternative to SEU? Press F1 for more details.

Compile RPGLE


Code:

                           Work with Members Using PDM                 PUB1

File . . . . . . QRPGLESRC
Library . . . . BELAJAR1 Position to . . . . .

Type options, press Enter.
2=Edit 3=Copy 4=Delete 5=Display 6=Print 7=Rename
8=Display description 9=Save 13=Change text 14=Compile 15=Create module..

Opt Member Type Text
14 HELLOW RPGLE hello world

Bottom
Parameters or command
===>
F3=Exit F4=Prompt F5=Refresh F6=Create
F9=Retrieve F10=Command entry F23=More options F24=More keys
Member HELLOW added to file BELAJAR1/QRPGLESRC. +


Tekan F4


Code:

                      Create Bound RPG Program (CRTBNDRPG)

Type choices, press Enter.

Program . . . . . . . . . . . . PGM > HELLOW
Library . . . . . . . . . . . > BELAJAR1
Source file . . . . . . . . . . SRCFILE > QRPGLESRC
Library . . . . . . . . . . . > BELAJAR1
Source member . . . . . . . . . SRCMBR > HELLOW
Source stream file . . . . . . . SRCSTMF

Generation severity level . . . GENLVL 10
Text 'description' . . . . . . . TEXT *SRCMBRTXT

Default activation group . . . . DFTACTGRP *YES

Additional Parameters

Replace program . . . . . . . . REPLACE > *YES

Bottom
F3=Exit F4=Prompt F5=Refresh F10=Additional parameters F12=Cancel



Code:

                               Display Messages
System: PUB1
Queue . . . . . : BELAJAR Program . . . . : *DSPMSG
Library . . . : QUSRSYS Library . . . :
Severity . . . : 00 Delivery . . . : *BREAK

Type reply (if required), press Enter.
Job 418921/BELAJAR/HELLOW completed normally on 04/13/10 at 16:31:58.




Code:

                           Work with Members Using PDM                 PUB1

File . . . . . . QRPGLESRC
Library . . . . BELAJAR1 Position to . . . . .

Type options, press Enter.
2=Edit 3=Copy 4=Delete 5=Display 6=Print 7=Rename
8=Display description 9=Save 13=Change text 14=Compile 15=Create module..

Opt Member Type Text
HELLOW RPGLE hello world

Bottom
Parameters or command
===> call hellow
F3=Exit F4=Prompt F5=Refresh F6=Create
F9=Retrieve F10=Command entry F23=More options F24=More keys



Code:


Hello World



Tekan Enter 1x lagi, untuk keluar.

Hello World telah berhasil dimunculkan
Ayo jangan takut untuk coba.
Pasti bakal dibantu sama temen2 di sini apabila ada error :)
Jangan lupa response nya juga ya apabila telah dicoba :)
Thx U










0 komentar:

Posting Komentar