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

Sort card required for the CSV file


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

New User


Joined: 04 Oct 2005
Posts: 34

PostPosted: Fri Aug 02, 2013 10:01 pm
Reply with quote

My input file CSV file is as below

Code:
Input  (<Client Number>.<Order Number>
-----------------------------------------------
123456789123.0
123456789143.712346789
123457.0
123456890.123456789
67456.123456789
456789123.134567891


My Output file
-------------
Code:
Clinet Number(20 Bytes)  Order number (9 Bytes)
----------------------------   ----------------------------

123456789123               000000000
123456789143               712346789
123457                          000000000
123456890                     123456789
67456                            123456789
456789123                     134567891


I need sort card for this by using parse.

Code'd
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Aug 02, 2013 10:45 pm
Reply with quote

Can you show what you have tried and the problem you encountered? The Control Cards and the sysout from the step, please.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Fri Aug 02, 2013 11:34 pm
Reply with quote

naveensrimf,


I believe the DOT you show in your input is actually a TAB character which is X'05' ,so you need to use parse with ENDBEFR=X'05' and it should be a walk in the park after that.
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Mon Aug 05, 2013 11:20 am
Reply with quote

You can check the HEX VALUE of the delimiter and use parse with ENDBEFR..whether it's a period or tab..

You can use the below sort card to achieve that:

SORT Job:
Code:
//STEP01   EXEC PGM=SORT                   
//SORTIN   DD *                             
123456789123 0                             
123456789143 712346789                     
123457 0                                   
123456890 123456789                         
67456 123456789                             
456789123 134567891                         
//SORTOUT  DD SYSOUT=*                     
//SYSOUT   DD SYSOUT=*                     
//SYSIN    DD *                             
 OPTION COPY                               
 INREC PARSE=(%00=(ENDBEFR=X'05',FIXLEN=20),
              %01=(FIXLEN=09)),             
 BUILD=(%00,%01)                       
/*                                         


Output:
Code:
----+----1----+----2----+----
*****************************
123456789123        0       
123456789143        712346789
123457              0       
123456890           123456789
67456               123456789
456789123           134567891
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 2
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
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
Search our Forums:

Back to Top