View previous topic :: View next topic
|
Author |
Message |
NAGARJUN CARALAPATI
New User
Joined: 09 Oct 2007 Posts: 22 Location: chennai.India
|
|
|
|
Let me know how to include leading zeros in the output while using sort conditions.
Ex:
Input:
Code: |
REGP O000000031420071009
|
Expected output:
Code: |
REGP O000000031220071009
|
SORT condititon used by me:
Code: |
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(-2,ADD,12,10,ZD)
/*
|
Note: But i failed in getting my output correctly.
Could any one suggest me the right SORT CONDITION in achieving this Output ! |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
What does your incorrect output look like? |
|
Back to top |
|
|
NAGARJUN CARALAPATI
New User
Joined: 09 Oct 2007 Posts: 22 Location: chennai.India
|
|
|
|
My incorrect output look like below :
nothing more mentioned above is in my output. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Are you saying that
Code: |
REGP O000000031220071009 |
becomes
Does the 312 shift?
Or is it actually
Since you did not include the 1-11 and 22-end in the outrec, why would you expect them to be there?
As far as the leading zero suppression goes, that mask may be the default, what have you found in the manual? |
|
Back to top |
|
|
NAGARJUN CARALAPATI
New User
Joined: 09 Oct 2007 Posts: 22 Location: chennai.India
|
|
|
|
I didnt include the 1-11 and 22--- in the outrec knowingly.
I want only the '312' alone in the output but with leading Zeroes,i.e as given below.
0000000312 |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Have you looked at edit masks in the sort manual? |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Quote: |
OUTREC FIELDS=(-2,ADD,12,10,ZD)
|
What are you trying to do with the above SORT ccondition? What is the need for starting from 12th position?
Do post your requirement clearly. Leading Zeroes can be added using Proper EDIT MASKS. We would be able to help if you post your requirement clearly. |
|
Back to top |
|
|
NAGARJUN CARALAPATI
New User
Joined: 09 Oct 2007 Posts: 22 Location: chennai.India
|
|
|
|
No i didnt look at, could you tell me where the SORT manuals are ? |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Nagarjun,
You may use the following -
Code: |
----+----1----+----2----+----3----+----4----+----5----+
***************************** Top of Data *************
//SORTIN DD *
REGP O000000031420071009
REGP O000000031220071009
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTREC FIELDS=(12,10,ZD,SUB,+2,EDIT=(TTTTTTTTTT))
/* |
OP as expected. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Murali,
Quote: |
OUTREC FIELDS=(12,10,ZD,SUB,+2,EDIT=(TTTTTTTTTT))
|
Guess we need to add few more T's in the EDIT MASK.
Code: |
OUTREC FIELDS=(12,10,ZD,SUB,+2,EDIT=(TTTTTTTTTTTTTTT))
|
output:
Code: |
000000031420069
000000031220069
|
5 leading zeroes were not displayed as per your sort card. |
|
Back to top |
|
|
NAGARJUN CARALAPATI
New User
Joined: 09 Oct 2007 Posts: 22 Location: chennai.India
|
|
|
|
Thanks a lot. The above mentioned SORT condition is working exactly. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Aaru,
Nagarjun wanted OP in the above format. Refer 5th post in this topic. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Nagarjuna,
You can also use the available edit mask in the sort card.
Code: |
OUTREC FIELDS=(12,10,ZD,SUB,+2,M11,LENGTH=15)
|
The output is the same. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
murali,
Quote: |
Nagarjun wanted OP in the above format. Refer 5th post in this topic. |
Yes, when i ran the jcl with the code that you had posted the output was
Code: |
0031420069
0031220069
|
and not
Code: |
000000031420069
000000031220069
|
Please let me know if your output is different from the one that i have pasted above. |
|
Back to top |
|
|
NAGARJUN CARALAPATI
New User
Joined: 09 Oct 2007 Posts: 22 Location: chennai.India
|
|
|
|
Aaru,
Thanks !! even this condition is working fine. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Aaru,
Code: |
----+----1----+----2----+----3----+----4----+----5---
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD *
REGP O000000031420071009
REGP O000000031220071009
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTREC FIELDS=(12,10,ZD,SUB,+2,EDIT=(TTTTTTTTTT))
/* |
Try now. I had used QUOTE tag instead of CODE tag in my previous post. Because of which you have not got proper alignment. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Murali,
I tried again with the code posted in your last post and the output that i got is
Code: |
0031420069
0031220069
|
Could you please post the output that you had got by executing the JCL? Has this got something to do with the version? |
|
Back to top |
|
|
|