免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3354 | 回复: 5

在qshell里运行cobol程序的输出问题 [复制链接]

论坛徽章:
0
发表于 2009-09-02 09:56 |显示全部楼层
5可用积分
我是一个标准的cobol+as400的菜鸟。。最近的一个项目的porting,要把cobol程序移植到400,但是需要在qshell下运行,并得到结果。
问题是,qshell里面运行编译好的程序,就是得不到结果(结果是用display打印到标准输出的)。。而用call方式在job log里可以看到结果,
terminal session 就是闪一下。。。实在不知道怎么回事。。


我试了试最简单的hello world  也是一样。。

大家帮帮忙吧!!

论坛徽章:
0
发表于 2009-09-02 10:10 |显示全部楼层
qshell 是不是STRQSH  进入的那个$

我最近在QSHELL 里玩JAVA  ,  JAVA HELLO 可以运行。

qsh 里是ASCII编码的, AS400自带的COBOL 是STREAM方式存储和编码的。

论坛徽章:
0
发表于 2009-09-02 10:15 |显示全部楼层

回复 #2 digitalchina 的帖子

是的,我很多c程序也是在qsh下运行,是可以的。

论坛徽章:
0
发表于 2009-09-02 10:27 |显示全部楼层
COBOL为什么要在QSH运行? 在os/400不能直接运行吗?

论坛徽章:
0
发表于 2009-09-02 12:40 |显示全部楼层

回复 #4 digitalchina 的帖子

谢谢您,这个是因为porting的这个framework原来是在shell环境里。。。目前很多的工作已经都再qshell里做了。。

论坛徽章:
0
发表于 2009-09-02 17:04 |显示全部楼层
Running Programs within Qshell

Qshell doesn't use the call command to start a program. Instead, you must type the program's name, in IFS style. The following example illustrates how a program can run within Qshell:

/qsys.lib/mylib.lib/myshellpgm.pgm


-------------

Usage for database operation

CL has a major restriction of using Data Manipulation Language (DML) such as Update, insert or selected delete with the DB2/400 database. To achieve this, we use roundabout ways such as RUNSQLSTM, writing new RPG program, etc.

Qshell makes life easier by using the following command:
Syntax: QSH CMD('db2 "<Db2/400 sql statement">)

Example:
QSH CMD('db2 "UPDATE MYLIB.MYFILE SET MYFLD = ''P''" ')
QSH CMD('db2 "INSERT INTO MYLIB.MYTABLE VALUES(''jagannath'', 104.20)"')

Things to note:

Usage for IFS operation

It is always a headache to handle IFS files using RPG programs. We have to write separate RPG programs using C APIs to handle this functionality. But QShell commands ease this process.

Syntax:

To replace the contents of the IFS and write the fresh text
QSH CMD('print It is working > /home/mydir/myfile.txt')

To append to the contents of the IFS file in next line
QSH CMD('print It is working >> /home/mydir/myfile.txt')
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP