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
 

 

Unpacked to Packed Conversion - SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Unpacked to Packed Conversion - SORT
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 Moderator


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

PostPosted: Fri Jul 20, 2007 8:40 pm    Post subject:
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:

http://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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Fri Jul 20, 2007 11:04 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm


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