View previous topic :: View next topic
|
Author |
Message |
sreenatha
New User
Joined: 21 Dec 2005 Posts: 7
|
|
|
|
HOW TO SELECT SPECIFIED FIELDS IN A FILE TO AN OUTPUT FILE
FOR EG:
INPUT HAS A LRECL OF 724 RECORDS LIKE
Code: |
NUMBER NAME DATE ETC
1 A XXX XXX
|
I WANT THE OUTPUT FILE AS
Code: |
NUMBER NAME
1 A
2 B
|
HOW TO DO THIS WITH DF SORT |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
What is your fields attribute, length of number, name etc.
Will it be having Duplicates in OUT.
Regards,
Priyesh. |
|
Back to top |
|
|
meenasomu
New User
Joined: 15 Sep 2005 Posts: 17
|
|
|
|
Hi,
Will this help you?
Code: |
//STEP001 EXEC PGM=SORT
//SORTIN DD *
12345ABCDEFGHIJKL67890MNOPQRST
12345ABCDEFGHIJKL67890MNOPQRST
/*
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(6,2,CH,A)
SUM FIELDS=NONE
OUTREC FIELDS=(1:6,4,6:12,4)
/*
The output will be
ABCD GHIJ
|
The 6th column in the input rec will be at the 1st col of the output rec. The length will be 4.
If you use a SORT FIELDS=COPY, the duplicates will not be removed.
Thanks,
Meena. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
If you just want to keep the first 22 bytes of each record as shown in your example, you can use these DFSORT statements:
Code: |
OPTION COPY
OUTREC FIELDS=(1,22)
|
If you want to do something else, you need to explain in detail what you want to do.
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
|