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

Count on in a file where we have 4 input files


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Mazahar

New User


Joined: 11 Dec 2007
Posts: 82
Location: hyderabad

PostPosted: Wed Nov 04, 2009 4:26 pm
Reply with quote

Hi All,

Once again a typical senario, Can you please assist. I am using DFSORT

1) file 1 is a 80byte FB file which is having 80 records
2) File 2 is having 100 records, which is also 80 byte FB
3) File 3 is having 150 records which is also 80 byte FB
4) File 4 is having 200 records which is also 80 byte FB

Can i get this count in a file of FB 80 with ths counts

like this
80 100 150 200
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Nov 04, 2009 8:03 pm
Reply with quote

Hi,

Are there only 4 files all the time? Or is it variable?

Regards,
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Wed Nov 04, 2009 10:00 pm
Reply with quote

Mazahar,

Use the following DFSORT JCL. concatenate a 1 line $$ record before each file so that it can be used an identifier to each file.

Code:

//STEP0100 EXEC PGM=SORT     
//SYSOUT   DD SYSOUT=*       
//SORTIN   DD *             
$$               
//         DD DSN=Your fb 80 byte file1,DISP=SHR 
//         DD * 
$$               
//         DD DSN=Your fb 80 byte file2,DISP=SHR 
//         DD * 
$$               
//         DD DSN=Your fb 80 byte file3,DISP=SHR   
//         DD * 
$$               
//         DD DSN=Your fb 80 byte file4,DISP=SHR
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD *                                                     
  SORT FIELDS=COPY                                                   
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(82:4C'0')),                       
  IFTHEN=(WHEN=GROUP,BEGIN=(1,2,CH,EQ,C'$$'),PUSH=(81:ID=1)),       
  IFTHEN=(WHEN=(81,1,ZD,EQ,1,AND,1,2,CH,NE,C'$$'),OVERLAY=(82:C'1')),
  IFTHEN=(WHEN=(81,1,ZD,EQ,2,AND,1,2,CH,NE,C'$$'),OVERLAY=(83:C'1')),
  IFTHEN=(WHEN=(81,1,ZD,EQ,3,AND,1,2,CH,NE,C'$$'),OVERLAY=(84:C'1')),
  IFTHEN=(WHEN=(81,1,ZD,EQ,4,AND,1,2,CH,NE,C'$$'),OVERLAY=(85:C'1'))
                                                                     
  OUTFIL REMOVECC,NODETAIL,BUILD=(80X),                             
  TRAILER1=(TOT=(82,1,ZD,M11,LENGTH=8),X,                           
            TOT=(83,1,ZD,M11,LENGTH=8),X,                           
            TOT=(84,1,ZD,M11,LENGTH=8),X,                           
            TOT=(85,1,ZD,M11,LENGTH=8))                             
//*
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Nov 04, 2009 10:38 pm
Reply with quote

icon_eek.gif

Regards,
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 7
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 Write line by line from two files DFSORT/ICETOOL 7
Search our Forums:

Back to Top