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

DSN name in trailer


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

Active User


Joined: 02 Jan 2009
Posts: 115
Location: Hyderabad

PostPosted: Mon Feb 29, 2016 11:30 am
Reply with quote

Hi,

I have 50 files. Is there a way to get the file names and a field present in trailer record? Trailer record can be identified with "TR" in first 2 bytes of the record.

I tried using symbolic parameters giving DSN1,DSN2 .. etc. But it didn't work.

I could see some similar posts in the forum, but not of much help. Please advise.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Feb 29, 2016 12:39 pm
Reply with quote

Show what you tried, and how it didn't work.
Back to top
View user's profile Send private message
kranthikumarb

Active User


Joined: 02 Jan 2009
Posts: 115
Location: Hyderabad

PostPosted: Mon Feb 29, 2016 1:41 pm
Reply with quote

Code:

//STEP001  EXEC PGM=SORT                                               
//SYMNAMES DD *                                                         
 DSN1,'INPUT.FIL1'                                                     
 DSN2,'INPUT.FIL2'                                                     
//SYSOUT   DD SYSOUT=*                                                 
//SYSPRINT DD SYSOUT=*                                                 
//SORTIN   DD DISP=SHR,DSN=INPUT.FIL1                                   
//         DD DISP=SHR,DSN=INPUT.FIL2                                   
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
 SORT FIELDS=COPY                                                       
 INCLUDE COND=(1,2,CH,EQ,C'TR')                                         
 OUTFIL FNAMES=SORTOUT,TRAILER1=(DSN1,C' - ',8,10),                     
                       TRAILER2=(DSN2,C' - ',8,10),REMOVECC,NODETAIL   
/*                                                                     


I don't know how to get data from file 1 for trailer 1 and data from fil2 in for trailer 2.

How many trailers can i add like this?
Back to top
View user's profile Send private message
Lakshmi Prakash

New User


Joined: 22 Feb 2016
Posts: 5
Location: India

PostPosted: Mon Feb 29, 2016 3:58 pm
Reply with quote

Hello Kranthi,

To my knowledge this is a easier task in REXX, not sure if it is feasible at all in DFsort, you better search in Rexx forum and you might easily get the answer.

If you find a way to do this using DFSORT please paste your code here for our reference.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon Feb 29, 2016 4:01 pm
Reply with quote

Quote:
To my knowledge this is a easier task in REXX, not sure if it is feasible at all in DFsort, you better search in Rexx forum and you might easily get the answer.


might be from a coding point of view
certainly not performance wise!
Back to top
View user's profile Send private message
kranthikumarb

Active User


Joined: 02 Jan 2009
Posts: 115
Location: Hyderabad

PostPosted: Tue Mar 01, 2016 9:46 am
Reply with quote

Infact, I did it with rexx already. But it looks like there is a possible way to do it using sort, so i thought of checking in the forum.
Back to top
View user's profile Send private message
kranthikumarb

Active User


Joined: 02 Jan 2009
Posts: 115
Location: Hyderabad

PostPosted: Tue Mar 01, 2016 9:47 am
Reply with quote

I called dfsort from with in rexx for performance. I have close to 10 million records in some of the files and I need to get the last record. rexx+sort is a powerful combination icon_smile.gif
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Mar 01, 2016 4:18 pm
Reply with quote

Rexx is a VERY SLOW and INEFFICIENT way of doing it. Use a language like PL/1 or COBOL.
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 Insert trailer for non empty file only DFSORT/ICETOOL 6
No new posts Comparing Header and Trailer. DFSORT/ICETOOL 7
No new posts Adding a trailer with record count an... JCL & VSAM 4
No new posts Build a trailer with total an count SYNCSORT 6
No new posts SORT for dynamic trailer record + CSV... DFSORT/ICETOOL 14
Search our Forums:

Back to Top