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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: read two records from i/p and sort out as single record
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    Post subject: Hi
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    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Wed Dec 05, 2007 3:03 pm    Post subject:
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    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Wed Dec 05, 2007 3:22 pm    Post subject:
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    Post subject:
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    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 Data replication from multiple Db2 ta... kishpra DB2 2 Mon Mar 27, 2017 9:58 pm
No new posts Splitting of single report to seperat... abdulrafi TSO/ISPF 4 Mon Mar 27, 2017 3:59 pm
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm


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