SlideShare a Scribd company logo
Writing command macro in
Stratus COBOL
www.srinimf.com
Command macro
A command macro is a text file that contains one or more commands and/or
command macro statements and that has a name ending with the suffix .cm. You
invoke a macro by entering its name. The operating system then sequentially
executes the commands and macro statements in the file
Command line
A command line is a set of one or more command strings, separated by
semicolons. A command string is a command name and any of the command's
arguments you select. If you want to issue a command with the same name as the
command macro, include the .pm suffix in the command name. Otherwise, the
command macro will be called recursively.
Macro line
A macro line can be one of the following:
a command macro statement
a comment line
a parameter declaration.
Comment Line
A comment line is either a line that begins with an ampersand (&) followed by a
space or a line that consists only of an ampersand. The characters that follow the
ampersand on the line, if any, are taken to be the comment. The command
processor ignores all comment lines.
Ex:
& This command macro is named set_cursor.cm.
&
Command macro statement
&echo
Controls whether command lines, input lines, and macro statements are written
to the default output port.
Parameter
The macro can take parameters. A parameter in a command macro is a named
variable that is declared within the parameter declaration section of a command
macro. A parameter receives its initial value from an argument specified in the
command string that calls the macro or from a default value specified within the
macro.
The macro processor stores parameters as character strings. When the value of
a parameter is converted, it is treated as numeric if it can be converted to a
number; otherwise the value is treated as a string.
3 Parameter Types
There are three types of parameters: positional, optional, and switch parameters.
These correspond to the three types of command arguments described earlier in
this section.
A positional parameter is a parameter that the macro processor identifies in a
command line by the position of its value (rather than by a keyword).
An optional parameter is a parameter that the macro processor identifies in a
command line by a keyword that begins with a hyphen and is followed by a value.
You can specify allowed values (which the user can then cycle through in the
display form). You can also specify a default value.
A switch parameter is a parameter that has only two possible values: yes or no.
It is used like a command switch argument.
Parameter Type
date_time
A date/time string
Parameter Declaration
A parameter declaration is a line in a command macro that appears between the
macro statements &begin_parameters and &end_parameters. It must
contain the name of a parameter and it can contain a parameter descriptor
(described later in this section). The form of a parameter declaration follows.
parameter_name [parameter_descriptor]
That portion of a macro from the &begin_parameters statement to the
&end_parameters statement is called the parameter declaration section. The
parameter declaration section must begin on the first line of the macro that is not
a comment line.
Parameter Label
A label is an optional element of a parameter descriptor. Its purpose is to provide
a descriptive term that will be useful to the user of a macro. It has the following
form:
label:
Contd...
The label, if specified, must be the first component of the parameter descriptor. The colon following
label must be the only colon in the descriptor.
Depending on the type of the parameter, the label appears in the display form, the command line form,
both of these, or neither of these. The information provided by label is used differently depending on
the type of the parameter.
For a positional parameter, it labels the parameter's field in the display form. It also provides a label
in the command line form when you give the command macro with the -usage option.
For an optional parameter, it labels the parameter's field in the command line form only.
For a switch parameter, there is no purpose for specifying a label, since it is used in neither the
display form nor the command line form.
Input Line
To supply input to a program in a macro, you must include the following
elements in the macro in the order shown:
the &attach_input macro statement, which allows the program to accept
input directly from the macro file
the command to invoke the program
input to the program (probably including a request such as quit to exit from
the program)
the &detach_input macro statement, which prevents any further program
input from coming from the macro
Command Function
A command function is a self-contained function that you can use as an
argument in a command line. Before executing the rest of the command line in
which a command function appears, the command processor evaluates the
command function and replaces it with a value. The value returned becomes part
of the command line. For example, to display the current time, you could enter
the following command line with the command function (time):
display_line (time)
The output for the preceding example could be 13:10:59, which specifies the
current hour (13, in 24-hour format), minutes (10), and seconds (59).
Library Path
The operating system maintains a set of library paths for each process. Library
paths specify where the operating system searches for external commands,
include files, object files, or message files. The libraries are referred to as the
command, include, object, and message libraries.
Library paths fall into two categories. Default library paths are set for an entire
module. All processes automatically include all default library paths in their
library search paths. These library paths are generally set using the
add_default_library_path command in module_start_up.cm. Typically
these are library paths that all or almost all processes on the system will need
(such as >system>command_library).
References
Command macros in Stratus
Example Command Macros
Thankyou
www.srinimf.com

More Related Content

What's hot

Assembler1
Assembler1Assembler1
Assembler1
jayashri kolekar
 
Compilers
CompilersCompilers
Compilers
jayashri kolekar
 
Lec 04 intro assembly
Lec 04 intro assemblyLec 04 intro assembly
Lec 04 intro assembly
Abdul Khan
 
Spr ch-02
Spr ch-02Spr ch-02
Spr ch-02
Vasim Pathan
 
Sp chap2
Sp chap2Sp chap2
Sp2 4
Sp2 4Sp2 4
Chapter 2
Chapter 2Chapter 2
Chapter 2
man2sandsce17
 
JCL FOR FRESHERS
JCL FOR FRESHERSJCL FOR FRESHERS
JCL FOR FRESHERS
Nirmal Pati
 
First pass of assembler
First pass of assemblerFirst pass of assembler
First pass of assembler
Hemant Chetwani
 
Examinable Question and answer system programming
Examinable Question and answer system programmingExaminable Question and answer system programming
Examinable Question and answer system programming
Makerere university
 
Assemblers
AssemblersAssemblers
Assemblers
Dattatray Gandhmal
 
Track 2 session 4 db2 for z os optimizer- what’s new in db2 11 and exploiti...
Track 2 session 4   db2 for z os optimizer- what’s new in db2 11 and exploiti...Track 2 session 4   db2 for z os optimizer- what’s new in db2 11 and exploiti...
Track 2 session 4 db2 for z os optimizer- what’s new in db2 11 and exploiti...
IBMSystemzEvents
 
Assembler
AssemblerAssembler
Assembler
ImaanRoshan
 
Mainframe refresher-part-1
Mainframe refresher-part-1Mainframe refresher-part-1
Mainframe refresher-part-1
vishwas17
 
Mainframe jcl exec and dd statements part - 3
Mainframe jcl exec and dd statements part - 3Mainframe jcl exec and dd statements part - 3
Mainframe jcl exec and dd statements part - 3
janaki ram
 
Assembler
AssemblerAssembler
Assembler
SheetalAwate2
 
Assembler
AssemblerAssembler
Assembler
Temesgen Molla
 
Design of a two pass assembler
Design of a two pass assemblerDesign of a two pass assembler
Design of a two pass assembler
Dhananjaysinh Jhala
 
C programming
C programmingC programming
C programming
ASHISH KUMAR
 
Advanced procedures in assembly language Full chapter ppt
Advanced procedures in assembly language Full chapter pptAdvanced procedures in assembly language Full chapter ppt
Advanced procedures in assembly language Full chapter ppt
Muhammad Sikandar Mustafa
 

What's hot (20)

Assembler1
Assembler1Assembler1
Assembler1
 
Compilers
CompilersCompilers
Compilers
 
Lec 04 intro assembly
Lec 04 intro assemblyLec 04 intro assembly
Lec 04 intro assembly
 
Spr ch-02
Spr ch-02Spr ch-02
Spr ch-02
 
Sp chap2
Sp chap2Sp chap2
Sp chap2
 
Sp2 4
Sp2 4Sp2 4
Sp2 4
 
Chapter 2
Chapter 2Chapter 2
Chapter 2
 
JCL FOR FRESHERS
JCL FOR FRESHERSJCL FOR FRESHERS
JCL FOR FRESHERS
 
First pass of assembler
First pass of assemblerFirst pass of assembler
First pass of assembler
 
Examinable Question and answer system programming
Examinable Question and answer system programmingExaminable Question and answer system programming
Examinable Question and answer system programming
 
Assemblers
AssemblersAssemblers
Assemblers
 
Track 2 session 4 db2 for z os optimizer- what’s new in db2 11 and exploiti...
Track 2 session 4   db2 for z os optimizer- what’s new in db2 11 and exploiti...Track 2 session 4   db2 for z os optimizer- what’s new in db2 11 and exploiti...
Track 2 session 4 db2 for z os optimizer- what’s new in db2 11 and exploiti...
 
Assembler
AssemblerAssembler
Assembler
 
Mainframe refresher-part-1
Mainframe refresher-part-1Mainframe refresher-part-1
Mainframe refresher-part-1
 
Mainframe jcl exec and dd statements part - 3
Mainframe jcl exec and dd statements part - 3Mainframe jcl exec and dd statements part - 3
Mainframe jcl exec and dd statements part - 3
 
Assembler
AssemblerAssembler
Assembler
 
Assembler
AssemblerAssembler
Assembler
 
Design of a two pass assembler
Design of a two pass assemblerDesign of a two pass assembler
Design of a two pass assembler
 
C programming
C programmingC programming
C programming
 
Advanced procedures in assembly language Full chapter ppt
Advanced procedures in assembly language Full chapter pptAdvanced procedures in assembly language Full chapter ppt
Advanced procedures in assembly language Full chapter ppt
 

Viewers also liked

Rexx
RexxRexx
Rexx Shih
Rexx ShihRexx Shih
Sort presentation
Sort presentationSort presentation
Sort presentation
Ramakrishna Pulikonda
 
Macro teradata
Macro teradataMacro teradata
Macro teradata
Srinimf-Slides
 
PL/SQL Interview Questions
PL/SQL Interview QuestionsPL/SQL Interview Questions
PL/SQL Interview Questions
Srinimf-Slides
 
DB2-SQL Part-2
DB2-SQL Part-2DB2-SQL Part-2
DB2-SQL Part-2
Srinimf-Slides
 
Oracle PLSQL Step By Step Guide
Oracle PLSQL Step By Step GuideOracle PLSQL Step By Step Guide
Oracle PLSQL Step By Step Guide
Srinimf-Slides
 
Assembler
AssemblerAssembler
Assembler
Mohd Arif
 
IMS DC Self Study Complete Tutorial
IMS DC Self Study Complete TutorialIMS DC Self Study Complete Tutorial
IMS DC Self Study Complete Tutorial
Srinimf-Slides
 
100 sql queries
100 sql queries100 sql queries
100 sql queries
Srinimf-Slides
 
Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language Basics
Education Front
 

Viewers also liked (11)

Rexx
RexxRexx
Rexx
 
Rexx Shih
Rexx ShihRexx Shih
Rexx Shih
 
Sort presentation
Sort presentationSort presentation
Sort presentation
 
Macro teradata
Macro teradataMacro teradata
Macro teradata
 
PL/SQL Interview Questions
PL/SQL Interview QuestionsPL/SQL Interview Questions
PL/SQL Interview Questions
 
DB2-SQL Part-2
DB2-SQL Part-2DB2-SQL Part-2
DB2-SQL Part-2
 
Oracle PLSQL Step By Step Guide
Oracle PLSQL Step By Step GuideOracle PLSQL Step By Step Guide
Oracle PLSQL Step By Step Guide
 
Assembler
AssemblerAssembler
Assembler
 
IMS DC Self Study Complete Tutorial
IMS DC Self Study Complete TutorialIMS DC Self Study Complete Tutorial
IMS DC Self Study Complete Tutorial
 
100 sql queries
100 sql queries100 sql queries
100 sql queries
 
Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language Basics
 

Similar to Writing command macro in stratus cobol

Module 5.pdf
Module 5.pdfModule 5.pdf
Module 5.pdf
SE14Darshan
 
Task Perform addition subtraction division and multiplic.pdf
Task Perform addition subtraction division and multiplic.pdfTask Perform addition subtraction division and multiplic.pdf
Task Perform addition subtraction division and multiplic.pdf
acsmadurai
 
C language 3
C language 3C language 3
C language 3
Arafat Bin Reza
 
Class notes(week 5) on command line arguments
Class notes(week 5) on command line argumentsClass notes(week 5) on command line arguments
Class notes(week 5) on command line arguments
Kuntal Bhowmick
 
Class notes(week 5) on command line arguments
Class notes(week 5) on command line argumentsClass notes(week 5) on command line arguments
Class notes(week 5) on command line arguments
Kuntal Bhowmick
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
home
 
Subprogramms
SubprogrammsSubprogramms
Subprogramms
janapriyanaidu
 
Function & procedure
Function & procedureFunction & procedure
Function & procedure
atishupadhyay
 
System software - macro expansion,nested macro calls
System software - macro expansion,nested macro callsSystem software - macro expansion,nested macro calls
System software - macro expansion,nested macro calls
SARASWATHI S
 
Unit 2
Unit 2Unit 2
Unit 2
pm_ghate
 
11i&r12 difference
11i&r12 difference11i&r12 difference
11i&r12 difference
venki_venki
 
Functions and modular programming.pptx
Functions and modular programming.pptxFunctions and modular programming.pptx
Functions and modular programming.pptx
zueZ3
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
home
 
Sas macros part 4.1
Sas macros part 4.1Sas macros part 4.1
Sas macros part 4.1
venkatam
 
Programming style guideline very good
Programming style guideline very goodProgramming style guideline very good
Programming style guideline very good
Dang Hop
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
AMAN ANAND
 
Preprocessors
PreprocessorsPreprocessors
Preprocessors
Koganti Ravikumar
 
Matlab Programming Tips Part 1
Matlab Programming Tips Part 1Matlab Programming Tips Part 1
Matlab Programming Tips Part 1
Shameer Ahmed Koya
 
Cpp functions
Cpp functionsCpp functions
Cpp functions
NabeelaNousheen
 
Vb (1)
Vb (1)Vb (1)

Similar to Writing command macro in stratus cobol (20)

Module 5.pdf
Module 5.pdfModule 5.pdf
Module 5.pdf
 
Task Perform addition subtraction division and multiplic.pdf
Task Perform addition subtraction division and multiplic.pdfTask Perform addition subtraction division and multiplic.pdf
Task Perform addition subtraction division and multiplic.pdf
 
C language 3
C language 3C language 3
C language 3
 
Class notes(week 5) on command line arguments
Class notes(week 5) on command line argumentsClass notes(week 5) on command line arguments
Class notes(week 5) on command line arguments
 
Class notes(week 5) on command line arguments
Class notes(week 5) on command line argumentsClass notes(week 5) on command line arguments
Class notes(week 5) on command line arguments
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 
Subprogramms
SubprogrammsSubprogramms
Subprogramms
 
Function & procedure
Function & procedureFunction & procedure
Function & procedure
 
System software - macro expansion,nested macro calls
System software - macro expansion,nested macro callsSystem software - macro expansion,nested macro calls
System software - macro expansion,nested macro calls
 
Unit 2
Unit 2Unit 2
Unit 2
 
11i&r12 difference
11i&r12 difference11i&r12 difference
11i&r12 difference
 
Functions and modular programming.pptx
Functions and modular programming.pptxFunctions and modular programming.pptx
Functions and modular programming.pptx
 
Functions in C++
Functions in C++Functions in C++
Functions in C++
 
Sas macros part 4.1
Sas macros part 4.1Sas macros part 4.1
Sas macros part 4.1
 
Programming style guideline very good
Programming style guideline very goodProgramming style guideline very good
Programming style guideline very good
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
Preprocessors
PreprocessorsPreprocessors
Preprocessors
 
Matlab Programming Tips Part 1
Matlab Programming Tips Part 1Matlab Programming Tips Part 1
Matlab Programming Tips Part 1
 
Cpp functions
Cpp functionsCpp functions
Cpp functions
 
Vb (1)
Vb (1)Vb (1)
Vb (1)
 

More from Srinimf-Slides

software-life-cycle.pptx
software-life-cycle.pptxsoftware-life-cycle.pptx
software-life-cycle.pptx
Srinimf-Slides
 
Python Tutorial Questions part-1
Python Tutorial Questions part-1Python Tutorial Questions part-1
Python Tutorial Questions part-1
Srinimf-Slides
 
Cics testing and debugging-session 7
Cics testing and debugging-session 7Cics testing and debugging-session 7
Cics testing and debugging-session 7
Srinimf-Slides
 
CICS error and exception handling-recovery and restart-session 6
CICS error and exception handling-recovery and restart-session 6CICS error and exception handling-recovery and restart-session 6
CICS error and exception handling-recovery and restart-session 6
Srinimf-Slides
 
Cics program, interval and task control commands-session 5
Cics program, interval and task control commands-session 5Cics program, interval and task control commands-session 5
Cics program, interval and task control commands-session 5
Srinimf-Slides
 
Cics data access-session 4
Cics data access-session 4Cics data access-session 4
Cics data access-session 4
Srinimf-Slides
 
CICS basic mapping support - session 3
CICS basic mapping support - session 3CICS basic mapping support - session 3
CICS basic mapping support - session 3
Srinimf-Slides
 
Cics application programming - session 2
Cics   application programming - session 2Cics   application programming - session 2
Cics application programming - session 2
Srinimf-Slides
 
CICS basics overview session-1
CICS basics overview session-1CICS basics overview session-1
CICS basics overview session-1
Srinimf-Slides
 
The best Teradata RDBMS introduction a quick refresher
The best Teradata RDBMS introduction a quick refresherThe best Teradata RDBMS introduction a quick refresher
The best Teradata RDBMS introduction a quick refresher
Srinimf-Slides
 
The best ETL questions in a nut shell
The best ETL questions in a nut shellThe best ETL questions in a nut shell
The best ETL questions in a nut shell
Srinimf-Slides
 
How To Master PACBASE For Mainframe In Only Seven Days
How To Master PACBASE For Mainframe In Only Seven DaysHow To Master PACBASE For Mainframe In Only Seven Days
How To Master PACBASE For Mainframe In Only Seven Days
Srinimf-Slides
 
DB2 SQL-Part-1
DB2 SQL-Part-1DB2 SQL-Part-1
DB2 SQL-Part-1
Srinimf-Slides
 
Teradata - Utilities
Teradata - UtilitiesTeradata - Utilities
Teradata - Utilities
Srinimf-Slides
 
Hirarchical vs RDBMS
Hirarchical vs RDBMSHirarchical vs RDBMS
Hirarchical vs RDBMS
Srinimf-Slides
 
20 DFSORT Tricks For Zos Users - Interview Questions
20 DFSORT Tricks For Zos Users - Interview Questions20 DFSORT Tricks For Zos Users - Interview Questions
20 DFSORT Tricks For Zos Users - Interview Questions
Srinimf-Slides
 
SRINIMF - An Overview
SRINIMF - An OverviewSRINIMF - An Overview
SRINIMF - An Overview
Srinimf-Slides
 
Cross Cultural Sensitivity
Cross Cultural SensitivityCross Cultural Sensitivity
Cross Cultural Sensitivity
Srinimf-Slides
 
Db2 v10.5 An Overview
Db2 v10.5 An OverviewDb2 v10.5 An Overview
Db2 v10.5 An Overview
Srinimf-Slides
 
Learn VBScript – Part 1 of 4
Learn VBScript – Part 1 of 4Learn VBScript – Part 1 of 4
Learn VBScript – Part 1 of 4
Srinimf-Slides
 

More from Srinimf-Slides (20)

software-life-cycle.pptx
software-life-cycle.pptxsoftware-life-cycle.pptx
software-life-cycle.pptx
 
Python Tutorial Questions part-1
Python Tutorial Questions part-1Python Tutorial Questions part-1
Python Tutorial Questions part-1
 
Cics testing and debugging-session 7
Cics testing and debugging-session 7Cics testing and debugging-session 7
Cics testing and debugging-session 7
 
CICS error and exception handling-recovery and restart-session 6
CICS error and exception handling-recovery and restart-session 6CICS error and exception handling-recovery and restart-session 6
CICS error and exception handling-recovery and restart-session 6
 
Cics program, interval and task control commands-session 5
Cics program, interval and task control commands-session 5Cics program, interval and task control commands-session 5
Cics program, interval and task control commands-session 5
 
Cics data access-session 4
Cics data access-session 4Cics data access-session 4
Cics data access-session 4
 
CICS basic mapping support - session 3
CICS basic mapping support - session 3CICS basic mapping support - session 3
CICS basic mapping support - session 3
 
Cics application programming - session 2
Cics   application programming - session 2Cics   application programming - session 2
Cics application programming - session 2
 
CICS basics overview session-1
CICS basics overview session-1CICS basics overview session-1
CICS basics overview session-1
 
The best Teradata RDBMS introduction a quick refresher
The best Teradata RDBMS introduction a quick refresherThe best Teradata RDBMS introduction a quick refresher
The best Teradata RDBMS introduction a quick refresher
 
The best ETL questions in a nut shell
The best ETL questions in a nut shellThe best ETL questions in a nut shell
The best ETL questions in a nut shell
 
How To Master PACBASE For Mainframe In Only Seven Days
How To Master PACBASE For Mainframe In Only Seven DaysHow To Master PACBASE For Mainframe In Only Seven Days
How To Master PACBASE For Mainframe In Only Seven Days
 
DB2 SQL-Part-1
DB2 SQL-Part-1DB2 SQL-Part-1
DB2 SQL-Part-1
 
Teradata - Utilities
Teradata - UtilitiesTeradata - Utilities
Teradata - Utilities
 
Hirarchical vs RDBMS
Hirarchical vs RDBMSHirarchical vs RDBMS
Hirarchical vs RDBMS
 
20 DFSORT Tricks For Zos Users - Interview Questions
20 DFSORT Tricks For Zos Users - Interview Questions20 DFSORT Tricks For Zos Users - Interview Questions
20 DFSORT Tricks For Zos Users - Interview Questions
 
SRINIMF - An Overview
SRINIMF - An OverviewSRINIMF - An Overview
SRINIMF - An Overview
 
Cross Cultural Sensitivity
Cross Cultural SensitivityCross Cultural Sensitivity
Cross Cultural Sensitivity
 
Db2 v10.5 An Overview
Db2 v10.5 An OverviewDb2 v10.5 An Overview
Db2 v10.5 An Overview
 
Learn VBScript – Part 1 of 4
Learn VBScript – Part 1 of 4Learn VBScript – Part 1 of 4
Learn VBScript – Part 1 of 4
 

Recently uploaded

Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
Federico Razzoli
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Project Management Semester Long Project - Acuity
Project Management Semester Long Project - AcuityProject Management Semester Long Project - Acuity
Project Management Semester Long Project - Acuity
jpupo2018
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 

Recently uploaded (20)

Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Project Management Semester Long Project - Acuity
Project Management Semester Long Project - AcuityProject Management Semester Long Project - Acuity
Project Management Semester Long Project - Acuity
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 

Writing command macro in stratus cobol

  • 1. Writing command macro in Stratus COBOL www.srinimf.com
  • 2. Command macro A command macro is a text file that contains one or more commands and/or command macro statements and that has a name ending with the suffix .cm. You invoke a macro by entering its name. The operating system then sequentially executes the commands and macro statements in the file
  • 3. Command line A command line is a set of one or more command strings, separated by semicolons. A command string is a command name and any of the command's arguments you select. If you want to issue a command with the same name as the command macro, include the .pm suffix in the command name. Otherwise, the command macro will be called recursively.
  • 4. Macro line A macro line can be one of the following: a command macro statement a comment line a parameter declaration.
  • 5. Comment Line A comment line is either a line that begins with an ampersand (&) followed by a space or a line that consists only of an ampersand. The characters that follow the ampersand on the line, if any, are taken to be the comment. The command processor ignores all comment lines. Ex: & This command macro is named set_cursor.cm. &
  • 6. Command macro statement &echo Controls whether command lines, input lines, and macro statements are written to the default output port.
  • 7. Parameter The macro can take parameters. A parameter in a command macro is a named variable that is declared within the parameter declaration section of a command macro. A parameter receives its initial value from an argument specified in the command string that calls the macro or from a default value specified within the macro. The macro processor stores parameters as character strings. When the value of a parameter is converted, it is treated as numeric if it can be converted to a number; otherwise the value is treated as a string.
  • 8. 3 Parameter Types There are three types of parameters: positional, optional, and switch parameters. These correspond to the three types of command arguments described earlier in this section. A positional parameter is a parameter that the macro processor identifies in a command line by the position of its value (rather than by a keyword). An optional parameter is a parameter that the macro processor identifies in a command line by a keyword that begins with a hyphen and is followed by a value. You can specify allowed values (which the user can then cycle through in the display form). You can also specify a default value. A switch parameter is a parameter that has only two possible values: yes or no. It is used like a command switch argument.
  • 10. Parameter Declaration A parameter declaration is a line in a command macro that appears between the macro statements &begin_parameters and &end_parameters. It must contain the name of a parameter and it can contain a parameter descriptor (described later in this section). The form of a parameter declaration follows. parameter_name [parameter_descriptor] That portion of a macro from the &begin_parameters statement to the &end_parameters statement is called the parameter declaration section. The parameter declaration section must begin on the first line of the macro that is not a comment line.
  • 11. Parameter Label A label is an optional element of a parameter descriptor. Its purpose is to provide a descriptive term that will be useful to the user of a macro. It has the following form: label:
  • 12. Contd... The label, if specified, must be the first component of the parameter descriptor. The colon following label must be the only colon in the descriptor. Depending on the type of the parameter, the label appears in the display form, the command line form, both of these, or neither of these. The information provided by label is used differently depending on the type of the parameter. For a positional parameter, it labels the parameter's field in the display form. It also provides a label in the command line form when you give the command macro with the -usage option. For an optional parameter, it labels the parameter's field in the command line form only. For a switch parameter, there is no purpose for specifying a label, since it is used in neither the display form nor the command line form.
  • 13. Input Line To supply input to a program in a macro, you must include the following elements in the macro in the order shown: the &attach_input macro statement, which allows the program to accept input directly from the macro file the command to invoke the program input to the program (probably including a request such as quit to exit from the program) the &detach_input macro statement, which prevents any further program input from coming from the macro
  • 14. Command Function A command function is a self-contained function that you can use as an argument in a command line. Before executing the rest of the command line in which a command function appears, the command processor evaluates the command function and replaces it with a value. The value returned becomes part of the command line. For example, to display the current time, you could enter the following command line with the command function (time): display_line (time) The output for the preceding example could be 13:10:59, which specifies the current hour (13, in 24-hour format), minutes (10), and seconds (59).
  • 15. Library Path The operating system maintains a set of library paths for each process. Library paths specify where the operating system searches for external commands, include files, object files, or message files. The libraries are referred to as the command, include, object, and message libraries. Library paths fall into two categories. Default library paths are set for an entire module. All processes automatically include all default library paths in their library search paths. These library paths are generally set using the add_default_library_path command in module_start_up.cm. Typically these are library paths that all or almost all processes on the system will need (such as >system>command_library).
  • 16. References Command macros in Stratus Example Command Macros