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

Conversion of Packed decimal field to Numeric field


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
DKartiya

New User


Joined: 30 Jan 2008
Posts: 26
Location: Chennai

PostPosted: Tue Feb 03, 2009 4:34 pm
Reply with quote

Hi,

Please let me know if we can have a PD field converted to Numeric data using SYNCSORT.

For Example: I have a file1 with the ff data
AA ---- PD field

I want to have an output file as
AA ---- Numeric data (Converted value of the PD field).

Thanks.

Regards,
Karthi
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 Feb 03, 2009 4:39 pm
Reply with quote

Hi,

It would be good if you show some sample input/output with the RECFM & LRECL of input output.

By the time you may searh the JCL & or DFSORT part of the forum as well - these things have been discussed many times before.
Back to top
View user's profile Send private message
DKartiya

New User


Joined: 30 Jan 2008
Posts: 26
Location: Chennai

PostPosted: Tue Feb 03, 2009 5:12 pm
Reply with quote

Hi,

I tried searching the forum. Am not able to find any matching results.

File1: LRECL is 10. First 2 bytes record type and the next 8 bytes is PD

AA--Packed data---

I want the output file as:
AA123456789012345 (Since PD of bytes is 15 bytes numeric data.)

So output file should be of 17 bytes.

Regards,
Karthi
Back to top
View user's profile Send private message
Shashank.kapoor

New User


Joined: 14 Jan 2009
Posts: 24
Location: Mumbai

PostPosted: Tue Feb 03, 2009 6:03 pm
Reply with quote

Hi,

Please find below the statement:
SORT FIELDS=COPY
OUTREC FIELDS=(1,2,3,3,PD,TO=ZD,LENGTH=5)

Below are the run details:
Input =>
Code:
aa..¬
88135
1124F


Syntax =>
Code:
SORT FIELDS=COPY                         
OUTREC FIELDS=(1,2,3,3,PD,TO=ZD,LENGTH=5)


Output =>
Code:
aa12345 


Hope this will help you out.

Please feel free to correct me if any thing you find in this.

-------------
Shashank
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 206
Location: Bangalore

PostPosted: Tue Feb 03, 2009 10:40 pm
Reply with quote

Hi Shashank,

Are you sure about the your job's output? Wont' the rightmost digit in the ZD field be displayed as Zoned (I mean because of overlapping sign, it should be coming as alphabet). If it is so, then it is not what the OP is expecting,

You can use the below control card of SORT
Code:

//SYSIN DD *
 SORT FIELDS=COPY
 OUTREC BUILD=(1,2,3,8,PD,EDIT=(IIIIIIIIIIIIIII),80:X)
/*



Please correct me if i am wrong.

Thanks,
Ajay
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Wed Feb 04, 2009 12:39 am
Reply with quote

Both Ajay's and Shashank's solutions should produce the desired output.
Back to top
View user's profile Send private message
DKartiya

New User


Joined: 30 Jan 2008
Posts: 26
Location: Chennai

PostPosted: Wed Feb 04, 2009 10:31 am
Reply with quote

Thanks. It works for me.

Checked on ICEMAN stuff and found that

DISPLAY can be used for the same functionality.

DISPLAY FROM(IN2) LIST(OUT2) ON(76,8,PD) ON(84,8,PD) ON(92,8,PD).

Thanks a lot for all the inputs !!

Regards,
Karthi
Back to top
View user's profile Send private message
Shashank.kapoor

New User


Joined: 14 Jan 2009
Posts: 24
Location: Mumbai

PostPosted: Wed Feb 04, 2009 11:02 am
Reply with quote

Good to see that it is working, thanks for letting us know. icon_smile.gif
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts 10 byte RBA conversion DB2 2
No new posts 10 byte RBA conversion -non applicati... JCL & VSAM 1
Search our Forums:

Back to Top