IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Utility to find the count in a PS File


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sathyaraj

New User


Joined: 28 Sep 2007
Posts: 71
Location: India.

PostPosted: Wed Oct 31, 2007 1:31 am
Reply with quote

That code was really mind blowing.. the logic that has been employed was more impressive than the utility itself.. That '0' & '1' Thing...

Am really felling good about joining this forum.. Wish to have a long run... icon_smile.gif
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Oct 31, 2007 2:02 am
Reply with quote

Quote:
the logic that has been employed was more impressive than the utility itself


More impressive than DFSORT? You obviously haven't explored much of what DFSORT/ICETOOL offers. It's extremely impressive if I do so say myself. icon_wink.gif
Back to top
View user's profile Send private message
sathyaraj

New User


Joined: 28 Sep 2007
Posts: 71
Location: India.

PostPosted: Wed Oct 31, 2007 11:06 pm
Reply with quote

Hi Frank..

Got one more modification in the requirement.. is there anyway to give the serial number for the records?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Oct 31, 2007 11:17 pm
Reply with quote

Quote:
is there anyway to give the serial number for the records


It's not clear what you mean by "serial number" or where it would fit into your report. Do you mean "sequence number"? Please explain what you want more clearly. Show an example of the output you want including the "serial number".
Back to top
View user's profile Send private message
sathyaraj

New User


Joined: 28 Sep 2007
Posts: 71
Location: India.

PostPosted: Thu Nov 01, 2007 12:05 am
Reply with quote

Code:

1.NO OF EMP RECORDS WITH IPLAN IND 7      =    1215355
2.NO OF DEP RECORDS WITH IPLAN IND 7      =    1675400 2.
3.NO OF EMP RECORDS WITH IPLAN IND 6      =     191698
4.NO OF DEP RECORDS WITH IPLAN IND 6      =     373431
5.NO OF EMP RECORDS WITH IPLAN IND 5      =    1696575
6.NO OF DEP RECORDS WITH IPLAN IND 5      =    2411017
1.NO OF DEP RECORDS FOR CUSTOMER  0002284 =       7200
2.NO OF EMP RECORDS FOR CUSTOMER  0002284 =       3519
3.NO OF DEP RECORDS FOR CUSTOMER  0006472 =       1668
4.NO OF EMP RECORDS FOR CUSTOMER  0006472 =       2096


Please let me know if this explains the requiremet....
Back to top
View user's profile Send private message
sathyaraj

New User


Joined: 28 Sep 2007
Posts: 71
Location: India.

PostPosted: Tue Nov 06, 2007 8:58 pm
Reply with quote

Hi Frank..
Am at the verge of completing my task and am waiting to get the solution from you.. Can you please suggest me with some idea..?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Nov 06, 2007 10:26 pm
Reply with quote

Sorry, I missed your post on 11/01.

If you want a sequence number, you can add an OUTREC statement like this:

Code:

  OUTREC OVERLAY=(51:SEQNUM,3,ZD)


and then use that sequence number in the TRAILER3 -

Code:

    TRAILER3=(51,3,...
Back to top
View user's profile Send private message
sathyaraj

New User


Joined: 28 Sep 2007
Posts: 71
Location: India.

PostPosted: Tue Nov 06, 2007 11:05 pm
Reply with quote

HI..

I tried to use the logic... but something went wrong badly... am getting such an O/P
Code:

0528. 0035664    =       64   |     125
9147. 0036805    =    83948   |   64671
4689. 0037625    =     5853   |    9689
5837. 0037868    =      485   |     663

Can you plz tell me why its happening this way..?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Nov 06, 2007 11:38 pm
Reply with quote

Hmmm ... it's been so long, I forgot what we were doing. I guess we're creating trailer records and so you need sequence numbers for the trailer records rather than for the output records. TRAILERx doesn't allow SEQNUM, so I guess you'll have to run the output of the original report back through DFSORT to add the sequence numbers.

So the step to produce the report with the trailer records would have a temp file as its output and you'd use that for input to another step that would have:

Code:

   INREC BUILD=(SEQNUM,3,ZD,1,n)


or you could leave room for the SEQNUM in the first step with TRAILER3=(5:...) and then use this in the second step:

Code:

   INREC OVERLAY=(1:SEQNUM,3,ZD)
Back to top
View user's profile Send private message
sathyaraj

New User


Joined: 28 Sep 2007
Posts: 71
Location: India.

PostPosted: Wed Nov 07, 2007 12:04 am
Reply with quote

K..I ll give a try.. Actually the purpose of numbering is to find the number of records in teh final O/P..

So i tried to do it this way..

Code:

INREC IFTHEN=(WHEN=INIT,OVERLAY=(236:C'0',249:C'1')),               
      IFTHEN=(WHEN=(195,2,CH,EQ,C'EE'),OVERLAY=(236:C'1',249:C'0')),
      IFTHEN=(WHEN=(195,2,CH,EQ,C'RR'),OVERLAY=(236:C'1',249:C'0'))
SORT FIELDS=(1,7,CH,A)                                             
OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(250:C'0')),                       
       IFTHEN=(WHEN=(1,2,CH,EQ,C'  ',AND,7,1,CH,NE,C' '),           
                                       OVERLAY=(250:C'1'))         
OUTFIL REMOVECC,NODETAIL,                                           
  HEADER1=(2:'CUSTOMER NUMBER ',25:'EMP',31:'|',37:'DEP',/,         
  1:'---------------------------------------',/,                   
    'NUMBER OF CUSTOMERS =',TOT=(250,1,ZD,M10,LENGTH=4),/,
____________________________         
  1:'---------------------------------------'),                     
  BUILD=(80X),                                                     
  SECTIONS=(1,7,                                                   
  TRAILER3=('  ',1,7,'    = ',                                     
    20:TOT=(236,1,ZD,M10,LENGTH=8),'   |',                         
    32:TOT=(249,1,ZD,M10,LENGTH=8)))                               


And its giving ICE223A F REPORT FIELD ERROR

Cant we use the overlay in the OUTREC to find the count of the O/P file..

I have given an underscore where the error msg is thrown..
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Nov 07, 2007 1:42 am
Reply with quote

The ICE223A points to TOT in HEADER1. TOT can only be used in TRAILERx, not in HEADERx.
Back to top
View user's profile Send private message
sathyaraj

New User


Joined: 28 Sep 2007
Posts: 71
Location: India.

PostPosted: Wed Nov 07, 2007 3:21 am
Reply with quote

Yes.. Thats working great.. Thnx a lot for your tremendous support..

Got a great learning from Frank.. Thnx once again.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts To get the count of rows for every 1 ... DB2 3
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top