Chinaunix首页 | 论坛 | 博客
  • 博客访问: 343677
  • 博文数量: 90
  • 博客积分: 847
  • 博客等级: 准尉
  • 技术积分: 1373
  • 用 户 组: 普通用户
  • 注册时间: 2012-08-02 10:54
个人简介

跌打滚爬中的小菜鸟...

文章分类

全部博文(90)

文章存档

2015年(5)

2013年(47)

2012年(38)

我的朋友

分类: 其他UNIX

2013-04-30 09:54:04

CL程序如下:
 FMT **  ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+..
        *************** Beginning of data *********************************
0001.00              PGM                                                  
0002.00              QSH        CMD('DB2 "INSERT INTO FILE02P +           
0003.00                           (PGMNAME)         VALUES(''TEST'')" ')  
0004.00              ENDPGM                                               
        ****************** End of data ************************************
说明:

1. QSH的CMD参数内所有内容都在两个单引号(')之间!!!
2. SQL语句部分需要在两个双引号(")之间.
3. values内用的是单引号, 但为了防止CMD提前结束, 需要连用两个单引号表示一个单引号.
 
 
CALL CL12后的结果如下:
   qsh: 001-0046 Syntax error on line 1: matching delimiter for quoted string no
   t found.                                                                    
   Press ENTER to end terminal session.                                        
   DB20000I  THE SQL COMMAND COMPLETED SUCCESSFULLY.                           
   Press ENTER to end terminal session. 
                                       
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
 ===>                                                                          
                                                                               
 F3=Exit F4=End of File F6=Print F9=Retrieve F17=Top                           
 F18=Bottom  F19=Left   F20=Right F21=User Window                              

这里是call了两次, 第一次CMD内的参数有语法错误, 第二次是正确的.
 
 
 
关于QSH

Start QSH (STRQSH)

Where allowed to run: All environments (*ALL)
Threadsafe: No



The Start QSH (STRQSH) command, as known as QSH, starts the qsh shell interpreter.
If run in an interactive job, STRQSH starts an interactive shell session. If a shell session is not already active in the job, then:
  1. A new shell session is started and a terminal window is displayed.
  2. qsh runs the commands from the file /etc/profile if it exists.
  3. qsh runs the commands from the file .profile in the user's home directory if it exists.
  4. qsh runs the commands from the file specified by the expansion of the ENV variable if it exists.
If a shell session is already active in an interactive job, you are reconnected to the existing session. From the terminal window, you can enter shell commands and view output from the commands.
Using the Terminal Window
The terminal window has two parts:
  • an input line for entering commands, and
  • an output area that contains an echo of the commands you entered and any output generated by the commands.
The terminal window supports the following function keys:
F3 (Exit) Close the terminal window and end the qsh session. F5 (Refresh) Refresh the output area. F6 (Print) Print the output area to a spool file. F7 (Up) Roll output area up one page. F8 (Down) Roll output area down one page. F9 (Retrieve) Retrieve a previous command. You can press this key multiple times to retrieve any previous command. For example, to retrieve the second to last command you entered, press this key two times. You can also select a specific command to be run again by placing the cursor on that command and pressing this key. When the interactive job is running in a double-byte CCSID, this key is not available. F11 (Toggle line wrap) Toggle the line wrap/truncate mode in the output area. In line wrap mode, lines longer than the width of the terminal window are wrapped to the next line. In truncate mode, the portion of a line beyond the width of the terminal window is not shown. F12 (Disconnect) Disconnect from the qsh session. This key only closes the terminal window and does not end the qsh session. You can redisplay the disconnected qsh session by running STRQSH again. F13 (Clear) Clear the output area. F17 (Top) Display top of output area. F18 (Bottom) Display bottom of output area. F19 (Left) Shift output area to the left. F20 (Right) Shift output area to the right. F21 (CL command entry) Display a command entry window where you can enter CL commands. Also, you can use SysReq 2 to interrupt the currently running command.

Error messages for STRQSH

*ESCAPE Messages
QSH0002 Error found with QSH session, reason code &1, errno &2.


Parameters

Keyword Description Choices Notes
Command Character value, *NONE Optional

Command (CMD)

Specifies the shell command to be run.
The possible values are:
*NONE: No command is provided and an interactive session is started. command A shell command to run. The command can be a maximum of 5000 bytes in length. If a blank or other special characters are used, the command must be enclosed in apostrophes ('). If an apostrophe is intended, two apostrophes must be used (''). Note: The case is preserved when lowercase characters are specified.
阅读(2755) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~