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
 

 

Get the records in sequential order from fixed file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Get the records in sequential order from fixed file
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    Post subject: Reply to: Get the records in sequential order from fixed fil
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:

http://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    Post subject:
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: 1703
Location: Australia

PostPosted: Wed Mar 28, 2012 3:20 pm    Post subject:
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    Post subject:
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: 80
Location: Australia

PostPosted: Thu Mar 29, 2012 4:47 pm    Post subject:
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

http://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    Post subject:
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:

http://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    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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Order BY AND Index Nileshkul DB2 2 Sat Dec 31, 2016 6:33 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm


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