View previous topic :: View next topic
|
Author |
Message |
naveensrimf
New User
Joined: 04 Oct 2005 Posts: 34
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
|
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
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 |
|
|
|