Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Record select and update trailer

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Mhesarag

New User


Joined: 07 Jun 2008
Posts: 2
Location: Bangalore

PostPosted: Sat Jun 07, 2008 3:14 pm    Post subject: updating Count in trailer record
Reply with quote

Hi All,

I have the following reords
HH20080607
DUD01
DGS01
DUD01
DGS01
TT2008060700004

I want the eleminate record with DGS and also update Trailer count

i.e in this case it would 2
Back to top
View user's profile Send private message

Mhesarag

New User


Joined: 07 Jun 2008
Posts: 2
Location: Bangalore

PostPosted: Sat Jun 07, 2008 3:17 pm    Post subject:
Reply with quote

Hi,

Can I get the sort card to do it.

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8657
Location: Back in jolly old England

PostPosted: Sat Jun 07, 2008 3:19 pm    Post subject:
Reply with quote

Please do not post a new question in an existing thread

Yes, you can use a sort product to achieve this. Please search the forum for the numerous examples that have already been shown.
Back to top
View user's profile Send private message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Sat Jun 07, 2008 7:45 pm    Post subject:
Reply with quote

Here is a syncsort job for your requirement.
Code:

//S1      EXEC PGM=SORT     
//SYSOUT  DD SYSOUT=*       
//SORTIN  DD *             
HH20080607                 
DUD01                       
DGS01                       
DUD01                       
DGS01                       
TT2008060700004             
/*                         
//SORTOUT DD SYSOUT=*                                       
//SYSIN  DD *                                               
    OPTION COPY                                             
    OMIT COND=(1,3,CH,EQ,C'DGS')                             
    INREC FIELDS=(1,80,SEQNUM,5,ZD)                         
    OUTREC IFTHEN=(WHEN=(1,2,CH,EQ,C'TT'),                   
           BUILD=(1,10,(81,5,ZD,SUB,+2),EDIT=(TTTTT),65X)), 
           IFTHEN=(WHEN=NONE,                               
           BUILD=(1,80))                                     
/*                                                           


Output :
Code:

HH20080607     
DUD01           
DUD01           
TT2008060700002


--Parag
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to force a select query to abend neo4u DB2 5 Mon Apr 23, 2018 1:36 pm
No new posts VSAM - Accessing beyond record size Benchwarmer JCL & VSAM 6 Wed Apr 11, 2018 9:20 pm
No new posts SELECT TO MULIPLE OUTFIL speermb DFSORT/ICETOOL 5 Fri Mar 23, 2018 10:44 pm
No new posts Need Guidance regarding UPDATE query Poha Eater DB2 3 Mon Feb 12, 2018 11:35 pm
No new posts Copying only first and last word from... chandan.inst SYNCSORT 4 Wed Jan 31, 2018 4:19 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us