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
 

 

Convert numeric to packed decimal using SORT

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

New User


Joined: 23 Feb 2007
Posts: 25
Location: Dallas, TX

PostPosted: Thu Apr 12, 2007 2:25 am    Post subject: Convert numeric to packed decimal using SORT
Reply with quote

I have 3 kinds of records in my file - type 10, type 20 and type 30. Type of record is present in the first 2 bytes of the record. I have a single type 30 record that contains a numeric of 8 bytes with leading zeros compressed starting from position 3 till position 10 in the record. My task is to convert this 8 byte numeric field into a packed decimal of 5 bytes, thats S9(9) comp-3. I just need to convert the type 30 record. The remaining type 10 and type 20 records need not be converted. I would prefer to use sort (PGM=SORT) if possible.

Thanks in advance !

Sample data in the file looks like:

Code:

101999-12-30-23.38.22.113649 
205319390000001016       DV ....NN   
209000001360121007       BP ....YN   
206111210000001014       BP ....YN   
30     104                           
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Apr 12, 2007 2:52 am    Post subject:
Reply with quote

Here's a DFSORT job that will do what you asked for. Since you're going from an 8-byte field to a 5-byte field, I overlaid 3 blanks after the 5-byte field.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB)
//SORTOUT DD DSN=... output file (FB))
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=(1,2,CH,EQ,C'30'),
    OVERLAY=(3:3,8,FS,TO=PD,LENGTH=5,3X))
/*
Back to top
View user's profile Send private message
tarunbhardwajleo

New User


Joined: 23 Feb 2007
Posts: 25
Location: Dallas, TX

PostPosted: Thu Apr 12, 2007 3:12 am    Post subject:
Reply with quote

Hi Frank,

Thanks for the reply... Iam sorry, I forgot to mention that our shop doesn't have DFSORT. Can we use the same code using PGM=SORT ? But in that case I think that the overlay parameters might vary.....
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Apr 12, 2007 4:14 am    Post subject:
Reply with quote

Quote:
Can we use the same code using PGM=SORT ?


PGM=SORT or PGM=ICEMAN invoke the sort product at your site (DFSORT, Syncsort, CA-SORT).

I don't know if this will work with Syncsort. I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.
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 Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts Convert current to hex value gopurs DFSORT/ICETOOL 4 Wed Feb 15, 2017 5:40 am


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