当前位置:   article > 正文

hercules z/OS 安装 RPG 编译器_hercules 安装

hercules 安装

RPG 是一种超古老的程序语言,但还有不少大银行主机上仍然有好多 RPG 程序在跑
这种程序语言主要用来生成报表,个人觉得功能超牛b,而且当今还没有其他语言可以做到它的效果

RPG 现在主要可以分2个版本,一个是 RPG IV 以前的,和 RPG IV 以后到现在的版本
RPG IV 主要也是银行在用,但它是在 小型机上运行,不是主机,操作系统是 AIX,语法接近现在

这里安装的是老一代的 RPG,这一代的 RPG 特别之处就是它是按数据行来执行程序的
例如: 银行白天的交易生成了一个档案,每一行代表一笔交易內容,用 Java 写小程序来处理一个,是在代码层面去 Loop record 然后处理

RPG 特別就是它的程序码原生的应用在每一行数据
读一行数据,然后,RPG 的代码都会应用在这一行数据
读下一行数据,也是应用同一串代码
没其他多余的

运行速度超快,某些系统例如信用卡系统每天交易数据可能是几十万,甚至百万条
晚上跑批程序运行的速度是一个好重要的考虑

想学习 RPG,先要弄个 RPG 编译器

现在网上硕果仅存的就是下面这个大神整理的 SYSCPK 卷

http://www.jaymoseley.com/hercules/compilers/syscpk.htm

如果没弄到RPG 编译器,那只有在公司机器加班学习...

主机上的东西都是放在卷 (TAPE 磁带) 里面,接上就可以用,卷的名字一般 6 个字
大神整理的这个叫 SYSCPK,里面包含几十种古老编译器

由于大神用的系统是旧一点 MVS,不能直接按照安装在 z/OS 的

但步骤不难,只要有一点悟性就可以参透大神的意思

首先在大神那下把 SYSCPK 下载回来,卷其实就像现在的压缩档而已

然后在 Hercules 挂上,就像下面的 0A9B 3390 DASD /home/kazuya/zos/SYSCPK

  1. Hercules CPU: 2% z/Arch | Peripherals
  2. 0706000000000000 0000000000000000 | U Addr Modl Type Assignment
  3. PSW 24..W....Z | A 000C 3505 RDR /home/kazuya/zos/zzsacard.bin ebcdic intrq IO[6]
  4. | B 000D 3525 PCH /home/kazuya/zos/punch00d.txt ascii IO[0]
  5. 0 0000000000000000 1 FF00000000000000 | C 000E 1403 PRT /home/kazuya/zos/print00e.txt crlf IO[6]
  6. 2 0000000000000000 3 FF00000000000000 | D 0009 3215 CON *syscons cmdpref(/) noprompt IO[0]
  7. 4 0000000000000000 5 8000000000000000 | E 0700 3270 DSP 192.168.50.16 IO[152]
  8. 6 0000000000000000 7 0000000000000000 | F 0701 3270 DSP 192.168.50.16 IO[963]
  9. 8 FF00000000000000 9 0000000000000000 | G 0702 3270 DSP * IO[5]
  10. A 0000000000000000 B FF00000000000000 | H 0703 3270 DSP * IO[5]
  11. C 8000000000000000 D 0000000000000000 | I 0704 3270 DSP * IO[5]
  12. E 7F00000000000000 F FF00000000000000 | J 0A80 3390 DASD /home/kazuya/zos/ZARES1 [3339 cyls] [0 sfs] IO[53402]
  13. GPR CR AR FPR | K 0A81 3390 DASD /home/kazuya/zos/ZARES2 [3339 cyls] [0 sfs] IO[23896]
  14. | L 0A82 3390 DASD /home/kazuya/zos/SARES1 [3339 cyls] [0 sfs] IO[6]
  15. ADDRESS: 00000000 DATA: 00000000 | M 0A83 3390 DASD /home/kazuya/zos/ZADB81 [3339 cyls] [0 sfs] IO[6]
  16. --------------------------------------| N 0A84 3390 DASD /home/kazuya/zos/ZADB82 [3339 cyls] [0 sfs] IO[6]
  17. 3.797 3 STO DIS RST | O 0A85 3390 DASD /home/kazuya/zos/ZADB83 [3339 cyls] [0 sfs] IO[6]
  18. MIPS IO/s | P 0A86 3390 DASD /home/kazuya/zos/ZADB84 [3339 cyls] [0 sfs] IO[6]
  19. STR STP EXT IPL PWR | Q 0A87 3390 DASD /home/kazuya/zos/ZADB91 [3339 cyls] [0 sfs] IO[4483]
  20. --------------------------------------| R 0A88 3390 DASD /home/kazuya/zos/ZADB92 [3339 cyls] [0 sfs] IO[198]
  21. CP00 | S 0A89 3390 DASD /home/kazuya/zos/ZACIC1 [3339 cyls] [0 sfs] IO[3916]
  22. CP01 | T 0A8A 3390 DASD /home/kazuya/zos/ZADIS1 [3339 cyls] [0 sfs] IO[6]
  23. CP02 | U 0A8B 3390 DASD /home/kazuya/zos/ZADIS2 [3339 cyls] [0 sfs] IO[6]
  24. CP03 | V 0A8C 3390 DASD /home/kazuya/zos/ZADIS3 [3339 cyls] [0 sfs] IO[6]
  25. CP04 | W 0A8D 3390 DASD /home/kazuya/zos/ZADIS4 [3339 cyls] [0 sfs] IO[6]
  26. CP05 | X 0A8E 3390 DASD /home/kazuya/zos/ZADIS5 [3339 cyls] [0 sfs] IO[6]
  27. CP06 | Y 0A8F 3390 DASD /home/kazuya/zos/ZADIS6 [3339 cyls] [0 sfs] IO[6]
  28. CP07 | Z 0A90 3390 DASD /home/kazuya/zos/ZAIMS1 [3339 cyls] [0 sfs] IO[6]
  29. | . 0A91 3390 DASD /home/kazuya/zos/ZAPRD1 [3339 cyls] [0 sfs] IO[71]
  30. | . 0A92 3390 DASD /home/kazuya/zos/ZAPRD2 [3339 cyls] [0 sfs] IO[1777]
  31. | . 0A93 3390 DASD /home/kazuya/zos/ZAPRD3 [3339 cyls] [0 sfs] IO[6]
  32. | . 0A94 3390 DASD /home/kazuya/zos/ZAPRD4 [3339 cyls] [0 sfs] IO[6]
  33. | . 0A95 3390 DASD /home/kazuya/zos/ZASYS1 [3339 cyls] [0 sfs] IO[29870]
  34. | . 0A96 3390 DASD /home/kazuya/zos/ZAUSS1 [3339 cyls] [0 sfs] IO[1541]
  35. | . 0A97 3390 DASD /home/kazuya/zos/ZAWAS1 [3339 cyls] [0 sfs] IO[6]
  36. | . 0A98 3390 DASD /home/kazuya/zos/ZAWAS2 [3339 cyls] [0 sfs] IO[6]
  37. | . 0A99 3390 DASD /home/kazuya/zos/ZAWAS3 [3339 cyls] [0 sfs] IO[6]
  38. | . 0A9A 3390 DASD /home/kazuya/zos/USRG01 [1114 cyls] IO[91]
  39. | . 0A9B 3390 DASD /home/kazuya/zos/SYSCPK [1114 cyls] [0 sfs] IO[1095]
  40. | . 0A9C 3390 DASD /home/kazuya/zos/UAPP01 [1114 cyls] IO[71]
  41. | . 0A9D 3390 DASD /home/kazuya/zos/UTMP01 [1114 cyls] IO[89]
  42. | . 0E20 3088 CTCA CTCI 192.168.200.1/192.168.200.2 (tun0) IO[14]
  43. | . 0E21 3088 CTCA CTCI 192.168.200.1/192.168.200.2 (tun0) IO[7]
  44. |
  45. |

挂上后会在 VOLUME SYSCPK 盘里面,基本就可以访问了

  1. . Menu Options View Utilities Compilers Help .
  2. . ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss .
  3. . DSLIST - Data Sets on volume SYSCPK Row 11 of 64 .
  4. . Command ===> Scroll ===> CSR .
  5. . .
  6. . Command - Enter "/" to select action Message Volume .
  7. . ------------------------------------------------------------------------------- .
  8. . SYSC.A68CLIB.MOD SYSCPK .
  9. . SYSC.A68CLIB.SYS SYSCPK .
  10. . SYSC.COBLIB SYSCPK .
  11. . SYSC.DISASM.ASM SYSCPK .
  12. . SYSC.DYNALLOC.SOURCE SYSCPK .
  13. . SYSC.DYNALOAD.SOURCE SYSCPK .
  14. . SYSC.FORMAT.SOURCE SYSCPK .
  15. . SYSC.FORTLIB SYSCPK .
  16. . SYSC.IFOX.CNTL SYSCPK .
  17. . SYSC.IFOX.MACLIB SYSCPK .
  18. . SYSC.IFOX.SOURCE SYSCPK .
  19. . SYSC.JOBCARD.SOURCE SYSCPK .
  20. . SYSC.LINKLIB SYSCPK .
  21. . SYSC.MACLIB SYSCPK .
  22. . SYSC.MORTRAN.SOURCE SYSCPK .
  23. . SYSC.MVTSORT.CNTL SYSCPK .
  24. . SYSC.MVTSORT.MACLIB SYSCPK .
  25. . SYSC.MVTSORT.SOURCE SYSCPK .
  26. . SYSC.PASCAL.CNTL SYSCPK .
  27. . SYSC.PASCAL.PASLIB SYSCPK .
  28. . SYSC.PASCAL.PASMSGS SYSCPK .
  29. . SYSC.PASCAL.PASOBJ1 SYSCPK .
  30. . SYSC.PASCAL.PASOBJ2 SYSCPK .
  31. . SYSC.PLILIB SYSCPK .
  32. . SYSC.PL360.SOURCE SYSCPK .
  33. . SYSC.PROCLIB SYSCPK .
  34. . SYSC.SETUP.CNTL SYSCPK .
  35. . SYSC.SORTLIB SYSCPK .
  36. . SYSC.SP.MACLIB SYSCPK .
  37. . SYSC.SPASM.MACLIB SYSCPK .
  38. . SYSC.SPASM.SOURCE SYSCPK .
  39. . SYSC.SPITBOL.SOURCE SYSCPK .
  40. . SYSC.STANFORD.PASCAL.LIB SYSCPK .
  41. . SYSC.STONYBRK.PASCAL.OBJECT SYSCPK .
  42. . SYSC.STONYBRK.PASCAL.SOURCE SYSCPK .
  43. . SYSC.VSAMIO.SOURCE SYSCPK .
  44. . SYSC.VSAMIOP.MACLIB SYSCPK .
  45. . SYSC.VSAMIOP.SOURCE SYSCPK .
  46. . SYSC.WATFIV.CNTL SYSCPK .
  47. . SYSC.WATFIV.FUNLIB SYSCPK .
  48. . SYSC.WATFIV.MACLIB SYSCPK .
  49. . SYSC.WATFIV.SOURCE SYSCPK .
  50. . SYSC.WATFIV.TESTS SYSCPK .
  51. . SYSC.WATFIV.WATLIB SYSCPK .
  52. . SYSC.XPL.LOADLIB SYSCPK .
  53. . SYSC.XPL.OBJECT SYSCPK .
  54. . SYSC.XPL.SOURCE SYSCPK .
  55. . SYSC.Y2K.SOURCE SYSCPK .
  56. . SYSD.PL1LIB SYSCPK .
  57. . SYS1.COBLIB SYSCPK .
  58. . SYS1.VVDS.VSYSCPK SYSCPK .
  59. . UCAT.SYSCPK SYSCPK .
  60. . UCAT.SYSCPK.CATINDEX SYSCPK .
  61. . Z9999994.VSAMDSPC.TCDD7D03.T4090F30 SYSCPK .
  62. . ***************************** End of Data Set list **************************** .

如果要 RPG 编译器,只需要 SYSC.PROCLIB 和 SYSC.LINKLIB 就可以

平常在 Windows/Linux 编译 C 程序,也要配置 /usr/bin /usr/lib 这些,SYSC.PROCLIB SYSC.LINKLIB 也相类似

在主机里,有一个叫 CATALOG.Z110.MASTER 东西,就像索引
如果在 CATALOG 里定义了,系统就可以找到相关东西,像找到 /usr/bin 里面东西一样
主机索引支持多层索引,上面是系统主索引

先为这个 SYSCPK 建立一个用户级索引 UCAT.SYSCPK,指到主索引 CATALOG.Z110.MASTER

  1. //JC$CRTCC JOB ,'CREATE USERCAT',NOTIFY=&SYSUID
  2. //*
  3. //STEP0001 EXEC PGM=IDCAMS
  4. //SYSPRINT DD SYSOUT=*
  5. //SYSIN DD *
  6. DELETE UCAT.SYSCPK USERCATALOG
  7. SET MAXCC=0
  8. DEFINE USERCATALOG(NAME(UCAT.SYSCPK) -
  9. VOLUMES(SYSCPK) -
  10. CYLINDERS(2 1)) -
  11. CATALOG(CATALOG.Z110.MASTER)
  12. /*
  13. //*

再定义个分身 Alias SYSC 指到 UCAT.SYSCPK

  1. //JC$CRTCA JOB ,'CREATE ALIAS',NOTIFY=&SYSUID
  2. //*
  3. //STEP0001 EXEC PGM=IDCAMS
  4. //SYSPRINT DD SYSOUT=*
  5. //SYSIN DD *
  6. DEFINE ALIAS (NAME (SYSC) RELATE (UCAT.SYSCPK))
  7. /*
  8. //*

然后把 SYSC.PROCLIB SYSC.LINKLIB 也指到 UCAT.SYSCPK

  1. //JC$CRTCC JOB ,'CREATE CATL',NOTIFY=&SYSUID
  2. //*
  3. //S1 EXEC PGM=IDCAMS
  4. //SYSPRINT DD SYSOUT=*
  5. //SYSIN DD *
  6. DEFINE NONVSAM(NAME(SYSC.PROCLIB)-
  7. VOL(SYSCPK) DEVT(3390))-
  8. CATALOG(UCAT.SYSCPK)
  9. DEFINE NONVSAM(NAME(SYSC.LINKLIB)-
  10. VOL(SYSCPK) DEVT(3390))-
  11. CATALOG(UCAT.SYSCPK)
  12. /*
  13. //*

这样编译程序时就可以找到编译器了

然后,就可以尝试编译大神提供的范例 RPG 程序

  1. //RPG00001 JOB ,'RPG00001',CLASS=A,MSGLEVEL=(1,1),REGION=512K,
  2. // NOTIFY=&SYSUID
  3. //PROCLIB JCLLIB ORDER=SYSC.PROCLIB
  4. //* COMPILE LINK AND RUN RPG
  5. //RPGCLG EXEC RPGECLG,COND.LKED=(9,LT,RPG)
  6. //RPG.SYSUT3 DD UNIT=SYSDA
  7. //RPG.SYSUT2 DD UNIT=SYSDA
  8. //RPG.SYSUT1 DD UNIT=SYSDA
  9. //RPG.SYSGO DD UNIT=SYSDA
  10. //RPG.SYSIN DD *
  11. H
  12. H*
  13. H* READ ADDRESS CARDS AND PRINT ADDRESS LIST
  14. H*
  15. FINCARDS IPE F 80 80 READ40
  16. FOUTLIST O F 132 132 OF LPRINTER
  17. LOUTLIST 0010106012
  18. IINCARDS AA 01
  19. I 1 25 NAME
  20. I 26 50 ADDR1
  21. I 51 75 ADDR2
  22. OOUTLIST H 201 1P
  23. O OR OF
  24. O PAGE Z 40
  25. O 36 'PAGE'
  26. O 23 'ADDRESS LIST'
  27. O UDATE 8 ' 0/ / '
  28. O D 1 01
  29. O NAME 30
  30. O D 1 01
  31. O ADDR1 30
  32. O D 2 01
  33. O ADDR2 30
  34. O T 3 01 LR
  35. O 24 '*** END OF LIST ***'
  36. /*
  37. //GO.SYSUDUMP DD SYSOUT=A
  38. //GO.INCARDS DD *
  39. MICHELLE COOK 9561 BAYVIEW STREET BALDWIN, MO 63022
  40. PATTY JENNINGS 806 JACKSON STREET VALPARAISO, IN 46383
  41. RICHARD SMITH 279 PARKER BLVD NASHAU, NH 03060
  42. DUNCAN POWERS 9496 BAYVIEW STREET BUFFALO, NY 14225
  43. WILLIAM EUBANKS 736 FETLOCK AVENUE FALLS VILLAGE, CT 06031
  44. SHIRLEY GARLAND 827 SHORE AVENUE GREENVILLE, SC 29616
  45. JOAN FRANKLIN 4550 BIENVILLE CIRCLE KANSAS CITY, MO 64118
  46. ANDREW BLUME 2942 BAYVIEW AVENUE ROCHESTER, NY 03840
  47. ELIZABETH BOWERS 1023 SOUTHLAND STREET RIVERSIDE, NJ 08370
  48. DIANE HAMMOND 3732 BENSON CIRCLE FORT COLLINS, CO 80524
  49. LUCY ROSS 208 ALLEN PLACE EVERETT, WA 98204
  50. LISA ELISON 488 WESTRIDGE STREET SPARKS, NV 89431
  51. MATTHEW RIGHT 6267 BRIARGLEN PLACE CLEVELAND, OH 44104
  52. ZELDA BARBER 442 COLISEUM STREET ALBANY, NY 12206
  53. BRIAN HARMON 872 GRANT BLVD WICHITA, KS 67208
  54. NATHAN MCKAY 1184 JUNIPER CIRCLE HOUSTON, TX 77053
  55. LUCY JACOBY 144 MEADOW PLACE SPARKS, NV 89431
  56. SCOTT PARRISH 9387 A & M CIRCLE DES PLAINES, IL 60018
  57. CALVIN MULL 5924 TWILIGHT COURT SPARKS, NV 89431
  58. CYBIL NOELKE 6782 BRIDGE CIRCLE LAGO VISTA, TX 78645
  59. RUTH VANACKER 6021 BAYSHORE CIRCLE NEWPORT BEACH, CA 92663
  60. JARED BROCKTON 761 GARRETT AVENUE GREENVILLE, SC 29616
  61. MATTHEW JACKSON 4691 SHERWOOD STREET LA JOLLA, CA 92037
  62. CALVIN POWERS 867 ALLEN STREET SPRING, TX 77373
  63. SUE SMITH 9848 PLUM STREET PALM DESERT, CA 92211
  64. ARNOLD WEAVER 701 TWILIGHT ROAD KNOXVILLE, TN 37932
  65. KEVIN NORTON 5343 PARSON AVENUE JUNEAU, AK 99801
  66. SCOTT RENFRO 5418 ATOLL ROAD PASADENA, CA 91186
  67. ERNIE LABROIE 2913 BRANDYWINE CIRCL SAN ANGELO, TX 76903
  68. SHARON JACKSON 2934 ROSA LINDA AVENU NEW YORK, NY 10001
  69. PETER ALEXANDER 7444 ROBINHOOD ROAD NEW YORK, NY 10001
  70. SHARON EUBANKS 9619 JUNIPER ROAD SIOUX FALLS, SD 57112
  71. SHIRLEY ERICKSON 596 COLLEGE STREET GRAND RAPIDS, MN 55745
  72. ANN STUART 9581 DESERT STREET OKLAHOMA CITY, OK 73120
  73. SUE FONTAINE 2229 WESTRIDGE STREET SAN ANTONIO, TX 78216
  74. KEVIN COOK 3055 ROSA LINDA STREE DES PLAINES, IL 60018
  75. DIANE EUBANKS 4404 SOUTHLAND BLVD PRESCOTT, AZ 86314
  76. BOB JEFFERSON 542 KINGS RIDGE BLVD NEWPORT, RI 02840
  77. CRAIG LANDERS 6276 ELLIS STREET ANN ARBOR, MI 48107
  78. NELSON HORTON 3066 SHERWOOD ROAD NORWALK, CT 06854
  79. KEITH ERICKSON 227 BAYSHORE PLACE GREENVILLE, KY 42345
  80. RICHARD GOODWIN 294 RIDGEWAY ROAD OKLAHOMA CITY, OK 73120
  81. DANIEL ROBERTSON 379 ALTAVISTA CIRCLE EVERETT, WA 98204
  82. JOAN AUSTIN 203 EASTHAVEN STREET NEWPORT, RI 02840
  83. JARED MEEHAN 555 EDMUND CIRCLE EVERETT, WA 98204
  84. CRAIG STONE 6791 GUADLAUPE COURT WEST PALM BEACH, FL 33406
  85. JACOB SCHAEFER 8278 LINDENWOOD AVENU JUNEAU, AK 99801
  86. JARED HILLFORD 846 QUAIL AVENUE PHOENIX, AZ 85040
  87. CLIFF PARKER 674 BRANDYWINE AVENUE LAGO VISTA, TX 78645
  88. JOHN SCHAEFER 7210 PARSON COURT LA HABRA, CA 90631
  89. /*
  90. //GO.OUTLIST DD SYSOUT=A
  91. //

编译成功后 Max-CC 0000

  1. Display Filter View Print Options Help
  2. ---------------------------------------------------------------------------------------------------------------------------------------------------------------
  3. SDSF HELD OUTPUT DISPLAY ALL CLASSES LINES 119 LINE 1-1 (1)
  4. COMMAND INPUT ===> SCROLL ===> CSR
  5. PREFIX=** DEST=(ALL) OWNER=** SORT=CrDate/D FILTERS=1 SYSNAME=
  6. NP JOBNAME JobID Owner Max-RC Prty C ODisp Dest Tot-Rec Tot-Page Forms FCB Status UCS Wtr Flash Burst PrMode R
  7. RPG00001 JOB00053 IBMUSER CC 0000 144 K HOLD LOCAL 119 STD **** **** **** NO LINE

也可以找到输出

  1. Display Filter View Print Options Help
  2. ------------------------------------------------------------------------------
  3. SDSF OUTPUT DISPLAY RPG00001 JOB00053 DSID 107 LINE 0 COLUMNS 02- 161
  4. COMMAND INPUT ===> SCROLL ===> CSR
  5. ********************************* TOP OF DATA *********************************
  6. 9/04/21 ADDRESS LIST PAGE 1
  7. MICHELLE COOK
  8. 9561 BAYVIEW STREET
  9. BALDWIN, MO 63022
  10. PATTY JENNINGS
  11. 806 JACKSON STREET
  12. VALPARAISO, IN 46383
  13. RICHARD SMITH
  14. 279 PARKER BLVD
  15. NASHAU, NH 03060
  16. DUNCAN POWERS
  17. 9496 BAYVIEW STREET
  18. BUFFALO, NY 14225
  19. WILLIAM EUBANKS
  20. 736 FETLOCK AVENUE
  21. FALLS VILLAGE, CT 06031
  22. SHIRLEY GARLAND
  23. 827 SHORE AVENUE
  24. GREENVILLE, SC 29616
  25. JOAN FRANKLIN
  26. 4550 BIENVILLE CIRCLE
  27. KANSAS CITY, MO 64118
  28. ANDREW BLUME
  29. 2942 BAYVIEW AVENUE
  30. ROCHESTER, NY 03840
  31. ELIZABETH BOWERS
  32. 1023 SOUTHLAND STREET
  33. RIVERSIDE, NJ 08370
  34. DIANE HAMMOND
  35. 3732 BENSON CIRCLE
  36. FORT COLLINS, CO 80524
  37. LUCY ROSS
  38. 208 ALLEN PLACE
  39. EVERETT, WA 98204
  40. LISA ELISON
  41. 488 WESTRIDGE STREET
  42. SPARKS, NV 89431
  43. MATTHEW RIGHT
  44. 6267 BRIARGLEN PLACE
  45. CLEVELAND, OH 44104
  46. ZELDA BARBER
  47. 442 COLISEUM STREET
  48. ALBANY, NY 12206
  49. BRIAN HARMON
  50. 872 GRANT BLVD
  51. WICHITA, KS 67208

如果直接用大神步骤 IMPORT 来安装 SYSCPK 又不成功,可以参考下面指令清除错误加到主索引的东西

  1. DELETE SYSC ALIAS CATALOG(CATALOG.Z110.MASTER)
  2. DELETE UCSYSCPK PURGE USERCATALOG
  3. EXPORT UCSYSCPK DISCONNECT

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/1009777
推荐阅读
相关标签
  

闽ICP备14008679号