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

Convert numeric to packed decimal using SORT


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Thu Apr 12, 2007 2:52 am
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
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 Developer


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

PostPosted: Thu Apr 12, 2007 4:14 am
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 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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top