View previous topic :: View next topic
|
Author |
Message |
Surekha Kareti
New User
Joined: 26 May 2009 Posts: 3 Location: Bangalore
|
|
|
|
Hi, Please find my requirement and help me coding in program.
1) Program A calls my pgm using two parameters. They are
a) I1 - x(01) values are O, W, H (Header), L (line) , C
b) I2 - X(60)
Program A moves as below:
MOVE WS-NAME TO I2
MOVE 'H' TO I1
Calls my program
after that again it moves student id and calls like this it calls.
2) My program receives I1 & I2 and should write an output file which is of length 256. This file should have header and line items.
Could some one please help me in writing the logic.
Thanks
SR |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Your basic problem is that your requirements are not clear. If the requirements are adequately stated, usually the program becomes a fairly simple translation process. Examples of issues with your post:
1. Where did this come from -- the only mention in your post of "student id"?
Quote: |
after that again it moves student id and calls like this it calls. |
2. Why is the output file 256 bytes long -- shouldn't it be a multiple of 60?
3. Will you only have one header?
4. How many detail lines can you have?
5. How do the O, W, C values figure in your program?
6. Why do you need a subprogram for this anyway -- shouldn't you just do it all in program A?
7. Will program A call your program to signal the end of the processing? If not, how will your program be able to write out the last record?
8. Are you supposed to be accumulating the detail lines into a single output record -- or should each detail be written as a line? If so, what do the extra 206 bytes consist of in the record?
9. Will the I2 variable always have 60 bytes of data?
and that's a start at helping you come up with the logic. |
|
Back to top |
|
|
Surekha Kareti
New User
Joined: 26 May 2009 Posts: 3 Location: Bangalore
|
|
|
|
Thanks for your reply. I am answering for all your questions in sequence also attaching the output format how it should look like.
1) I just mentioned Student ID as an example there are many fields.
2) Output is not a multiple of 60, the length is 256. When program A reads input file it moves student id, name etc etc to I2 and calls my program to write output file.
3) Only one header
4) Lines should not be morethan 22
5) O - File to open, W- to write file, C - close a file
6) Its Client req thats why writing a module
7) Program A signals that my pgm is end of process
8) Please see attached
9) I2 is 60 bytes field but student id or name or etc is moving into it may not be 60bytes.
Please let me know the thoughts
Thanks
SR |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
(1) do not post attachments, (2) do not post screen shots,
(1) not everybody can see them
(2) is just a waste of resource, the same info can be conveyed with a text cut and paste and the code tags
if You want help it would be wiser to learn to describe clearly the requirements
how does the screen shot relate to Your issue ? |
|
Back to top |
|
|
Surekha Kareti
New User
Joined: 26 May 2009 Posts: 3 Location: Bangalore
|
|
|
|
I am sorry, I am new. Thanks |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forum,
Not to worry - someone will let you know when you post astray. . .
Which makes being clear quite important.
You're welcome.
Suggest you start over and post some sample input data. Then show the exact output you want from the sample input. Use copy/paste and the "Code" tag to preserve alignment and improve readability. There is a Preview function so you can see your post as it will appear to the forum rather than how it looks in the Reply Editor. Once the appearance is as you want, Submit. If you copy/paste screen text, you should not manually change the spacing (this will corrupt the alignment).
Post the rules for getting from the input to the output. The sample data should contain data that demonstrates each rule. |
|
Back to top |
|
|
|