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
 

 

Count records present in an input ps and OVERWRITE O/P PS?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
ajay krishna raj

New User


Joined: 23 Apr 2008
Posts: 2
Location: kolkata

PostPosted: Fri Apr 25, 2008 11:31 am    Post subject: Count records present in an input ps and OVERWRITE O/P PS?
Reply with quote

How do we count records present in an input ps and then overwrite that COUNT into an output ps present beforehand?
The COUNT should be overwritten on some specific columns only rest of the record of the output ps remains the same.
Back to top
View user's profile Send private message

saiprasadh

Active User


Joined: 20 Sep 2006
Posts: 154
Location: US

PostPosted: Fri Apr 25, 2008 11:41 am    Post subject:
Reply with quote

Hi Ajay,

Can you provide an example .


Thanks
Sai
Back to top
View user's profile Send private message
ajay krishna raj

New User


Joined: 23 Apr 2008
Posts: 2
Location: kolkata

PostPosted: Fri Apr 25, 2008 4:37 pm    Post subject: Reply to: Count records present in an input ps and OVERWRITE
Reply with quote

output ps is like...

2008376366 12345abcdefjkl

now I want to count the number of records in the input ps, and then replace '12345' in the output ps with the count calculated.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Fri Apr 25, 2008 9:38 pm    Post subject:
Reply with quote

You can use a DFSORT job like the following to do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *  input file
RECORD 01
RECORD 02
RECORD 03
/*
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL REMOVECC,NODETAIL,
    BUILD=(80X),
    TRAILER1=('TCOUNT,''',COUNT=(M11,LENGTH=5),'''')
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD *   original output file
2008376366  12345abcdefjkl
/*
//SORTOUT DD DSN=...  modified output file
//SYSIN    DD    *
  OPTION COPY
  INREC OVERLAY=(13:TCOUNT)
/*
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
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


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