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
 

 

DSN name in trailer

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

Active User


Joined: 02 Jan 2009
Posts: 114
Location: Hyderabad

PostPosted: Mon Feb 29, 2016 11:30 am    Post subject: DSN name in trailer
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Mon Feb 29, 2016 12:39 pm    Post subject: Reply to: DSN name in trailer
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: 114
Location: Hyderabad

PostPosted: Mon Feb 29, 2016 1:41 pm    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Feb 29, 2016 4:01 pm    Post subject: Reply to: DSN name in trailer
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: 114
Location: Hyderabad

PostPosted: Tue Mar 01, 2016 9:46 am    Post subject:
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: 114
Location: Hyderabad

PostPosted: Tue Mar 01, 2016 9:47 am    Post subject:
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: 1715
Location: UK

PostPosted: Tue Mar 01, 2016 4:18 pm    Post subject:
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    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 How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts JCL SORT to split the file and put re... Bill Woodger DFSORT/ICETOOL 17 Wed Feb 17, 2016 4:17 pm
No new posts Merge two files having two trailer re... R.Manivannan DFSORT/ICETOOL 7 Wed Nov 25, 2015 9:18 pm
No new posts How to update Trailer count for a VB ... manas121 DFSORT/ICETOOL 10 Tue Oct 13, 2015 10:09 pm
No new posts Adding multiple trailer records at re... kenshin DFSORT/ICETOOL 6 Fri Sep 25, 2015 11:01 am


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