I have a query, I'm not able to access PARM parameter passed thru SYSTSIN in COBOL-DB2 program. Below is my program-
003120 LINKAGE SECTION.
003130 01 PARM-BUFFER.
003140 02 PARM-LENGTH PIC S9(4) COMP.
003150 02 PARM-NAME PIC X(10).
003200 PROCEDURE DIVISION USING PARM-BUFFER.
003202 DISPLAY 'LENGTH OF THE PARM IS: ' PARM-LENGTH.
003203 DISPLAY 'VALUE OF PARM PARAMETER IS: 'PARM-NAME.
003206 INSPECT PARM-NAME TALLYING WS-COUNTER1 FOR CHARACTERS
003207 BEFORE INITIAL SPACE.
003208 INSPECT PARM-NAME TALLYING WS-COUNTER2 FOR ALL SPACES.
003209 DISPLAY 'TOTAL WRITTEN CHARACTERS IN PARM = ' WS-COUNTER1.
003210 DISPLAY 'TOTAL SPACES IN PARM ' PARM-NAME '=' WS-COUNTER2.
003211 DISPLAY 'TOTAL CHARACTERS = 'WS-COUNTER1 ' + ' WS-COUNTER2.
003130 01 PARM-BUFFER.
003140 02 PARM-LENGTH PIC S9(4) COMP.
003150 02 PARM-NAME PIC X(10).
003200 PROCEDURE DIVISION USING PARM-BUFFER.
003202 DISPLAY 'LENGTH OF THE PARM IS: ' PARM-LENGTH.
003203 DISPLAY 'VALUE OF PARM PARAMETER IS: 'PARM-NAME.
003206 INSPECT PARM-NAME TALLYING WS-COUNTER1 FOR CHARACTERS
003207 BEFORE INITIAL SPACE.
003208 INSPECT PARM-NAME TALLYING WS-COUNTER2 FOR ALL SPACES.
003209 DISPLAY 'TOTAL WRITTEN CHARACTERS IN PARM = ' WS-COUNTER1.
003210 DISPLAY 'TOTAL SPACES IN PARM ' PARM-NAME '=' WS-COUNTER2.
003211 DISPLAY 'TOTAL CHARACTERS = 'WS-COUNTER1 ' + ' WS-COUNTER2.
And my JCL has below code while running JCL using IKJEFT01 after successful compile and Bind -
000040 //SYSTSIN DD *
000041 DSN SYSTEM(DB2T)
000042 RUN PROGRAM(PROD7248) PLAN(CMNDBA) -
000043 PARM('SATYA')
000044 END
000045 /*
000041 DSN SYSTEM(DB2T)
000042 RUN PROGRAM(PROD7248) PLAN(CMNDBA) -
000043 PARM('SATYA')
000044 END
000045 /*
In SYSOUT I'm getting below result-
********************************* TOP OF DATA **********************************
********************************* TOP OF DATA **********************************
LENGTH OF THE PARM IS: 0005
VALUE OF PARM PARAMETER IS: SATYA
TOTAL WRITTEN CHARACTERS IN PARM = 0
TOTAL SPACES IN PARM SATYA =0
TOTAL CHARACTERS = 0 + 0
LENGTH OF THE PARM IS: 0005
VALUE OF PARM PARAMETER IS: SATYA
TOTAL WRITTEN CHARACTERS IN PARM = 0
TOTAL SPACES IN PARM SATYA =0
TOTAL CHARACTERS = 0 + 0
Ideally I should have got -
********************************* TOP OF DATA **********************************
LENGTH OF THE PARM IS: 0005
VALUE OF PARM PARAMETER IS: SATYA
TOTAL WRITTEN CHARACTERS IN PARM = 5
TOTAL SPACES IN PARM SATYA =5
TOTAL CHARACTERS = 5 + 5
LENGTH OF THE PARM IS: 0005
VALUE OF PARM PARAMETER IS: SATYA
TOTAL WRITTEN CHARACTERS IN PARM = 5
TOTAL SPACES IN PARM SATYA =5
TOTAL CHARACTERS = 5 + 5
Please let me know if there is any other alternative to pass the values, kindly note that I can not use SYSIN control card here. I also tried to MOVE the data from PARM-NAME (Linkage variable) to WSS but I'm getting blank. Please help