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
 

 

Problem in converting Comp-3 to readable format

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

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Fri Feb 29, 2008 7:18 pm    Post subject: Problem in converting Comp-3 to readable format
Reply with quote

Hi,

I saw the older forums for converting comp-3 to readable format.
But i got a problem in output.

The input file viewed in FILE MASTER

C 2 C 2 P 3 P 5
-- -- +-- --1--
DA RF 8059 10546636
DA RF 8059 30486636
DA RF 8059 36321277
DA RF 8059 76702907
DA RF 8059 82604141
DA RF 8059 106605002

Layout:
02 RF-CD-TRAN PIC XX.
02 RF-CD-RPT PIC XX.
02 RF-DT-TRAN PIC 9(5) COMP-3.
02 RF-ID-SSN PIC 9(9) COMP-3.

I tried to convert the field RF-ID-SSN into readable format by using
the following sort card.

SORT FIELDS=COPY
OUTREC FIELDS=(7,5,PD,EDIT=(TTTTTTTTT))

But i got the following output which i was not expected.

----+----1----
9 1054663
9 3048663
9 3632127
9 767029
9 826041
1066050

Expected result:
----+----1----
010546636
030486636
036321277
076702907
082604141
106605002

Please help me for the correct sort card.
Back to top
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri Feb 29, 2008 7:27 pm    Post subject:
Reply with quote

Why 7, that is the last byte of RF-DT-TRAN, isn't it?
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: Fri Feb 29, 2008 10:19 pm    Post subject:
Reply with quote

karthikr44,

CICS guy is right that you have the position wrong:

Code:

1     3      5     8             <---- POSITION
C 2   C 2    P 3   P 5


So your OUTREC statement should be:

Code:

  OUTREC FIELDS=(8,5,PD,EDIT=(TTTTTTTTT))


That gives the results you want.

DFSORT Symbols would probably help here:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD *
RF-CD-TRAN,1,2,CH
RF-CD-RPT,*,2,CH
RF-DT-TRAN,*,3,PD
RF-ID-SSN,*,5,PD
/*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  OUTREC FIELDS=(RF-ID-SSN,EDIT=(TTTTTTTTT))
/*
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Sat Mar 01, 2008 3:39 pm    Post subject: Reply to: Problem in converting Comp-3 to readable format
Reply with quote

HI,

Very thanks for ur help.
Now it is working.

Regards
R.Karthik
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm
No new posts Strings with double quotes having pro... raja Arumugam All Other Mainframe Topics 11 Thu Mar 30, 2017 10:34 am
No new posts How to pick only YYMMDD from DATE1P (... atulbaviskar SYNCSORT 7 Wed Mar 22, 2017 11:39 am
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm


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