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

Need help to Change character to Packed decimal


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jegan_selvan

New User


Joined: 23 Oct 2006
Posts: 24
Location: India

PostPosted: Tue Sep 15, 2009 5:01 pm
Reply with quote

Hi All,

Would be really thankful if any one gives me an idea to solve the issue. We are getting the file in Character format. The file is VB and Record length 256. The output file should be of variable format with same record length.

If 55 postion is 912 – it is header , 913 – detail and 914 remarks.

Code:
----+----6----+----7----+----8----+----9----+----0----+----1---
912AOH8000271HONIX80UD NWHONIX09245C00000C09246C Y09245C
91301MPC8343ZQAGDB 0789ZMQ83864 15-10277-02

For example : For 912 in postion 83 – 5 characters value should be changed to packed decimal (S9(5) COMP-3)
For 913 also I need to change with different position.

Could you please suggest me the sort card to perform this action.

Thanks in advance for your reply.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Tue Sep 15, 2009 9:33 pm
Reply with quote

Please use BBCode (see FAQ).
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Sep 15, 2009 9:42 pm
Reply with quote

jegan_selvan,

Use the following control cards. since you said your indicator starts at pos 55 and your input is a VB file, You need to account for the 4 byte RDW , so the actual position of the indicator is 59. Assuming that the following control cards will give you the desired results. It will convert the 5 bytes at pos 87 (83+4 rdw) to packed decimal format of 3 bytes as s9(5) comp3 is only 3 bytes and 2 spaces and for 913 type I chose randomly pos 94 (90+4 rdw)


Code:

//SYSIN    DD *                           
  SORT FIELDS=COPY                         
  INREC IFTHEN=(WHEN=(59,3,CH,EQ,C'912'),   
  OVERLAY=(87:87,5,ZD,PD,LENGTH=3,2x)),       
  IFTHEN=(WHEN=(59,3,CH,EQ,C'913'),         
  OVERLAY=(94:94,5,ZD,PD,LENGTH=3,2x))       
/*
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
No new posts 3270 personal communications. Can't c... TSO/ISPF 2
No new posts SELECT from data change table DB2 5
Search our Forums:

Back to Top