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

Sort Query in DFSORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Tue Nov 09, 2010 3:57 am
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
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 Developer


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

PostPosted: Tue Nov 09, 2010 5:03 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
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 Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top