View previous topic :: View next topic
|
Author |
Message |
senthilnathanj
New User
Joined: 31 Jul 2007 Posts: 47 Location: chennai
|
|
|
|
Hi,
My input file :
Code: |
1547186 4
1547224 5
1547232 13
1547232 -15
6677002 9
1547356 7
|
Output Format:
The first fields contains 9 digits and second field contains 10 digits including sign.
Code: |
001547186 000000004
001547224 000000005
001547232-000000002
006677002 000000009
001547356 000000007
000179617 000000007
000623598 000000005
000623644 000000005
|
Is it possible using SYNC sort.
FMT=FB,LRECL =80 for Input and Output File.
i am using SYNC SORT for Z/OS 1.3.1
Please advise!! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If you copy the file, you can use an edit mask to get the leading zeros. For the field than may contain a minus sign, you can specify this field as an SFF value and then use an edit mask to append the leading zeros.
If you get stuck, post what you have and where help is needed. Someone should be here. |
|
Back to top |
|
|
senthilnathanj
New User
Joined: 31 Jul 2007 Posts: 47 Location: chennai
|
|
|
|
Hi,
I have tried with the sort card, first fields is working fine.But,i don't know how to use the SFF format.
My Sort card is given below:
Code: |
//SYSIN DD *
SORT FIELDS=COPY,
INREC IFTHEN=(WHEN=INIT,
PARSE=(%01=(ENDBEFR=C',',FIXLEN=09),
%02=(ENDBEFR=C',',FIXLEN=10)),
BUILD=(%01,UFF,M11,LENGTH=09,X,
%02,SFF,EDIT=(STTTTTTTTT),LENGTH=10,X))
OUTFIL , BUILD=(1,9,10,10)
/*
|
I am getting Syntax error.
Please advise!!! |
|
Back to top |
|
|
senthilnathanj
New User
Joined: 31 Jul 2007 Posts: 47 Location: chennai
|
|
|
|
one more condition:
Remove the duplicate and sum the values..
Please help me.. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You don't need PARSE, as your data is in fixed positions.
8,x,SFF where x is the length of your field will get you the input.
You also seem to want leading zeros on the other number. That you can just pre-pend two zeros to.
You say you want to SUM (which will remove duplicates) but you need SORT, or you file to be pre-sequence and use MERGE. Yet your output is not in sequence.
Do you need the output in its original order, or can it be sorted (on anything)? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
And i did not notice before - why are there more lines of output than input? |
|
Back to top |
|
|
|