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

Unpacked to Packed Conversion - SORT


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

New User


Joined: 25 May 2006
Posts: 7

PostPosted: Fri Jul 20, 2007 4:44 pm
Reply with quote

Hi,

I have a file similar to below

Code:

EA1983-01-011983-03-310951000000001-01-01
EA1983-04-011983-06-300992000000001-01-01
EA1983-07-011983-09-301017000000001-01-01
EA1983-10-011983-12-311042000000001-01-01
EA1984-01-011984-03-311042000000001-01-01


From position 23, there is a 10 position numeric characters (0951000000). This is Unpacked.

I want to get the above file in the following format

Code:

EA1983-01-011983-03-3195.1  0001-01-01
EA1983-04-011983-06-3099.2  0001-01-01
EA1983-07-011983-09-30101.7 0001-01-01
EA1983-10-011983-12-31104.2 0001-01-01
EA1984-01-011984-03-31104.2 0001-01-01


Basically I am trying for Unpacked to Packed Conversion, but not sure what goes in OUTREC in the below JCL

Code:

//SORT01   EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DSN=IPFILE1,DISP=SHR                       
//SORTOUT  DD DSN=OPFILE1,                       
//         DISP=(,CATLG,DELETE),                                       
//         SPACE=(TRK,(20,2),RLSE)                 
//SYSIN    DD *                                                         
  OPTION COPY                                                     
  OUTREC FIELDS=?!?!?!?
/*


Thanks for your time.
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: Fri Jul 20, 2007 8:40 pm
Reply with quote

You can use a DFSORT OUTREC statement like this. I assumed you wanted a 6-byte PD output field. If not, change LENGTH=6 to whatever you want.

Code:

   OUTREC BUILD=(1,22,
        23,10,ZD,TO=PD,LENGTH=6,
        32,10)


For more information on converting numeric fields with DFSORT, see:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CG20/2.4.7?DT=20060615173822
Back to top
View user's profile Send private message
sakreg

New User


Joined: 25 May 2006
Posts: 7

PostPosted: Fri Jul 20, 2007 9:45 pm
Reply with quote

I tried your solution, seeing some juck characters in the packed decimal position. I do believe, that I am fine.

For E.G., 095100000 is NOT showing as 95.1 in the output file. Is there a way I can do a HEX ON or something that can help me to intepret the values manually?

Thank You
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Jul 20, 2007 10:29 pm
Reply with quote

Frank
i think sakreg wants
Code:
----+----1
095100000
to be editted as
Code:
IIT.TIIIII
.
Then Left justify this to get
Code:
----+----1
95.1     
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: Fri Jul 20, 2007 11:04 pm
Reply with quote

Krisprems,

Oh, I guess you're right. I saw "Packed" and immediately thought PD. I've never heard anyone call what sakreg wants "packed". Thanks for pointing that out.

sakreg,

Let's try this again. You can use a DFSORT OUTREC statement like this:

Code:

  OUTREC IFTHEN=(WHEN=INIT,
    BUILD=(1,22,
     23:23,4,ZD,EDIT=(IIT.T),
     29:32,10)),
   IFTHEN=(WHEN=INIT,
     OVERLAY=(23:23,5,JFY=(SHIFT=LEFT)))


If that's not what you want, then please explain more clearly with a better example what you do want.
Back to top
View user's profile Send private message
sakreg

New User


Joined: 25 May 2006
Posts: 7

PostPosted: Mon Jul 23, 2007 2:41 pm
Reply with quote

Frank Yaeger,

PERFECT ! As expected .... Thanks a Lot. OUTREC features are doing lot of wonders. If you can show me some handly self illustrating material to study all the possible OUTREC add-on commands that would be really helpful.

Thankyou for your time.

Krisprems,
Thanks for your time to make things straight.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon Jul 23, 2007 5:14 pm
Reply with quote

sakreg
start your learning with this excellent tutorial z/OS DFSORT: Getting Started (April, 2006) and also other DFSORT books at
http://www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon Jul 23, 2007 5:35 pm
Reply with quote

sakreg
also you can look at http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ice1ca20/3.14?ACTION=MATCHES&REQUEST=INREC,OUTREC&TYPE=FUZZY&SHELF=ICE1SH20.bks&DT=20060615185603&CASE=&searchTopic=TOPIC&searchText=TEXT&searchIndex=INDEX&rank=RANK&ScrollTOP=FIRSTHIT#FIRSTHIT&PICTORIAL=N for OUTREC in detail
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 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 JCL sort card - get first day and las... JCL & VSAM 9
No new posts 10 byte RBA conversion DB2 2
No new posts 10 byte RBA conversion -non applicati... JCL & VSAM 1
Search our Forums:

Back to Top