TechTalk: Get to the C: Prompt

Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

Get to the C: Prompt

The PC Support/400 Organizer menu (PCOMNU) contains an option to display the PC command prompt (option 6). When you select this option, your PC displays the C: prompt. Since I don't know that much about DOS, I used to wonder how this was done, until I stumbled across COMMAND, a DOS command. When you run COMMAND, it "shells" out to DOS (starts another copy of DOS).

This means that option 6 of PCOMNU is truly executing the AS/400 Start PC Command (STRPCCMD) command, specifying PCCMD(COMMAND). You can take advantage of this to access the DOS command line without going through the PCOMNU. Since I do my work from the Command Entry panel (CALL QCMD), this little trick is of great value to me.

Soon I discovered that I was going to the PC command line fairly often, so I created a little command to simplify the process. It's the Start DOS (STRDOS) command, as seen in 1. The command processing program, DOS010CL, is shown in 2. If you leave the first parameter (CMD) to its default value (*PROMPT), it displays the C: prompt. From the C: prompt, you can execute any DOS command-key "exit" and press Enter to get back to the AS/400. You can submit a DOS command in this parameter within a quoted character string (such as 'copy this.doc a:that.doc') to run it from the AS/400, much like the STRPCCMD command. If you do submit a command, a pause will occur after the command is run. You can eliminate the pause by specifying '*NO' in the second parameter (PAUSE) of the STRDOS command.

Soon I discovered that I was going to the PC command line fairly often, so I created a little command to simplify the process. It's the Start DOS (STRDOS) command, as seen in Figure 1. The command processing program, DOS010CL, is shown in Figure 2. If you leave the first parameter (CMD) to its default value (*PROMPT), it displays the C: prompt. From the C: prompt, you can execute any DOS command-key "exit" and press Enter to get back to the AS/400. You can submit a DOS command in this parameter within a quoted character string (such as 'copy this.doc a:that.doc') to run it from the AS/400, much like the STRPCCMD command. If you do submit a command, a pause will occur after the command is run. You can eliminate the pause by specifying '*NO' in the second parameter (PAUSE) of the STRDOS command.


TechTalk: Get to the C: Prompt

Figure 1 Command STRDOS

 STRDOS: CMD PROMPT('Start DOS Environment') PARM KWD(CMD) TYPE(*CHAR) LEN(127) DFT(*PROMPT) + EXPR(*YES) PROMPT('DOS command') PARM KWD(PAUSE) TYPE(*CHAR) LEN(4) RSTD(*YES) + DFT(*YES) VALUES(*YES *NO) EXPR(*YES) + PMTCTL(PC1) PROMPT('Pause after command') PC1: PMTCTL CTL(CMD) COND((*NE *PROMPT)) 
TechTalk: Get to the C: Prompt

Figure 2 CL Program DOS010CL

 DOS010CL: + PGM PARM(&CMD &PAUSE) DCL VAR(&CMD) TYPE(*CHAR) LEN(127) DCL VAR(&MSGDTA) TYPE(*CHAR) LEN(132) DCL VAR(&MSGF) TYPE(*CHAR) LEN(10) DCL VAR(&MSGFLIB) TYPE(*CHAR) LEN(10) DCL VAR(&MSGID) TYPE(*CHAR) LEN(7) DCL VAR(&PAUSE) TYPE(*CHAR) LEN(4) DCL VAR(&PCCMD) TYPE(*CHAR) LEN(127) IF COND(&CMD *EQ '*PROMPT') THEN(DO) CHGVAR VAR(&PCCMD) VALUE('command') CHGVAR VAR(&PAUSE) VALUE('*NO') ENDDO ELSE CMD(DO) CHGVAR VAR(&PCCMD) VALUE(&CMD) ENDDO STRPCCMD PCCMD(&PCCMD) PAUSE(&PAUSE) MONMSG MSGID(CPF0000) EXEC(DO) RCVMSG MSGTYPE(*EXCP) MSGDTA(&MSGDTA) MSGID(&MSGID) MSGF(&MSGF) + MSGFLIB(&MSGFLIB) SNDPGMMSG MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) MSGDTA(&MSGDTA) + MSGTYPE(*ESCAPE) RETURN ENDDO ENDPGM 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: