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

Get the records in sequential order from fixed file


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

New User


Joined: 04 Mar 2010
Posts: 38
Location: DC

PostPosted: Tue Mar 27, 2012 5:32 pm
Reply with quote

Hi,

Could anyone please help me on this requirement?

Input File Length - 80 bytes - Fixed
Output File will also be the same 80 bytes FB

Sample input file is given below.

Code:

45213820 ANDERSON   20145248 JAMES      44758321 KALLIS       
$£"      JUNK       47518932 HARRIS     ^%$(%£   JUNK         
£$$      JUNK                                                 
84215677 PATTERSON  ^%$      JUNK                             
)!"      JUNK       21478221 FORREST                         
82144525 CLARKE     $£!      JUNK       24805789 STEYN       
45213820 BROAD       


    Key field starts at first 8 bytes Numeric value.
    Each proper record is 20 bytes length. So another key field can start only at 21st or 41st or 61st in a single row.
    Each row may contain more than 1 proper record(20 bytes max) but upto 4 proper records.
    Each row in the input file may contain maximum of 4 key fields or 3 or 2 or 1 or nothing.
    Key fields start with special characters or anything other than numeric can be excluded from that row.


Here is the sample output file

Code:

45213820 ANDERSON 
20145248 JAMES     
44758321 KALLIS   
47518932 HARRIS   
84215677 PATTERSON
21478221 FORREST   
82144525 CLARKE   
24805789 STEYN     
45213820 BROAD     
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue Mar 27, 2012 9:03 pm
Reply with quote

Alexis Sebastian,

With z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026 (Oct,2010), you can now use the new RESIZE operator of DFSORT's ICETOOL to easily create larger records from smaller records, or smaller records from larger records.

Use the following DFSORT/ICETOOL JCL which will give you the desired results.

Code:

//STEP0100 EXEC PGM=ICETOOL                               
//TOOLMSG  DD SYSOUT=*                                     
//DFSMSG   DD SYSOUT=*                                     
//IN       DD *                                           
----+----1----+----2----+----3----+----4----+----5----+----
45213820 ANDERSON   20145248 JAMES      44758321 KALLIS   
$£"      JUNK       47518932 HARRIS     ^%$(%£   JUNK     
£$$      JUNK                                             
84215677 PATTERSON  ^%$      JUNK                         
)!"      JUNK       21478221 FORREST                       
82144525 CLARKE     $£!      JUNK       24805789 STEYN     
45213820 BROAD                                             
//OUT      DD SYSOUT=*                                     
//TOOLIN   DD *                                           
  RESIZE FROM(IN) TO(OUT) TOLEN(20) USING(CTL1)           
//CTL1CNTL DD *                                           
  OPTION COPY                                             
  OUTFIL FNAMES=OUT,INCLUDE=(1,8,FS,EQ,NUM),OVERLAY=(80:X)
//*


The output from this job is
Code:

45213820 ANDERSON   
20145248 JAMES       
44758321 KALLIS     
47518932 HARRIS     
84215677 PATTERSON   
21478221 FORREST     
82144525 CLARKE     
24805789 STEYN       
45213820 BROAD       

For complete details on the new functions for DFSORT and DFSORT's ICETOOL available with the Oct, 2010 PTF, see:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000242
Back to top
View user's profile Send private message
Alexis Sebastian

New User


Joined: 04 Mar 2010
Posts: 38
Location: DC

PostPosted: Wed Mar 28, 2012 2:48 pm
Reply with quote

Many thanks for your help and its working fine.

Its created multiple shorter records from the larger record input file(fixed length).

I would like to know whether this will work out for the below case as well?

Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
DGQ%&"£!20145248 JAMES      %$£!44758321 KALLIS     (*%^51247620 GILLI 
$£"     47518932 HARRIS     ^%$(!^£%&$($                82301575 PUNTER
£$$      JUNK                                                           
%$)&**( 84215677 PATTERSON  ^%$ $%"F JUNK                               
)!"     21478221 FORREST    ^%"£10587412 RICKY                         
$£$)$%$*£$%$£%              %£*%£)($_$%_            $&"£24805789 STEYN 
£)$&$)"_DKD                 ("&£45213820 BROAD                         



    Here every proper record starts at 9th position with length of 20 bytes.
    From 29th position (i.e end of first proper record) to 32nd pos (length 4 bytes) are junk values and so next proper record will start 4 bytes later than the previuos proper record.
    Next proper record starts at 33 and another one starts at 57.
    Each proper record's length is 20 bytes.


Sample output
Code:

20145248 JAMES   
44758321 KALLIS   
51247620 GILLI   
47518932 HARRIS   
82301575 PUNTER   
84215677 PATTERSON
21478221 FORREST 
10587412 RICKY   
24805789 STEYN   
45213820 BROAD   


Thanks in advance.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Mar 28, 2012 3:20 pm
Reply with quote

Hi,

try this
Code:
//S1       EXEC PGM=ICETOOL                                             
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//IN       DD *                                                         
DGQ%&"£!20145248 JAMES      %$£!44758321 KALLIS     (*%^51247620 GILLI 
$£"     47518932 HARRIS     ^%$(!^£%&$($                82301575 PUNTER
£$$      JUNK                                                           
%$)&**( 84215677 PATTERSON  ^%$ $%"F JUNK                               
)!"     21478221 FORREST    ^%"£10587412 RICKY                         
$£$)$%$*£$%$£%              %£*%£)($_$%_            $&"£24805789 STEYN 
£)$&$)"_DKD                 ("&£45213820 BROAD                         
//OUT      DD SYSOUT=*                                                 
//TOOLIN   DD *                                                         
RESIZE FROM(IN) TO(OUT) TOLEN(020) USING(CTL1)                         
//CTL1CNTL DD *                                                         
  INREC BUILD=(9,20,33,20,57,20)                                       
  OUTFIL FNAMES=OUT,INCLUDE=(1,8,FS,EQ,NUM),OVERLAY=(80:X)             
/*



Gerry
Back to top
View user's profile Send private message
Alexis Sebastian

New User


Joined: 04 Mar 2010
Posts: 38
Location: DC

PostPosted: Thu Mar 29, 2012 2:21 pm
Reply with quote

It works as expected.

Many thanks for your help.

I would like to learn more about data format like FS - Floating Sign, etc.. and its usage. Please guide.
Back to top
View user's profile Send private message
charanmsrit

New User


Joined: 25 Oct 2007
Posts: 81
Location: Australia

PostPosted: Thu Mar 29, 2012 4:47 pm
Reply with quote

Hi Alex,
refer to the link below for DFSORT data formats. if you navigate a lil bit further, there is info about DFSORT format for COBOL data types

publib.boulder.ibm.com/infocenter/zos/v1r12/topic/com.ibm.zos.r12.icea100/ice1ca50305.htm#wq1448


Regards,
Charan
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Thu Mar 29, 2012 8:54 pm
Reply with quote

Alexis Sebastian wrote:
It works as expected.

Many thanks for your help.

I would like to learn more about data format like FS - Floating Sign, etc.. and its usage. Please guide.


Alexis Sebastian,

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080
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 FTP VB File from Mainframe retaining ... JCL & VSAM 4
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top