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 Query in DFSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
gragha

New User


Joined: 25 Jul 2006
Posts: 23

PostPosted: Tue Nov 09, 2010 3:35 am    Post subject: Sort Query in DFSORT
Reply with quote

I have 2 Input files:

Input 1

AAAAAAAAAAAAA

Input 2

BBBBBBBBBBBBB
CCCCCCCCCCC
DDDDDDDDDDD

I need the Output to be:

BBBBBBBBBBBBB
AAAAAAAAAAAAA
CCCCCCCCCCC
DDDDDDDDDDD

Can anyone tell me how to accomplish this.
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: Tue Nov 09, 2010 3:57 am    Post subject:
Reply with quote

Quote:
Can anyone tell me how to accomplish this.


Not until you tell us the rules for what you're trying to do which are not obvious from your example. Are you trying to insert the first record from input file 1 after the first record from input file 2, or is it something more complicated than that based on the "keys" of the records, or something else?

Can input file1 only have one record?

You need to give a complete description and example of what you're trying to do and the possible variations. Then somebody can help you.

Also, give the RECFM and LRECL of the input files and the starting position, length and format of all relevant fields.
Back to top
View user's profile Send private message
gragha

New User


Joined: 25 Jul 2006
Posts: 23

PostPosted: Tue Nov 09, 2010 4:32 am    Post subject:
Reply with quote

Hi,

Thanks. Both files are FB, 4000 in length.

File 1 will always have 1 record. And we always need to insert file 1's record as the 2nd record in file 2. There are no conditions
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: Tue Nov 09, 2010 5:03 am    Post subject:
Reply with quote

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

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/4000)
//IN2 DD DSN=...  input file2 (FB/4000)
//SORTOUT DD DSN=...  output file (FB/4000)
//SYSIN DD *
  JOINKEYS F1=IN1,FIELDS=(4001,8,A),SORTED,NOSEQCK
  JOINKEYS F2=IN2,FIELDS=(4001,8,A),SORTED,NOSEQCK
  JOIN UNPAIRED,F1,F2,ONLY
  OPTION COPY
  OUTFIL VTOF,BUILD=(5,4000)
/*
//JNF1CNTL DD *
  INREC OVERLAY=(4001:C'00000002')
/*
//JNF2CNTL DD *
  INREC OVERLAY=(4001:SEQNUM,8,ZD,INCR=2)
/*
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 HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
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 Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm

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