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
 

 

Header also displayed after every 1000 records
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
athulvijay

New User


Joined: 01 Jul 2010
Posts: 17
Location: PUNE

PostPosted: Thu Feb 16, 2012 2:02 pm    Post subject: Header also displayed after every 1000 records
Reply with quote

The output file structre is
OUTFILE DD DSN=DATADEV9.OST.FILELIST.AVK,
DISP=(MOD,DELETE),UNIT=DISK,
SPACE=(TRK,(100,50),RLSE),
DCB=(RECFM=FB,LRECL=128,BLKSIZE=0)

We are writing the header only once in separate para but I could able to see some part of header also getting displayed after every 1000 records in the output file. TCE-CLASS is a part of header which get overwritten after every 1000 records. Could you please help me out here?

Many Thanks
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Thu Feb 16, 2012 2:11 pm    Post subject: Reply to: header also getting displayed after every 1000 rec
Reply with quote

You are not telling anything useful...
just that something does not work the way You expect

do not post screen shots, the just clutter the forum,
a plain TEXT cut and paste with the code tags is more than enough
( the screen shot has been deleted )
also because it tells nothing useful
Back to top
View user's profile Send private message
athulvijay

New User


Joined: 01 Jul 2010
Posts: 17
Location: PUNE

PostPosted: Thu Feb 16, 2012 2:19 pm    Post subject: Apologies for the screen shot
Reply with quote

Apologies for the screen shot.Thanks for the comments. Let me put it in this way.

Code:
aaa-NAME       aaaR  aaa-SNO   aaa-FLAG aaa-OST   aaaaa-FLAG aaa-aaaaD-T
--------       ----  -------   -------- -------   ---------- -----------

001001 0000000000     A  R  TJ19527   YAA-FLAG 4159305   YAAAA-FLAG 4159305AA-A
001002 0000000001     A  -  TK06183   Y------- 4280723   Y--------- 4280723----

In the above record R, AA-FLAG, AAAA-FLAG is actually header details which is written into the output file only once using separate para. But after every 1000 records in the output file I could able to see some part of the header also present along with the details. We are suing same record to write header and data. We are initializing it after every write.

Please let me know if any other info is required from my end.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Thu Feb 16, 2012 2:28 pm    Post subject: Reply to: header also getting displayed after every 1000 rec
Reply with quote

as I said showing that the output does not match Your expectations does not give any hint on the why.

would posting a bit of code so hard ?

Your data even if useless has been code tagged to show the look
Back to top
View user's profile Send private message
athulvijay

New User


Joined: 01 Jul 2010
Posts: 17
Location: PUNE

PostPosted: Thu Feb 16, 2012 2:34 pm    Post subject: Hope this gives some idea to help me..
Reply with quote

Code:
***********************                             
   1200-HEADER-BCKFILE.                             
***********************                             
*                                                   
        STRING 'aaa-NAME       '  DELIMITED BY SIZE 
               'aaaR  '           DELIMITED BY SIZE 
               'aaa-SNO   '       DELIMITED BY SIZE 
               'aaa-FLAG '        DELIMITED BY SIZE 
               'aaa-OST   '       DELIMITED BY SIZE 
               'aaaaa-FLAG '      DELIMITED BY SIZE 
               'aaa-aaaaa-TIME '  DELIMITED BY SIZE 
               'aa-FLAG '         DELIMITED BY SIZE 
               'aaa-aa-IND '      DELIMITED BY SIZE 
               'aaa-aa-DAYS-OUT ' DELIMITED BY SIZE 
               INTO BACKOUT-RECORD.                 
        WRITE BACKOUT-RECORD.   
                     
PROCESS-PARA

IF DB-STATUS-OK                                     
   PERFORM UNTIL DB-END-OF-SET OR WS-LOOP-END = 'Y'
      INITIALIZE OUTPUT-PCD-DETAILS BACKOUT-RECORD 
PERFORM 4200-WRITE-PARA THRU 4200-EXIT

4200-WRITE-PARA.           
*****************           
  WRITE OUTPUT-PCD-DETAILS.
  WRITE BACKOUT-RECORD.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Feb 16, 2012 2:46 pm    Post subject:
Reply with quote

well, posting some code obviously is not too hard,
possibly posting some useful code is 36_11_6.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Feb 16, 2012 3:35 pm    Post subject:
Reply with quote

1. what is the record count of your input file?

2. unless you are deleting your output file in a previous step
or separate job,
this is sorta stupid
Code:
DISP=(MOD,DELETE),UNIT=DISK,
-
Back to top
View user's profile Send private message
athulvijay

New User


Joined: 01 Jul 2010
Posts: 17
Location: PUNE

PostPosted: Thu Feb 16, 2012 3:45 pm    Post subject:
Reply with quote

Sorry Dbz, i copied some other file. Please find below the file detials. I was wondering whether it is something to do with block or track!!

my record length is 128 , The header is getting ovelapped in after 1000 records = 128000

128000 bytes == 5*25600(current block size).

OUTFILE DD DSN=DATDEV9.OST.FILELIST.CITYDB,
DISP=(NEW,CATLG,CATLG),
UNIT=DISK,SPACE=(CYL,(20,20),RLSE),
DCB=(RECFM=FB,LRECL=128,BLKSIZE=25600)
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Feb 16, 2012 3:55 pm    Post subject:
Reply with quote

i repeat my question: 1. what is the record count of your input file?

also a tip.

instead of giving us suggestions to a problem that you have been unable to solve,
give us the information that we ask for.

and no, i doubt that the problem stems from
Quote:
I was wondering whether it is something to do with block or track!!
Back to top
View user's profile Send private message
athulvijay

New User


Joined: 01 Jul 2010
Posts: 17
Location: PUNE

PostPosted: Thu Feb 16, 2012 4:05 pm    Post subject:
Reply with quote

The record count of the output file is 2280. We are doing an area sweep and writing it to an output file.

Please let me know if any other info required.
Thanks,
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Feb 16, 2012 4:10 pm    Post subject:
Reply with quote

i repeat my question: 1. what is the record count of your input file?

and i'll bite: what is an area sweep?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Thu Feb 16, 2012 4:11 pm    Post subject: Reply to: header also getting displayed after every 1000 rec
Reply with quote

we are just wasting time here.
what You have looks like some kind of storage overlay
the snippet posted is not enough to do any problem determination

what does the program do every 1000 records
what happens when You use as output a certainly empty/NEW dataset
Back to top
View user's profile Send private message
robert_wood

New User


Joined: 04 Jan 2011
Posts: 8
Location: Portsmouth, UK

PostPosted: Thu Feb 16, 2012 4:38 pm    Post subject: Reply to: header also getting displayed after every 1000 rec
Reply with quote

@ dbz

"Area sweep" is an IDMS record access method.

You have to be mighty careful with this access method if accessing more than one record type, since only one record can be CURRENT of AREA.

Too much information...

Cheers Rob
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Feb 16, 2012 4:47 pm    Post subject:
Reply with quote

Rob,
thx

reason I asked is that the TS has provided nothing helpful,
and the obvious solution is some kind of 1000 iteration loop.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Thu Feb 16, 2012 5:45 pm    Post subject:
Reply with quote

Quote:
128000 bytes == 5*25600(current block size).
The default for QSAM buffering is 5 buffers. It sounds like there's something going on in your program in that your header is not cleared from the buffer and hence recurs every time that buffer comes up for reuse.

Very definnitely a programming problem -- you need to start analyzing the code to determine why this is happening.

Try changing your JCL to see if the header location changes:
Code:
OUTFILE DD DSN=DATDEV9.OST.FILELIST.CITYDB,
DISP=(NEW,CATLG,CATLG),
UNIT=DISK,SPACE=(CYL,(20,20),RLSE),
DCB=(BUFNO=30,RECFM=FB,LRECL=128,BLKSIZE=25600)
If it does, then for sure you've got a program problem.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Feb 16, 2012 7:54 pm    Post subject: Re: Apologies for the screen shot
Reply with quote

athulvijay wrote:
[...]
Code:
aaa-NAME       aaaR  aaa-SNO   aaa-FLAG aaa-OST   aaaaa-FLAG aaa-aaaaD-T
--------       ----  -------   -------- -------   ---------- -----------

001001 0000000000     A  R  TJ19527   YAA-FLAG 4159305   YAAAA-FLAG 4159305AA-A
001002 0000000001     A  -  TK06183   Y------- 4280723   Y--------- 4280723----

In the above record R, AA-FLAG, AAAA-FLAG is actually header details [...]


I know you are going to tell me that it is due to you re-typing, but aaa-FLAG is not the same as AA-FLAG etc. The data that is allegedly from the header does not even line up with the fields on the detail records. When you post some data from your screen, paste it, don't re-type it. We don't want to spend time on yout typos.

If parts of the data on some of your records happen to coincide with parts of the data you have written as a header there is very close to zero chance of it being other than an error in your program, or JCL, or something you have done.

Start by considering what you have been asked already. What happens in your program at "1000"? How about showing the code which is creating the detail record, not showing us the code creating the header (which you have not claimed is a problem)?

Why are you using STRING? Are you using STRING also for the detail records? Are all the fields fixed-length and undelimited? They look so from what you have shown.
Back to top
View user's profile Send private message
athulvijay

New User


Joined: 01 Jul 2010
Posts: 17
Location: PUNE

PostPosted: Thu Feb 16, 2012 9:20 pm    Post subject: Thanks alot Robert
Reply with quote

This info is very helpful . Let me check once.
Back to top
View user's profile Send private message
athulvijay

New User


Joined: 01 Jul 2010
Posts: 17
Location: PUNE

PostPosted: Fri Feb 17, 2012 2:24 pm    Post subject: Thanks alot Rob
Reply with quote

This info was a real help. It is the problem with default beffer size.
128000byte = 25600*5
5 is the default buffer number of QSAM. It mean to me like once 5 buffer(let take 1 block as one buffer) is filled actual write takes place. So the filler get displayed only after every 1000 records.

---
I tried running a job with
output dataset having RECL = 128 and BLOCK Size = 27904.
Now,
27904/128 = 218 and 218*5 = 1090.
In the output dataset the header record were repeating after 1090 records

similarly another try , RECL was 112 and BLK Size was 27888.
27888/112 = 249 and 249 * 5 = 1245
The header was repeating after every 1245 records in the dataset

So this shows there is no glitch in our code.


Thanks alot.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Fri Feb 17, 2012 2:36 pm    Post subject: Reply to: header also getting displayed after every 1000 rec
Reply with quote

Quote:
So this shows there is no glitch in our code.

horse manure....
but, if You are happy we are happy, ( or rather we do not care )
f Your code was correct then no spurious data would appear, whatever the <i/o> parameters ( buffer setup )

wiser to review the behavior of the WRITE statement the way You are using it ( locate mode )
it has some interesting gotchas,
certainly somebody proficient in COBOL will tell ( laughing ) what happens when mixing in the same program move and locate mode
( it' s for You Bill )
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Fri Feb 17, 2012 3:35 pm    Post subject:
Reply with quote

athulvijay, you did EXACTLY what I recommended in my earlier post, and the results were exactly what I thought would happen, yet your conclusion is diametrically opposed to the conclusion I provided.

Contrary to what you think, this particular problem CANNOT be caused anywhere except in your program. And your reaction tells me you are another one of the Immaculate Programmers -- you never wrote a bad line of code, so every problem MUST be a system problem (since your code could never be wrong). Professional programmers see a problem and immediately ask what they could have done in their code to cause that problem; Immaculate Programmer see a problem and blame the system for days (or in some cases, months) until it is proven that their code is flawed.
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
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts how to split records based on specifi... Venkata Ramayya DFSORT/ICETOOL 6 Wed Sep 28, 2016 3:20 am


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