View previous topic :: View next topic
|
Author |
Message |
sakreg
New User
Joined: 25 May 2006 Posts: 7
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
sakreg
New User
Joined: 25 May 2006 Posts: 7
|
|
|
|
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 |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
Frank
i think sakreg wants
Code: |
----+----1
095100000
|
to be editted as
.
Then Left justify this to get
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
sakreg
New User
Joined: 25 May 2006 Posts: 7
|
|
|
|
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 |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
Back to top |
|
|
|