1) can we display the index?
Answers were Sorted based on User's Feedback
Answer / shan
Ya correct,
To be more clear,
Declare a variable with usage is index (01 WS--VAR-DISPLAY
USAGE IS INDEX)
then SET WS-VAR-DISPLAY to WS-INDEX
Display WS-VAR-DISPLAY
| Is This Answer Correct ? | 12 Yes | 7 No |
You can't directly display the Index. But you can create a normal numeric field in your working storage and set that to the Index.
Example:
01 WS-TABLE.
05 WS-CUSTOMER PIC X(25) OCCURS 10 INDEXED BY INDEX1.
01 WS-NUMERICS.
05 WS-INDEX-COUNT PIC 9(02) VALUE 0.
SET WS-INDEX-COUNT TO INDEX1.
DISPLAY WS-INDEX-COUNT.
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / naina
Yes, we can!!!
The easiest way, which would work in all versions of COBOL
is
SET W-S-VAR-PICS9(9)-USAGE-DISPLAY TO THE-INDEX-U-WANT-TO-
DISPLAY
DISPLAY W-S-VAR-PICS9(9)-USAGE-DISPLAY
| Is This Answer Correct ? | 4 Yes | 5 No |
why we are using picture clause in the cobol programs?
What rules are to be followed while using the corresponding options?
what is the difference b/w level no.01 & level no.77?
How do u initialize an array?
what is the difference between COBOL2 AND COBOL390?
Whats the use of Examine command? can someone help me?
How can we increase the size of an existing PDS to include more no. of modules.
I have a field with data type X(10). I want to perform arithmetic operation on this field? I tried doing it by moving the value into a numeric field. but it didn't work out. I am getting a S0C7 abend. Pls let me know if there is any way of getting this done?
what is the difference between Plan & package?
What is the reference modification.
How do we get current date from system with century in COBOL?
here is my compile and link edit steps in a jcl //COMPILE1 JOB (3CUS,S),'CCDM TEST' //STEPNAME EXEC PGM=IGYCRCTL,PARM='DYNAM,RENT,LIB,OBJECT, // OFFSET,APOST,OPTIMIZE',REGION=4096K //STEPLIB DD DSNAME=PM7351.TEST2.COB,DISP=SHR //SYSIN DD DSNAME=PM7351.TEST2.COB(PGM1),DISP=SHR //SYSUT1 DD UNIT=SYSDA,SPACE=(10,(10,10)) //SYSUT2 DD UNIT=SYSDA,SPACE=(10,(10,10)) //SYSUT3 DD UNIT=SYSDA,SPACE=(10,(10,10)) //SYSUT4 DD UNIT=SYSDA,SPACE=(10,(10,10)) //SYSUT5 DD UNIT=SYSDA,SPACE=(10,(10,10)) //SYSUT6 DD UNIT=SYSDA,SPACE=(10,(10,10)) //SYSUT7 DD UNIT=SYSDA,SPACE=(10,(10,10)) //SYSPRINT DD SYSOUT=* //SYSLIN DD DSNAME=&&LOAD,DISP=(MOD,PASS),UNIT=SYSDA, // SPACE=(10,(10,10)),DCB=BLKSIZE=400 //LKED EXEC PGM=IEWL,REGION=1024K //SYSPRINT DD SYSOUT=A //SYSLIB DD DSN=PM7351.TEST2.LOADLIB,DISP=SHR // DD DSN=PM7351.TEST2.COB(PGM1),DISP=SHR //SYSLMOD DD DSN=PM7351.TEST2.LOADLIB, // DISP=SHR //SYSUT1 DD UNIT=SYSDA,DCB=BLKSIZE=1024,SPACE=(CYL,(1,1)) //SYSTERM DD SYSOUT=* //SYSLIN DD DSN=&&LOAD,DISP=(OLD,DELETE) //SYSIN DD DUMMY i am getting IEW2013I 0F08 NO MEMBER NAME WAS SPECIFIED. MODULE WAS SAVED USING TEMPNAM1. could any one tell me the resolution for this..?