IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Numeric conversion in Syncsort


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 2481
Location: @my desk

PostPosted: Tue Dec 07, 2010 12:08 pm
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

Superior Member


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

PostPosted: Tue Dec 07, 2010 7:17 pm
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
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: 2481
Location: @my desk

PostPosted: Tue Dec 14, 2010 1:45 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts 10 byte RBA conversion DB2 2
No new posts 10 byte RBA conversion -non applicati... JCL & VSAM 1
No new posts file manager is doing string conversion IBM Tools 3
Search our Forums:

Back to Top