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 Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm


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