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

read two records from i/p and sort out as single record


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
cheethra

New User


Joined: 20 Jan 2007
Posts: 6
Location: India

PostPosted: Wed Dec 05, 2007 2:10 pm
Reply with quote

I have to copy a field in a particular position from two records in sortin file and write out both the fields as single record in sortout file.
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Wed Dec 05, 2007 2:28 pm
Reply with quote

Hi cheethra.

Can you specify more details, so that it will be easy to analyze.
Back to top
View user's profile Send private message
cheethra

New User


Joined: 20 Jan 2007
Posts: 6
Location: India

PostPosted: Wed Dec 05, 2007 2:34 pm
Reply with quote

eg:

Input file:

A1AAAAAAAAAAAAAAAAAA1998BBBBBBBBBBBBBBBBBBBBBB
A2AAAAAAAAAAAAAAAAAA2000BBBBBBBBBBBBBBBBBBBBBB
B1AAAAAAAAAAAAAAAAAA1994BBBBBBBBBBBBBBBBBBBBBB
B2AAAAAAAAAAAAAAAAAA2005BBBBBBBBBBBBBBBBBBBBBB


Output:
A 1998 2000
B 1994 2005

Condition: if A (A1 & A2 data are picked up and written as single record)
if B(B1 & B2 are written similarly)
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Wed Dec 05, 2007 3:03 pm
Reply with quote

cheethra,

Could you tell how your o/p should look for the following i/p -

Quote:
A1AAAAAAAAAAAAAAAAAA1998BBBBBBBBBBBBBBBBBBBBBB
A2AAAAAAAAAAAAAAAAAA2000BBBBBBBBBBBBBBBBBBBBBB
A3AAAAAAAAAAAAAAAAAA2999BBBBBBBBBBBBBBBBBBBBBB
B1AAAAAAAAAAAAAAAAAA1994BBBBBBBBBBBBBBBBBBBBBB
B2AAAAAAAAAAAAAAAAAA2005BBBBBBBBBBBBBBBBBBBBBB
B3AAAAAAAAAAAAAAAAAA2777BBBBBBBBBBBBBBBBBBBBBB
B4AAAAAAAAAAAAAAAAAA2888BBBBBBBBBBBBBBBBBBBBB
Back to top
View user's profile Send private message
cheethra

New User


Joined: 20 Jan 2007
Posts: 6
Location: India

PostPosted: Wed Dec 05, 2007 3:13 pm
Reply with quote

hey cmon dont change my requirement :-)

I wil have only A1 and A2 for A and B1 & B2 for B. its always two records.

I have only four records in my input file.

hope i am clear

thanks
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Wed Dec 05, 2007 3:22 pm
Reply with quote

Cheetra,

Quote:
dont change my requirement

Im not. Just trying to understand your req clearly for better suggestion.


Quote:
I wil have only A1 and A2 for A and B1 & B2 for B. its always two records.

If this is the case, you can SPLICE the records. Search DFSORT forum for examples. Your key is going to be A and B.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed Dec 05, 2007 5:00 pm
Reply with quote

cheethra
Here is the DFSORT/ICETOOl JCL for your requirement
Code:
//STEP001  EXEC PGM=ICETOOL                                           
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//IN1      DD *                                                       
A1AAAAAAAAAAAAAAAAAA1998BBBBBBBBBBBBBBBBBBBBBB                         
A2AAAAAAAAAAAAAAAAAA2000BBBBBBBBBBBBBBBBBBBBBB                         
B1AAAAAAAAAAAAAAAAAA1994BBBBBBBBBBBBBBBBBBBBBB                         
B2AAAAAAAAAAAAAAAAAA2005BBBBBBBBBBBBBBBBBBBBBB                         
C1AAAAAAAAAAAAAAAAAA1904BBBBBBBBBBBBBBBBBBBBBB                         
C2AAAAAAAAAAAAAAAAAA2007BBBBBBBBBBBBBBBBBBBBBB                         
/*                                                                     
//OUT      DD SYSOUT=*                                                 
//TOOLIN   DD *                                                       
 SPLICE FROM(IN1) TO(OUT) ON(1,1,CH) WITH(9,4) -                       
    USING(CP01)                               
/*                                                                     
//CP01CNTL DD   *                                                     
  INREC IFOUTLEN=80,
        IFTHEN=(WHEN=(2,1,ZD,EQ,1),BUILD=(1,1,4:21,4)),           
        IFTHEN=(WHEN=(2,1,ZD,EQ,2),BUILD=(1,1,9:21,4))           
/*                                                                     
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
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 Error to read log with rexx CLIST & REXX 11
Search our Forums:

Back to Top