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

Sort several type of records


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

New User


Joined: 17 Jan 2006
Posts: 17

PostPosted: Thu May 31, 2007 6:02 am
Reply with quote

Hi,

I had a requirement, that I receive several input files with same format layout & the same dataset name each week, but the file contains different type of record to identify the sort position for the file (type of record such as AAAA, BBBB, CCCC, DDDD) , if file has records with type AAAA sort by position 120-123, if file has records with type BBBB sort by position 100-103, if file has records with type CCCC sort by position 90-97, if file has records with type DDDD sort by position 80-85. The file always contains only one type of records.

Can anybody let me know how can I use icetool/dfsort to set up one Sort step to process only one input file but cover for all four the type of record. Thanks in advance for your help !

Code:

EX : FileXXXX

ID-NAME(4 bytes)   Data             SORT-POSTION ( Postion 120-123)   
---------------    ----                 ------------------
AAAAA     VVVVVVVVVVVVVVVVVVVVVVVV     1010
AAAAA     BBBBBBBBBBBBBBBBBBBBBBBB     1009
AAAAA     NNNNNNNNNNNNNNNNNNNNNNNN     1011   
AAAAA     XXXXVVVVVVVVVVVVVVVVVVVV     1015
AAAAA     VVVVBBBBBBBBBBBBBBBBBBBB     1009
AAAAA     DDDDDNNNNNNNNNNNNNNNNNNN     1031   

EX : FileXXXX
 
ID-NAME(4 bytes)   Data             SORT-POSTION ( Postion 100-103)   
---------------    ----                 ------------------

BBBB     VVVVVVVVVVVVVVVVVVVVVVVV     1010
BBBB     BBBBBBBBBBBBBBBBBBBBBBBB     1009
BBBB     NNNNNNNNNNNNNNNNNNNNNNNN     1011   

EX : FileXXXX

ID-NAME(4 bytes)   Data             SORT-POSTION ( Postion 90-97)   
---------------    ----                 ------------------

CCCC     VVVVVVVVVVVVVVVVVVVVVVVV     1010VVVV
CCCC     BBBBBBBBBBBBBBBBBBBBBBBB     1009XXXX
CCCC     NNNNNNNNNNNNNNNNNNNNNNNN     1011CCCC   

EX : FileXXXX


ID-NAME(4 bytes)   Data             SORT-POSTION ( Postion 80-85)   
---------------    ----                 ------------------

DDDD     VVVVVVVVVVVVVVVVVVVVVVVV     101056
DDDD     BBBBBBBBBBBBBBBBBBBBBBBB     1009VV
DDDD     NNNNNNNNNNNNNNNNNNNNNNNN     101177
DDDD     VVVVVVVVVVVVVVVVVVVVVVVV     10105F
DDDD     BBBBBBBBBBBBBBBBBBBBBBBB     1009VC
DDDD     NNNNNNNNNNNNNNNNNNNNNNNN     10117D
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu May 31, 2007 8:28 pm
Reply with quote

What is the RECFM and LRECL of each input file?

Please show the expected output records.
Back to top
View user's profile Send private message
Huan-Nguyen

New User


Joined: 17 Jan 2006
Posts: 17

PostPosted: Thu May 31, 2007 9:08 pm
Reply with quote

Frank Yaeger wrote:
What is the RECFM and LRECL of each input file?

Please show the expected output records.


Recort format FB, Record lenght 150 bytes.

If file has record type AAAA

The expected output is :

AAAA BBBBBBBBBBBBBBBBBBBBBBBB 1009
AAAA VVVVBBBBBBBBBBBBBBBBBBBB 1009
AAAA VVVVVVVVVVVVVVVVVVVVVVVV 1010
AAAA NNNNNNNNNNNNNNNNNNNNNNNN 1011
AAAA XXXXVVVVVVVVVVVVVVVVVVVV 1015
AAAA DDDDDNNNNNNNNNNNNNNNNNNN 1031

If file has record type BBBB
The expected output is :

BBBB BBBBBBBBBBBBBBBBBBBBBBBB 1009
BBBB VVVVVVVVVVVVVVVVVVVVVVVV 1010
BBBB NNNNNNNNNNNNNNNNNNNNNNNN 1011

If file has record type CCCC
The expected output is :

CCCC BBBBBBBBBBBBBBBBBBBBBBBB 1009XXXX
CCCC VVVVVVVVVVVVVVVVVVVVVVVV 1010VVVV
CCCC NNNNNNNNNNNNNNNNNNNNNNNN 1011CCCC

If file has record type CCCC
The expected output is :

DDDD BBBBBBBBBBBBBBBBBBBBBBBB 1009VC
DDDD BBBBBBBBBBBBBBBBBBBBBBBB 1009VV
DDDD VVVVVVVVVVVVVVVVVVVVVVVV 10105F
DDDD VVVVVVVVVVVVVVVVVVVVVVVV 101056
DDDD NNNNNNNNNNNNNNNNNNNNNNNN 10117D
DDDD NNNNNNNNNNNNNNNNNNNNNNNN 101177
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu May 31, 2007 9:23 pm
Reply with quote

Do you want four output files - one for each record type?

Or do you want one output file with all of the records?
Back to top
View user's profile Send private message
Huan-Nguyen

New User


Joined: 17 Jan 2006
Posts: 17

PostPosted: Thu May 31, 2007 9:35 pm
Reply with quote

Hi Frank,

I would like the sort step process one input file & the produce one output file. Thanks,
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu May 31, 2007 10:09 pm
Reply with quote

Oh, I missed the part where you said
Quote:
The file always contains only one type of records.
Now I understand.

Here's a DFSORT job that will do what you asked for.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/150)
//SORTOUT DD DSN=...  output file (FB/150)
//SYSIN    DD    *
  INREC IFOUTLEN=158,
   IFTHEN=(WHEN=(1,4,CH,EQ,C'AAAA'),
     OVERLAY=(151:120,4)),
   IFTHEN=(WHEN=(1,4,CH,EQ,C'BBBB'),
     OVERLAY=(151:100,4)),
   IFTHEN=(WHEN=(1,4,CH,EQ,C'CCCC'),
     OVERLAY=(151:90,8)),
   IFTHEN=(WHEN=(1,4,CH,EQ,C'DDDD'),
     OVERLAY=(151:80,6))
  SORT FIELDS=(151,8,CH,A)
  OUTREC BUILD=(1,150)
/*
Back to top
View user's profile Send private message
Huan-Nguyen

New User


Joined: 17 Jan 2006
Posts: 17

PostPosted: Fri Jun 01, 2007 3:34 am
Reply with quote

Thank you very much, I very appreciate your kind help.
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top