Put paragraph name into a variable

This is a Mainframe COBOL forum - you can post your queries on Mainframe COBOL, VS COBOL II, COBOL/370 , Enterprise COBOL

Moderators: dbzTHEdinosauer, Moderator Group

Post Reply
ChykyMunky
Member
Posts: 12
Joined: Tue May 05, 2015 8:21 pm

Put paragraph name into a variable

Post by ChykyMunky » Sat Sep 12, 2015 12:37 am

Hi I was wondering if there is a way to put a paragraph name into a variable. There has to be a better way than how I am doing it. Right now Im doing MOVE "1000-PARAGRAPH-NAME" TO WS-HOLD-NAME.

I want avoid having to move 1000-PARAGRAPH-NAME, and have it done automatically. Like this:

Code: Select all

WORKING-STORAGE SECTION.
01 WS-HOLD-NAME                 PIC X(30).

PROCEDURE DIVISION.
1000-PARAGRAPH-NAME.
   Perform some function to get the paragraph name and store it to WS-HOLD-NAME
   DISPLAY 'Paragraph name is ' WS-HOLD-NAME
   .

OUPUT SHOULD BE
Paragraph name is 1000-PARAGRAPH-NAME

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others