Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 Join in SQL Query vickey_dw DB2 2 Tue Jan 17, 2017 12:15 am
This topic is locked: you cannot edit posts or make replies. MQ setup query mohitsaini Java & MQSeries 4 Sun Jan 08, 2017 1:53 am
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us