i want to display product wise value using ps and ksds file



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

i want to display product wise value using ps and ksds file

Postby pargetz » Fri Aug 08, 2008 11:26 pm

if my ps file is like this
code   name   nos   um    rate   product code
123    milk   12    lt    10     food
124    ,,     ,,    ,,    ,,     food
,,     ,,     ,,    ,,    ,,     cosm


for food i have to find hw much i have issued value means total of all food items

then i have to display for cosm separate also . so i have to read from ksds file too get the issue rate
pargetz
 
Posts: 3
Joined: Mon Jul 14, 2008 8:36 pm
Has thanked: 0 time
Been thanked: 0 time

Re: i want to display product wise value using ps and ksds file

Postby dick scherrer » Sat Aug 09, 2008 3:35 am

Hello and welcome to the forums,

Please notice that your "data" has been "Code"d (using the Code tag on the reply panel). This will preserve alignment and make your post much more readable. You should also use the Preview function so you can see how your post will appear to the forum rather than how it appears in the reply editor. When you are satisfied with how your post appears, then click Submit.

for food i have to find hw much i have issued value means total of all food items
then i have to display for cosm separate also
i have to read from ksds file too get the issue rate


Ok, go for it ;)

When you have questions with your code, post the part of the code where you have questions and someone will be able to help. For starters, you know you need to code definitions for the qsam and vsam files as well as whatever is required to show the needed output.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: i want to display product wise value using ps and ksds file

Postby pargetz » Sat Aug 09, 2008 12:54 pm

the output shuld be like this

project code    prodcode   proname       qty   issuevalue
food                123     milk           12        120
food                124      butter        10        100
                                                ********
                                      total      220
                                                 ********
cosm               220        powder     10       300
cosm               221       lipstick    5        50
                                                 ********
                                       total     350
                                                 ********       

so i need the o/p like this for all my project code wise . so i have to get the issued values from the ksds file and remaining fields from ps file . i want write the above o/p in another file too...
pargetz
 
Posts: 3
Joined: Mon Jul 14, 2008 8:36 pm
Has thanked: 0 time
Been thanked: 0 time

Re: i want to display product wise value using ps and ksds file

Postby dick scherrer » Sun Aug 10, 2008 4:14 am

So, you need to define the 3 files (2 input and the report output). This would be 3 FDs with appropriate elementary level field definitions and some working storage definitions for accumulators, control breaks and report headings.

Then you need the actual code to open the files, read the first sequentially, the vsam randomly, and thd process to create the report and accumulate the totals.

Now it is time for you to code and test.

When something is not working, post pack here with what you have and what is not working.

Obviously, others should not ost code unless it is to help you work on code you have already posted.

The forum is to help you learn, not do the assignment for you.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: i want to display product wise value using ps and ksds file

Postby pargetz » Sun Aug 10, 2008 11:00 am

ya i done codings but for me all product is adding and display . i cant seperate the product wise. even by using dummy variable i cant able to slove .
pargetz
 
Posts: 3
Joined: Mon Jul 14, 2008 8:36 pm
Has thanked: 0 time
Been thanked: 0 time

Re: i want to display product wise value using ps and ksds file

Postby dick scherrer » Mon Aug 11, 2008 8:12 am

Hello,

Until you more clearly describe the problem, we will not be able to help much.

Telling us "it is not working" does not provide any information for us to use to help you.

If you have some code that compiles and executes (even if incorrectly), you can add some diagnostic code (maybe some diaplay statements) to your program to find where problems exist.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post