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

sorting and formatting two input files (VB format) into o/p


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

New User


Joined: 04 Feb 2008
Posts: 65
Location: Hyd

PostPosted: Thu Dec 11, 2008 6:47 pm
Reply with quote

Hi,

I have two input files which are in VB format. I need to format those inputs into output file.

Here is the example:
Code:

1(6)          15(4)          21(5)          66(8)
111111        1234           aaaaa          3
222222        4567           bbbbb          5


1(5)           33(4)        39(8)
aaaaa          1234          1
bbbbb          4567          2


Output :


1234  aaaaa    3  1
2222  bbbbb    5  2





Input format is LRECL = 100, RECFM=VB

How can i get the above output using SORT JCL??

Thanks,
Kalyan
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Dec 11, 2008 11:22 pm
Reply with quote

kalyan.v,

Answer the following questions.

1. Do you have duplicates in any of the files? if you have then how do you want to handle them? Show more examples of data

2. What is LRECL of the input files? What do you want the output to be ? A VB or FB file?
Back to top
View user's profile Send private message
kalyan.v

New User


Joined: 04 Feb 2008
Posts: 65
Location: Hyd

PostPosted: Fri Dec 12, 2008 10:05 am
Reply with quote

Hi Skolusu,

Here are the answers for ur questions.

1) There are no duplicates in any of the file.
2)LRECL of the input files is 100.

The output to be in any format VB or FB.

Thanks,
Kalyan
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Dec 12, 2008 10:35 pm
Reply with quote

kalyan.v,

I assumed that you did not consider the RDW when you gave the positions of the fields in the files. ie. you said the keys start 15 for 4 and 21 for 5 bytes in file1. Since it is a vb file , you need to add 4 bytes of rdw which makes the key positions 19 and 25 respectively
Code:

//STEP0100 EXEC PGM=ICETOOL                                 
//TOOLMSG  DD SYSOUT=*                                     
//DFSMSG   DD SYSOUT=*                                     
//IN1      DD DSN=your input file 1,DISP=SHR
//IN2      DD DSN=your input file 2,DISP=SHR
//T1       DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(1,1),RLSE)
//OUT      DD SYSOUT=*                                     
//TOOLIN   DD *                                             
  COPY FROM(IN2) USING(CTL1)                               
  COPY FROM(IN1) USING(CTL2)                               
  SPLICE FROM(T1) TO(OUT) ON(1,10,CH) WITH(19,8)           
//CTL1CNTL DD *                                             
  OUTFIL FNAMES=T1,VTOF,BUILD=(37,4,X,5,5,9X,43,8)         
//CTL2CNTL DD *                                             
  OUTFIL FNAMES=T1,VTOF,BUILD=(19,4,X,25,5,X,70,8,8X)       
/*


The output file is FB and lrecl of 27

Code:

1234 AAAAA        3       1 
4567 BBBBB        5       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 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 TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top