Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Want the data in a certain order for my output structure

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
madhu_910

New User


Joined: 21 Feb 2005
Posts: 10

PostPosted: Mon Oct 08, 2012 7:29 am    Post subject: Want the data in a certain order for my output structure
Reply with quote

Hi all,

I have 2 arrays declared in my cobol program.I call two common modules to get data for the output file.The data from the common module is stored in each array respectively.Now my question is I want the data in a certain orde for my output structure.The data is not numeric to sort the array.Can anyone help me.
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Oct 08, 2012 7:55 am    Post subject:
Reply with quote

Hello,

You have been a member here for more than 7 years. . . Why have you chosen such a topic title? It tells us Nothing to have a subject of "cobol" in the part of the forum that is ONLY for cobol topics. . .

Why might you believe the data needed to be numeric to sort it?

In order for someone to be of help, you need to more clearly explain just what you are trying to do. If anyone posts suggestions/solutions now, it would only be a guess because you have not given usable info. You need to explain the arrays, the "common modules", why you have not soerted the data before loading the arrays and possibly much other info.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Mon Oct 08, 2012 10:06 am    Post subject:
Reply with quote

Your perception that only numeric data can be sorted is very wrong

You can atleast try bubble sort
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Oct 08, 2012 10:40 am    Post subject:
Reply with quote

Hello,

Rather than just suggest "bubble sort", i believe we can be more help if we require more detail (as i mentioned before - we shouldn't guess or need to). I could only think of several "solutions" but they all required assumptions as the poster did not provide any info . . . I chose to suggest nothing.

Quote:
Your perception that only numeric data can be sorted is very wrong
I suspect there is much that is not as it seems.

Maybe some clarification will be provided.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1715
Location: UK

PostPosted: Mon Oct 08, 2012 1:07 pm    Post subject:
Reply with quote

It's COBOL so they are tables.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Mon Oct 08, 2012 1:13 pm    Post subject:
Reply with quote

Yes Dick I got it
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Oct 08, 2012 3:17 pm    Post subject:
Reply with quote

instead of a sorting the data within the COBOL program
what is wrong with a SORT Step following the COBOL program?

That would not only make the COBOL program easier to write,
but a separate SORT step would be the best use of resources.
Back to top
View user's profile Send private message
madhu_910

New User


Joined: 21 Feb 2005
Posts: 10

PostPosted: Mon Oct 08, 2012 6:56 pm    Post subject:
Reply with quote

I want to clear the things
1.the arrays I used is in the cobol which is occurs clause that has 100 rows
2.the data that comes from the common modules is depends on the database tables.As soon as I get the data for each satisfied criteria I move into my internal tables.
3.Now the data is in 2 internal working storage tables.

first internal table has
1.batch cat code
2.batch description
3.batch date
4.content

Second internal table has
1.batch cat code
2.batch module name
3.batch module date
4.module content

I want the output to be in

1.batch cat code(PR -BATCH CODE)
1.batch description(PR DESC)
2.batch module name(PR MODL NAME)
2.batch cat code(RT-BATCH CODE)
1.batch desc(RT-desc)
2.batch modl name(RT modl name)
.
.
.
...

100 times

This is all related to cobol program code
where I wanted to store the data in this particular order to move it to output structure.let me know if this makes clear
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Oct 08, 2012 7:00 pm    Post subject:
Reply with quote

actually, it is not clear yet.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1715
Location: UK

PostPosted: Mon Oct 08, 2012 7:32 pm    Post subject:
Reply with quote

They are tables - not arrays. And they have entries not rows.

Are the 2 tables in the same sequence? If so, what is stopping you from creating your output - one record created from the 2 tables - entry by entry. Sort the data afterwards.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Oct 08, 2012 7:38 pm    Post subject:
Reply with quote

I assume there is some common field in the two COBOL Internal Tables linking one to another.
so, why have two tables?
there should only should be one.
that will solve most of your problems.
Back to top
View user's profile Send private message
madhu_910

New User


Joined: 21 Feb 2005
Posts: 10

PostPosted: Mon Oct 08, 2012 7:50 pm    Post subject:
Reply with quote

Dbz,
The thing is I manually move certain code to the common field depending on the other fields in the tableSo I need 2 tables.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Oct 08, 2012 7:52 pm    Post subject:
Reply with quote

you have not explained why.

all you have provided us is your solution to a problem/requirement
that you have as yet, not explained.
Back to top
View user's profile Send private message
madhu_910

New User


Joined: 21 Feb 2005
Posts: 10

PostPosted: Mon Oct 08, 2012 8:13 pm    Post subject:
Reply with quote

Dick,
I answered for the question why I need 2 tables
The 2 tables data comes from 2 different programs
If I have to store in 1 table I need search before I store
To make it simple I loaded in 2 tables
But the data in the 2 tables is in different orders
Now I want to load 1 more table in certain order so that I can move it to output structure directly
How to load the table in certain order is a question
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Mon Oct 08, 2012 8:27 pm    Post subject: Reply to: Want the data in a certain order for my output str
Reply with quote

why not post the COBOL copybooks of the arrays to clarify the problem

from Your description the content of the <rows> of the arrays look different

post the COPYBOOKS ( the relevant part ) using the code tags
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1715
Location: UK

PostPosted: Mon Oct 08, 2012 10:40 pm    Post subject:
Reply with quote

Do you get the data by calling the common module(s) from within your program or do you read them in as files? I ask this because I do not see the specifics only that the data comes from a common module (first post) 2 different modules (last post). Your last post says you read in the data which implies a file which implies that you can sort the data before it hits your program and you can do a 2 file match.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Oct 09, 2012 8:11 am    Post subject:
Reply with quote

Hello,

I suspect that this approach has been dictated or conceived and now there is a desire to see it thru.

From the initial post, i've believed if we knew proper detail (not yet provided) we could offer alternatives that would be much easier to implement and later to understand / maintain.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts ODPP(Optim Data privacy Provider) Iss... Rama kishore IBM Tools 1 Mon Nov 07, 2016 5:46 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us