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
 

 

Syncsort: reformating records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
damuonmail

New User


Joined: 07 Mar 2005
Posts: 12

PostPosted: Wed Feb 27, 2008 3:39 am    Post subject: Syncsort: reformating records
Reply with quote

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
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed Feb 27, 2008 3:51 am    Post subject:
Reply with quote

This can be done by either sort, have you looked at a manual and the INFIL/OUTFIL FIELDS parameter?
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Wed Feb 27, 2008 4:16 am    Post subject:
Reply with quote

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
View user's profile Send private message
damuonmail

New User


Joined: 07 Mar 2005
Posts: 12

PostPosted: Wed Feb 27, 2008 8:17 pm    Post subject: Reply to: Syncsort: reformating records
Reply with quote

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
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Wed Feb 27, 2008 8:52 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Wed Feb 27, 2008 9:28 pm    Post subject:
Reply with quote

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
View user's profile Send private message
damuonmail

New User


Joined: 07 Mar 2005
Posts: 12

PostPosted: Wed Feb 27, 2008 9:52 pm    Post subject: Reply to: Syncsort: reformating records
Reply with quote

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
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Wed Feb 27, 2008 11:07 pm    Post subject:
Reply with quote

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
View user's profile Send private message
damuonmail

New User


Joined: 07 Mar 2005
Posts: 12

PostPosted: Thu Feb 28, 2008 12:45 am    Post subject: Reply to: Syncsort: reformating records
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Feb 28, 2008 12:52 am    Post subject:
Reply with quote

Could a UFF field be specified on input and an edited ZD field on output?
Back to top
View user's profile Send private message
socker_dad

Active User


Joined: 05 Dec 2006
Posts: 147
Location: Columbia, MO

PostPosted: Thu Feb 28, 2008 12:56 am    Post subject: Reply to: Syncsort: reformating records
Reply with quote

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
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Thu Feb 28, 2008 1:20 am    Post subject:
Reply with quote

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
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Thu Feb 28, 2008 1:22 am    Post subject: Re: Reply to: Syncsort: reformating records
Reply with quote

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
View user's profile Send private message
damuonmail

New User


Joined: 07 Mar 2005
Posts: 12

PostPosted: Thu Feb 28, 2008 1:43 am    Post subject: Reply to: Syncsort: reformating records
Reply with quote

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
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Thu Feb 28, 2008 1:56 am    Post subject: Re: Reply to: Syncsort: reformating records
Reply with quote

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
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Thu Feb 28, 2008 9:47 am    Post subject:
Reply with quote

damuonmail
Quote:
worked for me.

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm


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