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
 

 

Numeric conversion in Syncsort

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

Active User


Joined: 05 Jan 2007
Posts: 101
Location: chennai (India)

PostPosted: Fri Dec 03, 2010 7:01 pm    Post subject: Numeric conversion in Syncsort
Reply with quote

I'm have a delimited input file.
Code:

GTURO|BPH|0002400000312|EQUALIZE||CUR|0.250|XPO
GTURO|BPH|0002400000313|EQUALIZE||CUR|0.250|XPO
GTURO|BPH|0002400000310|EQUALIZE||CUR|0.250|XPO
GTURO|BPH|0002400000311|EQUALIZE||CUR|0.250|XPO

and my desired output is

Code:

GTURO     BPH0002400000312          EQUALIZE  CUR       00025{XPO
GTURO     BPH0002400000313          EQUALIZE  CUR       00025{XPO
GTURO     BPH0002400000310          EQUALIZE  CUR       00025{XPO
GTURO     BPH0002400000311          EQUALIZE  CUR       00025{XPO


My current sort looks like this:

Code:

  SORT FIELDS=COPY,SKIPREC=1
  OUTREC PARSE=(%01=(ENDBEFR=C'|',FIXLEN=10),
    %02=(ENDBEFR=C'|',FIXLEN=3),
    %03=(ENDBEFR=C'|',FIXLEN=13),
    %04=(ENDBEFR=C'|',FIXLEN=8),
    %05=(ENDBEFR=C'|',FIXLEN=3),
    %06=(ENDBEFR=C'|',FIXLEN=3),
    %07=(ENDBEFR=C'|',FIXLEN=6),
    %08=(ENDBEFR=C'|',FIXLEN=3)),
  BUILD=(01:%01,JFY=(SHIFT=LEFT),
    11:%02,JFY=(SHIFT=LEFT),
    14:%03,JFY=(SHIFT=LEFT),
    27:%05,JFY=(SHIFT=LEFT),
    37:%04,JFY=(SHIFT=LEFT),
    47:%06,JFY=(SHIFT=LEFT),
    57:%07,JFY=(SHIFT=LEFT),
    63:%08,JFY=(SHIFT=LEFT),66:10X),CONVERT


Thanks
Trinadh


Edited: Please use BBcode when You post some code/error, that's rather readable, Thanks... Anuj
Back to top
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2180
Location: @my desk

PostPosted: Tue Dec 07, 2010 12:08 pm    Post subject:
Reply with quote

bodatrinadh,

Your sample input data fields seem to be at fixed positions though it is delimited. Is it true for all the records? If yes, then you might not need a PARSE and JFY as shown in your sort card.

You have n't mentioned what problem you are facing. Also it will be better if you post your input and output file attributes and the conversion rules required for numeric fields.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Dec 07, 2010 7:17 pm    Post subject:
Reply with quote

Also, when I alligend your input/output - it shows up the way it's inthe first post - was not sure if you really needed those many "spaces" between fields... but you never objected...icon_confused.gif

Also looks like the only numeric conversion you had is multiplying these fields
Code:
0.250
0.250
0.250
0.250
by 1000 and convert them to ZD?
Back to top
View user's profile Send private message
bodatrinadh

Active User


Joined: 05 Jan 2007
Posts: 101
Location: chennai (India)

PostPosted: Tue Dec 14, 2010 1:06 pm    Post subject: Reply to: Numeric conversion in Syncsort
Reply with quote

Hello Anuj,

Spaces are not the constraint. My only target is to covert 0.250 value to a equivalent ZD value by using sort card which i mentioned earlier. I'm just replacing SAS program to a simple SORT program (Sync Sort ).

Thanks
Trinadh
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2180
Location: @my desk

PostPosted: Tue Dec 14, 2010 1:45 pm    Post subject:
Reply with quote

bodatrinadh,
Quote:
Your sample input data fields seem to be at fixed positions though it is delimited. Is it true for all the records?
What about this? Why do you need a PARSE and JFY?
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 Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts Conversion of a VB file to FB. isssal DFSORT/ICETOOL 1 Mon Oct 31, 2016 10:23 pm


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