Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Sort several type of records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Sort several type of records
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 Moderator


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

PostPosted: Thu May 31, 2007 8:28 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Thu May 31, 2007 9:23 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Thu May 31, 2007 10:09 pm    Post subject:
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    Post subject:
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    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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts Setting Font Type for XMIT satish.ms10 All Other Mainframe Topics 3 Fri Sep 15, 2017 10:01 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us