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
 

 

Update the TRAILER with the count from another file

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

New User


Joined: 30 Mar 2010
Posts: 2
Location: INDIA

PostPosted: Tue Mar 30, 2010 10:50 pm    Post subject: Update the TRAILER with the count from another file
Reply with quote

Hi,

I have to update the Trailer of a file with a count from another file.
To be more specific, my requirement is like this.

In FILE1, the Trailer is as shown below.
9999999999000500000600
The green colored count is the no of occurences of 88888888as a record in FILE1. The violet colored count is the count of total number of records in the FILE1.

Can we have both these counts in the Trailer in a single step?

I tried, but since I am not able to I calculated the occurence of 888888888 in another STEP and I have the count in a file.
The FILE1 has the TRAILER 9999999999000000000600.
I want to update the TRAILER with the count in the other File.

Please advise.

Thanks,
Nita Antony.
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Mar 30, 2010 11:08 pm    Post subject: Reply to: Update the TRAILER with the count from another fil
Reply with quote

Nita Antony,

You don't need 2 passes of data. Since you haven't told anything about the DCB properties of the input file, I assumed that it is 80 byte FB recfm file.

use the following DFSORT JCL

Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD *                                                 
AAAAAAAA                                                       
88888888                                                       
BBBBBBBB                                                       
CCCCCCCC                                                       
88888888                                                       
DDDDDDDD                                                       
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                                 
  SORT FIELDS=COPY                                             
  INREC IFTHEN=(WHEN=(1,8,CH,EQ,C'88888888'),OVERLAY=(81:C'1'))
  OUTFIL REMOVECC,BUILD=(1,80),                                 
  TRAILER1=('9999999999',TOT=(81,1,ZD,M11,LENGTH=5),           
            COUNT=(M11,LENGTH=7))                               
//*


The output of this is (the count of 8888888 is 2 and total count is 6)

Code:

AAAAAAAA               
88888888               
BBBBBBBB               
CCCCCCCC               
88888888               
DDDDDDDD               
9999999999000020000006 
Back to top
View user's profile Send private message
Nita Antony

New User


Joined: 30 Mar 2010
Posts: 2
Location: INDIA

PostPosted: Wed Mar 31, 2010 9:28 am    Post subject: Reply to: Update the TRAILER with the count from another fil
Reply with quote

Hi,

The File is VB, with size 2602.

Thx, Nita.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Mar 31, 2010 9:43 pm    Post subject:
Reply with quote

Nita Antony,

*Sigh* what is the position of the string '88888888' . Assuming that your string is at position 5 ( 4 bytes RDW for VB files) the following DFSORT JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD DSN=Your input VB 2602 file,DISP=SHR
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD *                                           
  SORT FIELDS=COPY                                       
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,C'0',5)),           
  IFTHEN=(WHEN=(6,8,CH,EQ,C'88888888'),OVERLAY=(5:C'1')) 
  OUTFIL REMOVECC,BUILD=(1,4,6),                         
  TRAILER1=('9999999999',TOT=(5,1,ZD,M11,LENGTH=5),       
            COUNT=(M11,LENGTH=7))                         
//*
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 0 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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