Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : Command : RETP To see last 25 COMMAND LINE commands that we have issued, use RETP on the command line.

Google
 
Web mainframegurukul.com

EASYTRIEVE ARRAY ISSUE

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> EASYTRIEVE
  View previous topic :: View next topic  
Author Message
sahiljethi
Member


Joined: 24 Nov 2011
Posts: 10

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Dec 07, 2011 7:04 pm    Post subject: EASYTRIEVE ARRAY ISSUE Reply with quote

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:

 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]
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.

DikDude
Moderator


Joined: 22 Jul 2011
Posts: 1001
Location: usa

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Dec 07, 2011 11:22 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
sahiljethi
Member


Joined: 24 Nov 2011
Posts: 10

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
1 salutes

PostPosted: Thu Dec 08, 2011 3:49 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
DikDude
Moderator


Joined: 22 Jul 2011
Posts: 1001
Location: usa

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Fri Dec 09, 2011 2:36 am    Post subject: Reply with quote

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 Embarassed
_________________
Have a good one
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
sahiljethi
Member


Joined: 24 Nov 2011
Posts: 10

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Fri Dec 09, 2011 1:46 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
sahiljethi
Member


Joined: 24 Nov 2011
Posts: 10

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Fri Dec 09, 2011 4:13 pm    Post subject: Reply with quote

Thanks for ur help, I fixed the array issue by changing the array defination Laughing
http://code.xmlgadgets.com/2010/09/20/occurs-clause-in-easytrieve/

Please help me with "SPACES is not acceptable keyword in EASYTRIEVE....then how do we check whether an alphanumeric variable contains data or not"
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
DikDude
Moderator


Joined: 22 Jul 2011
Posts: 1001
Location: usa

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Sat Dec 10, 2011 12:22 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
satishmtechmf
Member


Joined: 17 Aug 2016
Posts: 1

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Aug 17, 2016 11:10 am    Post subject: Re: EASYTRIEVE ARRAY ISSUE Reply with quote

I am also Facing same issue did any body knows how to load array...Please help...
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> EASYTRIEVE All times are GMT + 5 Hours
Page 1 of 1



 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Cobol Tutorial
This cobol tutorial covers most of the important topics like STRING, UNSTRING, COMP, COMP-3.....
DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. Explains in simple language. Some Chapters are locked, Forum members have free access to these chapters
CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming...
JCL Tutorial
This is most popular JCL tutorial from mainframegurukul. It does contain important jcl ....
SORT Tutorial
This Tutorial covers all important aspects of DFSORT. Has more SORT examples
INTERVIEW Questions
This page covers important interview questions
Mainframe Jobs
Mainframe Jobs posted by members of mainframegurukul forum
FaceBook Page
MainframeGurukul FaceBook Page
LinkedIn Page
MainframeGurkul Linkedin Page

This widget requires Flash Player 9 or better







Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials || Mainframe CICS tutorial|| Mainframe COBOL Tutorial

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB