Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Conversion of Packed decimal field to Numeric field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Conversion of Packed decimal field to Numeric field
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

Senior Member


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

PostPosted: Tue Feb 03, 2009 4:39 pm    Post subject:
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    Post subject: Reply to: Conversion of Packed decimal field to Numeric fiel
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    Post subject:
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: 205
Location: Bangalore

PostPosted: Tue Feb 03, 2009 10:40 pm    Post subject: Reply to: Conversion of Packed decimal field to Numeric fiel
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: 500
Location: USA

PostPosted: Wed Feb 04, 2009 12:39 am    Post subject:
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    Post subject: Reply to: Conversion of Packed decimal field to Numeric fiel
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    Post subject:
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    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 Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us