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
 
How to get DEFAULT record from DF-SORT

 
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: Sat Apr 28, 2007 1:41 am    Post subject: How to get DEFAULT record from DF-SORT
Reply with quote

I have a file, all records in that file that contains Key field (5 bytes) & Data field, I would like to create a file with all the Key field = AAAAA , a file with all the Key field = BBBBB and if any key field is not equal AAAAA or BBBBB I wand to create a file with a default key field = XXXXX

EX: Input file

AAAAA vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
AAAAB VVVVVVVVVVVVVVVVVVVVVVVVVVVVxxxxx
AAAAA HHHHHHHHHHHHHHHHHHHHVVVVVVVVVVVVV
AAACD BBBBBBBBBBBBBBBBBBBBXXXXXXXXXXXXX
BADRC BBBBBBBBBBBBBBXXXXXXXXXXXXXXXXXXX
BBBBB NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
XXXXX TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
BBBBB VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV

Output in File-01
AAAAA vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
AAAAA HHHHHHHHHHHHHHHHHHHHVVVVVVVVVVVVV

Output in File-02
BBBBB NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
BBBBB VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV

Output in File-03
XXXXX VVVVVVVVVVVVVVVVVVVVVVVVVVVxxxxx
XXXXX BBBBBBBBBBBBBBBBBBBBXXXXXXXXXXXXX
XXXXX BBBBBBBBBBBBBBXXXXXXXXXXXXXXXXXXX
XXXXX TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT

How can I use DF-SORT to get the 3 files like that ???
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: Sat Apr 28, 2007 2:39 am    Post subject:
Reply with quote

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
//OUT1 DD DSN=...  output file1
//OUT2 DD DSN=...  output file1
//OUT3 DD DSN=...  output file1
//SYSIN    DD    *
  OPTION COPY
  OUTFIL FNAMES=OUT1,INCLUDE=(1,5,CH,EQ,C'AAAAA')
  OUTFIL FNAMES=OUT2,INCLUDE=(1,5,CH,EQ,C'BBBBB')
  OUTFIL FNAMES=OUT3,SAVE,OVERLAY=(1:C'XXXXX')
/*
Back to top
View user's profile Send private message
Huan-Nguyen

New User


Joined: 17 Jan 2006
Posts: 17

PostPosted: Sat Apr 28, 2007 2:47 am    Post subject:
Reply with quote

I very appreciate your expert help. Thank you very much & wishing you have a great week-end !
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 BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm
No new posts query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm
No new posts Squeeze record left so that zeroes ar... Vignesh Sid SYNCSORT 5 Fri Nov 10, 2017 1:40 pm

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