EASYTRIEVE ARRAY ISSUE

Ask/Clarify the questions on EASYTRIEVE

Moderators: DikDude, Moderator Group

Post Reply
sahiljethi
Member
Posts: 10
Joined: Thu Nov 24, 2011 9:40 pm

EASYTRIEVE ARRAY ISSUE

Post by sahiljethi » Wed Dec 07, 2011 7:04 pm

Hi,

I have a task, where I have to write the different occurances of an array in an output file. I have written a loop to read through all occurances of array.

But my program is only displaying the first instance correctly, all other instances of array are appearing as spaces.

Please help me!!!!

Code: Select all

 FILE INAUDIT
   IN-ARRAY               1  1750 A
*-------------------------------------------
 WS-ARRAY                W    35  A OCCURS 50
 WS-SUB2                  W    2   N  

*-------------------------------------------
 JOB INPUT INAUDIT
    MOVE IN-ARRAY TO WS-ARRAY 
    WS-SUB2 = 1
    DO WHILE (WS-SUB2 LE 50)                                
       DISPLAY WS-SUB2 ' :' WS-ARRAY (WS-SUB2)
       WS-SUB2 = WS-SUB2 + 1                                
    END-DO                                                  
 GOTO JOB

Input Data:
S 525 : : : :2010022520100225 F 88I : : : :2009122820091228

Output:
1:S 525 : : : :2010022520100225
2:
3:
-
-
49:
50:

[/code]

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Wed Dec 07, 2011 11:22 pm

Looks like the array was not loaded properly. . .

You provided nothing to work with, so identifying problems becomes most idfficult.

For someone to help, you need to show how the array is loaded and that the values are correct before the loop t display them.
Have a good one

sahiljethi
Member
Posts: 10
Joined: Thu Nov 24, 2011 9:40 pm

Post by sahiljethi » Thu Dec 08, 2011 3:49 pm

Dikdude,

This was the complete job, which i specified in my last post & actual input from my file.

Input file has record length of 1750. I want to divide this data into parts of 35 bytes and display each part.

After displaying the first part successfully, prog displays all other parts as spaces.

Please let me know other details you require?

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Fri Dec 09, 2011 2:36 am

MOVE IN-ARRAY TO WS-ARRAY
After this statement, display ws-array and see what you have. . . I suspect it will not be what you are expecting. . .

On the initial read, i did not recognize that the posted code was ALL of the code :oops:
Have a good one

sahiljethi
Member
Posts: 10
Joined: Thu Nov 24, 2011 9:40 pm

Post by sahiljethi » Fri Dec 09, 2011 1:46 pm

I did as you said; and turned out to be what u said "I suspect it will not be what you are expecting."

MOVE IN-ARRAY TO WS-ARRAY - This only moved the first 35 bytes of In-ARRAY to WS-ARRAY;

Please let me know what can be done for moving all the 1750 bytes to WS-ARRAY??

Also, I checked that SPACES is not acceptable keyword in EASYTRIEVE....then how do we check whether an alphanumeric variable contains data in EASYTRIEVE.

Thanks,
Sahil

sahiljethi
Member
Posts: 10
Joined: Thu Nov 24, 2011 9:40 pm

Post by sahiljethi » Fri Dec 09, 2011 4:13 pm

Thanks for ur help, I fixed the array issue by changing the array defination :lol:
http://code.xmlgadgets.com/2010/09/20/o ... asytrieve/

Please help me with "SPACES is not acceptable keyword in EASYTRIEVE....then how do we check whether an alphanumeric variable contains data or not"

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Sat Dec 10, 2011 12:22 pm

Yup, the cobol SPACES is not available in EASYTRIEVE (AS FAR AS I KNOW).

Define a WS field of the maximum spaces you need and compare against these. Or use an inline ' ' literal in the code.
Have a good one

satishmtechmf
Member
Posts: 1
Joined: Wed Aug 17, 2016 11:04 am

Re: EASYTRIEVE ARRAY ISSUE

Post by satishmtechmf » Wed Aug 17, 2016 11:10 am

I am also Facing same issue did any body knows how to load array...Please help...

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