|
View previous topic :: View next topic
|
| Author |
Message |
kranthikumarb
Active User
Joined: 02 Jan 2009 Posts: 115 Location: Hyderabad
|
|
|
|
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 |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
| Show what you tried, and how it didn't work. |
|
| Back to top |
|
 |
kranthikumarb
Active User
Joined: 02 Jan 2009 Posts: 115 Location: Hyderabad
|
|
|
|
| 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 |
|
 |
Lakshmi Prakash
New User
Joined: 22 Feb 2016 Posts: 5 Location: India
|
|
|
|
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 |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10903 Location: italy
|
|
|
|
| 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 |
|
 |
kranthikumarb
Active User
Joined: 02 Jan 2009 Posts: 115 Location: Hyderabad
|
|
|
|
| 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 |
|
 |
kranthikumarb
Active User
Joined: 02 Jan 2009 Posts: 115 Location: Hyderabad
|
|
|
|
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  |
|
| Back to top |
|
 |
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
| Rexx is a VERY SLOW and INEFFICIENT way of doing it. Use a language like PL/1 or COBOL. |
|
| Back to top |
|
 |
|
|