Difference between revisions of "Category:Commands"

From MidrangeWiki
Jump to: navigation, search
m
(Verb: +RST, SAV)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
[[Category:Administration]]
 
[[Category:Administration]]
 
[[Category:Basics 101]]
 
[[Category:Basics 101]]
Commands available in [[OS/400]] both come with the 400 and can be added by programmers. Commands can also be placed inside of [[CLP]] programs. Also see [[CLP Commands]] and [[CLP Coding Rules]]. Anytime we find ourselves doing the same command day in day out, that is a candidate to nest what we are doing into a [[CLP]] program and place it on some convenient Menu.
+
Commands available in [[OS/400]] both come with the 400 and can be added by programmers. Commands can also be placed inside of [[CLP]] programs. Anytime we find ourselves doing the same command day in day out, that is a candidate to nest what we are doing into a [[CLP]] program and place it on some convenient Menu.
  
 
== Command Prompting ==
 
== Command Prompting ==
Line 16: Line 16:
 
** SFW Software (object)
 
** SFW Software (object)
 
** RSC Resources (modifier)
 
** RSC Resources (modifier)
** This refers to software from IBM that comes with [[OS/400]]
+
** This generally refers to software from IBM that comes with [[OS/400]]; it can refer to 3rd-party software that was created and installed using the Software Product APIs or System Manager.
  
 
If you know part of the name of some command, you can use GO CMDxxx to get a menu of all commands which include xxx as part of the name.
 
If you know part of the name of some command, you can use GO CMDxxx to get a menu of all commands which include xxx as part of the name.
Line 36: Line 36:
 
* HLD Hold
 
* HLD Hold
 
* RLS Release from Hold
 
* RLS Release from Hold
 +
* RST Restore from external media
 +
* SAV Save to external media (tape, optical, save file)
 
* STR Start
 
* STR Start
 
* WRK Work with
 
* WRK Work with
Line 47: Line 49:
  
 
* DTAARA Data Area
 
* DTAARA Data Area
* F Files (see [[DB2]] for structure info
+
* F Files (see [[DB2]] for structure info)
 
** PF [[Physical Files]]
 
** PF [[Physical Files]]
 
** LF [[Logical Files]]
 
** LF [[Logical Files]]
 +
** SAVF [[Save Files]]
 
** DSPF [[Display Files]]
 
** DSPF [[Display Files]]
 +
** PRTF [[Printer Files]]
 +
** SPLF [[Spooled file]]
 
* JOBQ
 
* JOBQ
 
* LIB Library
 
* LIB Library
Line 58: Line 63:
 
** RPGPGM for [[RPG]]
 
** RPGPGM for [[RPG]]
 
** CBLPGM for [[COBOL]]
 
** CBLPGM for [[COBOL]]
* SPLF [[Spool file]]
 
 
* MSGF [[Message Files]]
 
* MSGF [[Message Files]]
 
* STS Status
 
* STS Status
Line 68: Line 72:
 
Some of the Object examples above are actually two parts
 
Some of the Object examples above are actually two parts
 
* DSPMSG* shows that we have many commands with that prefix
 
* DSPMSG* shows that we have many commands with that prefix
** [[DSPMSGF]] vs. Message Files (error messages and informational messages
+
** DSPMSGF vs. Message Files (error messages and informational messages
** [[DSPMSGQ]] vs. Message Queus
+
** DSPMSGQ vs. Message Queus
* [[DSPSYSSTS]] is an extreme summary of WRKSYSSTS data,  
+
* DSPSYSSTS is a non-input-capable version of WRKSYSSTS data,  
 
** where SYS (System) is the object and STS (Status)is the modifier
 
** where SYS (System) is the object and STS (Status)is the modifier
 
** we also find STS in DSKSTS (Disk Status) and CFGSTS (Configuration Status)
 
** we also find STS in DSKSTS (Disk Status) and CFGSTS (Configuration Status)
  
 
== Command Syntax ==
 
== Command Syntax ==
 +
Commands can be supplied by IBM as part of OS/400 and i5/OS or additional [[licensed program products]] (LPPs), by 3rd-party software suppliers or by in-house programmers. The syntax of commands is the same regardless of their source.
 +
 +
Learning command language (CL) command syntax gives the ability to understand how to use any command from any source. It also provides a solid foundation for creating your own commands.
  
 
== File Commands ==
 
== File Commands ==
Line 82: Line 89:
 
* [[WRKOBJ]] Work with Objects
 
* [[WRKOBJ]] Work with Objects
 
** Use this with part of file or other object name, and wild card v.s. library list or *ALL libraries, to see where the file exists
 
** Use this with part of file or other object name, and wild card v.s. library list or *ALL libraries, to see where the file exists
* [[RUNQRY]] *N File-Name
+
* RUNQRY *N File-Name
 
** F4 with this and explore options like may select records, send output to screen or to report
 
** F4 with this and explore options like may select records, send output to screen or to report
 
** Here we use [[Query]] using the External Definitions to display the contents of the file.
 
** Here we use [[Query]] using the External Definitions to display the contents of the file.
Line 88: Line 95:
 
** See [[Query]] for more navigation tips.
 
** See [[Query]] for more navigation tips.
 
* [[DSPPFM]] then file name and member name
 
* [[DSPPFM]] then file name and member name
** Like [[RUNQRY]] *N File-Name, this is a dump of the contents of the file.
+
** Like RUNQRY *N File-Name, this is a dump of the contents of the file.
** Unlike [[RUNQRY]] *N File-Name, this is a way to decipher the innards of packed fields.
+
** Unlike RUNQRY *N File-Name, this is a way to decipher the innards of packed fields.
 
** If you do not specify member, it defaults to MBR(*FIRST) which is the first member created for this file, as opposed to *LAST the most recent, or use a specific member name.
 
** If you do not specify member, it defaults to MBR(*FIRST) which is the first member created for this file, as opposed to *LAST the most recent, or use a specific member name.
 
* [[DSPLIB]]
 
* [[DSPLIB]]
Line 96: Line 103:
 
** Use this to check on statistics about the file - # records, # members and their names, # accesses of various kinds, amount of disk space, room for file growth, and so forth ... put "B" for Bottom on the control line if you want to go straight to the bottom line info
 
** Use this to check on statistics about the file - # records, # members and their names, # accesses of various kinds, amount of disk space, room for file growth, and so forth ... put "B" for Bottom on the control line if you want to go straight to the bottom line info
 
*** Suppose the file is about to fill up ... use [[CHGPF]] to change definition to accommodate more growth.
 
*** Suppose the file is about to fill up ... use [[CHGPF]] to change definition to accommodate more growth.
*** Suppose we are out of members but need more.  Use [[CHGPF]] to increase MAXMBRS then [[ADDPFM]] to name the new member.
+
*** Suppose we are out of members but need more.  Use CHGPF to increase MAXMBRS then ADDPFM to name the new member.
 
*** After adding physical file member, we need to check on logical file member(s).
 
*** After adding physical file member, we need to check on logical file member(s).
 
* [[DSPFFD]] then file name
 
* [[DSPFFD]] then file name
Line 103: Line 110:
 
** Use this to identify all logicals that point at this physical file.
 
** Use this to identify all logicals that point at this physical file.
 
* [[GO]] CMDF to check on other commands that have something to do with files
 
* [[GO]] CMDF to check on other commands that have something to do with files
** [[GO]] CMDPF physical files
+
** GO CMDPF physical files
** [[GO]] CMDLF logical files such as [[CHGLFM]] = change logical file member
+
** GO CMDLF logical files such as CHGLFM = change logical file member
*** [[GO]] CMDPFM physical file members commands
+
*** GO CMDPFM physical file members commands
**** [[RGZPFM]] can reorganize a physical file member to purge out deleted records, and use logical view to re-order phusically in sequence of that logical
+
**** RGZPFM can reorganize a physical file member to purge out deleted records, and use logical view to re-order phusically in sequence of that logical
 
* GO CMDM to check on commands to do things with members
 
* GO CMDM to check on commands to do things with members

Latest revision as of 21:35, 17 June 2015

Commands available in OS/400 both come with the 400 and can be added by programmers. Commands can also be placed inside of CLP programs. Anytime we find ourselves doing the same command day in day out, that is a candidate to nest what we are doing into a CLP program and place it on some convenient Menu.

Command Prompting

When keying in a command, instead of pressing the ENTER key, we can do F4. This displays a screen showing the various parameters available ... we can put cursor on one of them and F4 to see list of what can be keyed there, or F1 for help about those options.

This works for commands on Command Line and also for commands within a program. Also see CLP Coding Rules.

Command Structure

IBM supplies over 1,500 commands native to OS/400 that are composed of 3 letter abbreviations (usually 3 letters) of a compound combination of Verb-Object-Modifier as shown by examples below.

  • DSPSFWRSC for example
    • DSP Display (verb)
    • SFW Software (object)
    • RSC Resources (modifier)
    • This generally refers to software from IBM that comes with OS/400; it can refer to 3rd-party software that was created and installed using the Software Product APIs or System Manager.

If you know part of the name of some command, you can use GO CMDxxx to get a menu of all commands which include xxx as part of the name.

  • GO CMDSCDE for Scheduler

Verb

This is not a complete list.

If you know part of a command name, but forget the whole thing, key first few letters then * asterisk wild card to get list of all commands with that prefix.

  • ADD to an object's contents
  • CHG Change
  • CLR Clear the contents of an object
  • CRT Create an object
  • DLT Delete an object
  • DSP Display
  • END
  • HLD Hold
  • RLS Release from Hold
  • RST Restore from external media
  • SAV Save to external media (tape, optical, save file)
  • STR Start
  • WRK Work with
    • Most WRK includes access to many other commands vs. same kind of objecrt, such as ADD CHG DEL

Object

After the verb comes what object type we going to do that verb to.

This is not a complete list.

Modifier

Some of the Object examples above are actually two parts

  • DSPMSG* shows that we have many commands with that prefix
    • DSPMSGF vs. Message Files (error messages and informational messages
    • DSPMSGQ vs. Message Queus
  • DSPSYSSTS is a non-input-capable version of WRKSYSSTS data,
    • where SYS (System) is the object and STS (Status)is the modifier
    • we also find STS in DSKSTS (Disk Status) and CFGSTS (Configuration Status)

Command Syntax

Commands can be supplied by IBM as part of OS/400 and i5/OS or additional licensed program products (LPPs), by 3rd-party software suppliers or by in-house programmers. The syntax of commands is the same regardless of their source.

Learning command language (CL) command syntax gives the ability to understand how to use any command from any source. It also provides a solid foundation for creating your own commands.

File Commands

Useful commands for navigating the layout of files, and the contents of files.

  • WRKOBJ Work with Objects
    • Use this with part of file or other object name, and wild card v.s. library list or *ALL libraries, to see where the file exists
  • RUNQRY *N File-Name
    • F4 with this and explore options like may select records, send output to screen or to report
    • Here we use Query using the External Definitions to display the contents of the file.
    • With the selection or records *YES we can explore some criteria then F12 back to the selection screen to alter our selection criteria.
    • See Query for more navigation tips.
  • DSPPFM then file name and member name
    • Like RUNQRY *N File-Name, this is a dump of the contents of the file.
    • Unlike RUNQRY *N File-Name, this is a way to decipher the innards of packed fields.
    • If you do not specify member, it defaults to MBR(*FIRST) which is the first member created for this file, as opposed to *LAST the most recent, or use a specific member name.
  • DSPLIB
    • Use this to check on the existence of library contents
  • DSPFD then file name - physical or logical
    • Use this to check on statistics about the file - # records, # members and their names, # accesses of various kinds, amount of disk space, room for file growth, and so forth ... put "B" for Bottom on the control line if you want to go straight to the bottom line info
      • Suppose the file is about to fill up ... use CHGPF to change definition to accommodate more growth.
      • Suppose we are out of members but need more. Use CHGPF to increase MAXMBRS then ADDPFM to name the new member.
      • After adding physical file member, we need to check on logical file member(s).
  • DSPFFD then file name
    • Use this to check on file layout
  • DSPDBR then physical file name
    • Use this to identify all logicals that point at this physical file.
  • GO CMDF to check on other commands that have something to do with files
    • GO CMDPF physical files
    • GO CMDLF logical files such as CHGLFM = change logical file member
      • GO CMDPFM physical file members commands
        • RGZPFM can reorganize a physical file member to purge out deleted records, and use logical view to re-order phusically in sequence of that logical
  • GO CMDM to check on commands to do things with members