|
View previous topic :: View next topic
|
| Author |
Message |
damuonmail
New User
Joined: 07 Mar 2005 Posts: 12
|
|
|
|
hi,
I had a problem. I need help from some body.
My input file (FB) is having the records in the following format
A,0030, aaaaaaaaa,EL,UNLF, ,22.30 ,A,20080222,
and I need to convert this to
A,0030, aaaaaaaaa,EL,UNLF, ,0000000000022.30,A,20080222,
Thius need to be done by Syncsort. Please help. |
|
| Back to top |
|
 |
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
| This can be done by either sort, have you looked at a manual and the INFIL/OUTFIL FIELDS parameter? |
|
| Back to top |
|
 |
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
damuonmail,
Assuming that you are simply adding 11 zeros at position 27, try this:
| Code: |
//STEP1 EXEC PGM=SORT
//SORTIN DD *
A,0030,AAAAAAAAA,EL,UNLF,,22.30,A,20080222,
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,26,11X'F0',27,17)
/* |
This job produced the following output:
| Code: |
| A,0030,AAAAAAAAA,EL,UNLF,,0000000000022.30,A,20080222, |
If this is not your requirement, then please provide additional details, including more specific examples of your input records and the expected output. |
|
| Back to top |
|
 |
damuonmail
New User
Joined: 07 Mar 2005 Posts: 12
|
|
|
|
Hi,
Thanks. But i did not given the fill file layout. Please see below
| Code: |
Command ===> Scroll ===> CSR
****** ***************************** Top of Data ******************************
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
000001 A,0030, 218158984,EL,UNLF, ,22.30 ,A,20080222,
000002 A,0030, 223062639,DI,STDP, ,9.36 ,A,20080222,
000003 A,0030, 227356464,EL,UNLF, ,9.08 ,A,20080222,
000004 A,0030, 237494013,EL,UNLF, ,53.32 ,A,20080222, |
What ever the above mentioned logig will work if we know the exact number of spaces. But in this case it tis different. Sorry for inconvience. |
|
| Back to top |
|
 |
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
| So for these 4 records, how should the output look? And is there really a space between 22.30 and ,A, in the input? |
|
| Back to top |
|
 |
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
| Ok. So now that you have provided the actual layout for the input records, how do you want the output? Should the field containing 22.30 be right justified up to the comma and filled with zeroes in the blank spaces to the left? |
|
| Back to top |
|
 |
damuonmail
New User
Joined: 07 Mar 2005 Posts: 12
|
|
|
|
| Code: |
IEW WBT.CHG.MOSES.CHGFILE.G0055V00 Columns 00001 00072
ommand ===> Scroll ===> CSR
***** ***************************** Top of Data ******************************
00001 A,0030, 218158984,EL,UNLF, ,0000000000022.30,A,20080222,
00002 A,0030, 223062639,DI,STDP, ,0000000000009.36,A,20080222,
00003 A,0030, 227356464,EL,UNLF, ,0000000000009.08,A,20080222, |
This should how the output should be |
|
| Back to top |
|
 |
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
Here is a SyncSort for z/OS 1.3 job that should give you the desired output:
| Code: |
//STEP1 EXEC PGM=SORT
//SORTIN DD DSN=INPUT.FILE
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC FIELDS=(1,42,43,16,JFY=(SHIFT=RIGHT),59,22)
OUTREC IFTHEN=(WHEN=(43,1,BI,EQ,X'40'),
OVERLAY=(43:C'0'),HIT=NEXT),
IFTHEN=(WHEN=(44,1,BI,EQ,X'40'),
OVERLAY=(44:C'0'),HIT=NEXT),
IFTHEN=(WHEN=(45,1,BI,EQ,X'40'),
OVERLAY=(45:C'0'),HIT=NEXT),
IFTHEN=(WHEN=(46,1,BI,EQ,X'40'),
OVERLAY=(46:C'0'),HIT=NEXT),
IFTHEN=(WHEN=(47,1,BI,EQ,X'40'),
OVERLAY=(47:C'0'),HIT=NEXT),
IFTHEN=(WHEN=(48,1,BI,EQ,X'40'),
OVERLAY=(48:C'0'),HIT=NEXT),
IFTHEN=(WHEN=(49,1,BI,EQ,X'40'),
OVERLAY=(49:C'0'),HIT=NEXT),
IFTHEN=(WHEN=(50,1,BI,EQ,X'40'),
OVERLAY=(50:C'0'),HIT=NEXT),
IFTHEN=(WHEN=(51,1,BI,EQ,X'40'),
OVERLAY=(51:C'0'),HIT=NEXT),
IFTHEN=(WHEN=(52,1,BI,EQ,X'40'),
OVERLAY=(52:C'0'),HIT=NEXT),
IFTHEN=(WHEN=(53,1,BI,EQ,X'40'),
OVERLAY=(53:C'0'),HIT=NEXT),
IFTHEN=(WHEN=(54,1,BI,EQ,X'40'),
OVERLAY=(54:C'0'),HIT=NEXT),
IFTHEN=(WHEN=(55,1,BI,EQ,X'40'),
OVERLAY=(55:C'0'),HIT=NEXT),
IFTHEN=(WHEN=(56,1,BI,EQ,X'40'),
OVERLAY=(56:C'0'),HIT=NEXT),
IFTHEN=(WHEN=(57,1,BI,EQ,X'40'),
OVERLAY=(57:C'0'),HIT=NEXT),
IFTHEN=(WHEN=(58,1,BI,EQ,X'40'),
OVERLAY=(58:C'0'))
/* |
|
|
| Back to top |
|
 |
damuonmail
New User
Joined: 07 Mar 2005 Posts: 12
|
|
|
|
Hi,
Our's is
SYNCSORT FOR Z/OS 1.2.3.0N
Its giving error at JFY
| Code: |
SORT FIELDS=COPY
INREC FIELDS=(1,42,43,16,JFY=(SHIFT=RIGHT),59,22)
* |
and the job is abending.
Thanks |
|
| Back to top |
|
 |
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
| Could a UFF field be specified on input and an edited ZD field on output? |
|
| Back to top |
|
 |
socker_dad
Active User

Joined: 05 Dec 2006 Posts: 177 Location: Seattle, WA
|
|
|
|
I checked my SyncSort Programmer's Manual version 1.2 and could not find a reference to JFY, SHIFT or RIGHT.
Maybe these are new for version 1.3? |
|
| Back to top |
|
 |
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
I hadn't thought of that. But something like this, or a variation might work:
| Code: |
//SYSIN DD *
SORT FIELDS=COPY
INREC FIELDS=(1,42,43,16,UFF,ZD,59,22)
OUTREC FIELDS=(1,42,44,13,C'.',57,24)
|
|
|
| Back to top |
|
 |
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
| socker_dad wrote: |
I checked my SyncSort Programmer's Manual version 1.2 and could not find a reference to JFY, SHIFT or RIGHT.
Maybe these are new for version 1.3? |
Yes. IFTHEN, BUILD and OVERLAY are supported in 1.2.1 and later. Support for PARSE, JFY, and SQZ were included in SyncSort for z/OS 1.3.0. |
|
| Back to top |
|
 |
damuonmail
New User
Joined: 07 Mar 2005 Posts: 12
|
|
|
|
Hi,
//SYSIN DD *
SORT FIELDS=COPY
INREC FIELDS=(1,42,43,16,UFF,ZD,59,22)
OUTREC FIELDS=(1,42,44,13,C'.',57,24)
worked for me. Thanks once again.
Could you plese explain what is this UFF? |
|
| Back to top |
|
 |
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
| damuonmail wrote: |
| Could you please explain what is this UFF? |
UFF is unsigned free format. Decimal digits (0-9) are extracted from right to left to form a number value. All non-decimal digit values in the field (such as the dot '.' in your example) are ignored. A maximum of 31 digits can be provided. When more than 31 digits are found in the field, the leftmost digits will be ignored. |
|
| Back to top |
|
 |
Devzee
Active Member
Joined: 20 Jan 2007 Posts: 684 Location: Hollywood
|
|
|
|
damuonmail
Just a note: The above code works only if there is two digits after dot.
Suppose if you have input like 13.2 then the output will be 1.32 |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|