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
 

 

Need help with converting 9(13)V9(3) to S9(13).9(5)-syncsort

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

New User


Joined: 11 Apr 2007
Posts: 10
Location: India

PostPosted: Tue Jan 08, 2008 3:19 pm    Post subject: Need help with converting 9(13)V9(3) to S9(13).9(5)-syncsort
Reply with quote

My input field is declared as 9(13)V9(3). Is there a possibility to convert this to a S9(13).9(5) field using the outrec statement (Product in use is Syncsort).
The input field is at offset 95 and the output field offset is 120.
Also, we are moving it to a signed variable only for consistency with someother file with which we would be merging this output file. But the input file value will always be positive.

So I could think of the below approach
Code:

OUTREC FIELDS=(120:C' ',
            121:95,13,       
            133:C'.',       
            134:108,3,     
            137:C'00')       


But i feel the above is too crude and just wanted to know if there is a better way to achieve this.
Back to top
View user's profile Send private message

krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Jan 08, 2008 3:44 pm    Post subject:
Reply with quote

Code:
//*******************************************************           
//STEP1    EXEC PGM=SORT                                           
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD *                                                     
         1234567890123123                                           
//SORTOUT  DD SYSOUT=*                                             
//SYSIN    DD *                                                     
           SORT FIELDS=COPY                                         
     OUTREC FIELDS=(20:10,16,ZD,EDIT=(STTTTTTTTTTTTT.TTT),SIGNS=(,))
/*                                                                 
                                                       

SORTOUT
Code:
                    1234567890123.123
Back to top
View user's profile Send private message
Samantha Chelikani

New User


Joined: 11 Apr 2007
Posts: 10
Location: India

PostPosted: Tue Jan 08, 2008 3:52 pm    Post subject:
Reply with quote

Hi Krisprems,
Thanks a lot.
But if the input is
Code:

1234567890123123

I need the output as (Yes i need the zeroes at the end)
Code:

1234567890123.12300
 

Also, if the input is
Code:

0000067890123123

I need the output as
Code:

0000067890123.12300

Can this be done?
Sorry for not making this clear in the first post. icon_redface.gif
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Jan 08, 2008 4:04 pm    Post subject:
Reply with quote

Code:
//*******************************************************             
//STEP1    EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD *                                                       
         1234567890123123                                             
         0000067890123123                                             
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD *                                                       
           SORT FIELDS=COPY                                           
 OUTREC FIELDS=(20:10,16,ZD,EDIT=(STTTTTTTTTTTTT.TTT),SIGNS=(,),C'000')
/*                                                                     


SORTOUT
Code:
                    1234567890123.123000
                    0000067890123.123000
Back to top
View user's profile Send private message
Samantha Chelikani

New User


Joined: 11 Apr 2007
Posts: 10
Location: India

PostPosted: Tue Jan 08, 2008 5:30 pm    Post subject:
Reply with quote

Thanks Krisprems... It worked....
I wanted only 5 digits after the decimal so i replaced
Code:

C'000')

with
Code:

C'00')
 
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Jan 08, 2008 6:07 pm    Post subject:
Reply with quote

Samantha Chelikani

Good that you found it yourself icon_wink.gif
Back to top
View user's profile Send private message
Samantha Chelikani

New User


Joined: 11 Apr 2007
Posts: 10
Location: India

PostPosted: Tue Jan 08, 2008 6:16 pm    Post subject:
Reply with quote

hmm.... well i thought i'd b considered reaaallly dumb if i couldnt figure atleast that out icon_biggrin.gif
Back to top
View user's profile Send private message
Samantha Chelikani

New User


Joined: 11 Apr 2007
Posts: 10
Location: India

PostPosted: Wed Jan 30, 2008 1:18 pm    Post subject:
Reply with quote

hi,

My requirement has now changed and they are going to send me the input field as S9(13)V999 COMP-3. I need to change this to S9(13).9(5). Can you please suggest me an outrec statement to achieve this.
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 205
Location: Bangalore

PostPosted: Wed Jan 30, 2008 5:15 pm    Post subject: Reply to: Need help with converting 9(13)V9(3) to S9(13).9(5
Reply with quote

Hi Samantha,

It requires a small modification to previous code. ZD needs to be replaced by PD and byte length will change to 9. S9(13)V999 COMP-3 requires 9 bytes.

//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=....
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(20:Startcol,9,PD,
EDIT=(STTTTTTTTTTTTT.TTT),SIGNS=(,),C'00')
/*


Let me know if it works.....


-Ajay
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 7 Sat Jan 21, 2017 4:02 am
This topic is locked: you cannot edit posts or make replies. DB2 query Using Recursion, Converting... smilewithashu2 DB2 3 Tue Jan 03, 2017 12:50 pm
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am


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