View previous topic :: View next topic
|
Author |
Message |
puneetvirmani143
New User
Joined: 24 Jul 2007 Posts: 55 Location: noida
|
|
|
|
Hi All
I have a o/p file of 885 LRECL (VB format) having 2 alphanumeric fields of X(1) say 1 at position 591 and 2nd at position 798 and another 1 field of pic clause 9(5).9(2) at position 649-656.
Now the requirement is If in the file the field at 591 position holds value '8' and 798 pos holds value 'R' then the third field (at pos 649-656) value should be divided by 100.
Can this be done through DFSORT or ICETOOL. If yes could you please provide me the syntax for it. Please let me know if anything else is required.
Thanks in advance.
Regards
Puneet |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Yes, but you have to do a better job of explaining what you want for output before I can show you how to do it.
Are these valid examples of the 9(5).9(2) values?
12345.12
98765.92
What output would you want when these are divided by 100?
00123.45
00987.65
or something else - what?
Do the positions you mentioned (e.g. 591) include the RDW in 1-4 of the VB record, or do we need to add 4 to them (e.g. 595)? |
|
Back to top |
|
|
puneetvirmani143
New User
Joined: 24 Jul 2007 Posts: 55 Location: noida
|
|
|
|
Hi Frank
Thanks for the reply. Below mentioned examples by you for 9(5).9(2) values are valid.
12345.12
98765.92
It would be great if I can get the syntax for the codes getting the below o/p value for field.
1. 00123.45 as mentioned by you.
2. 123.4512 which is the actual value getting after the divide by 100.
Please let me know if any thing else is required.
Regards
Puneet |
|
Back to top |
|
|
puneetvirmani143
New User
Joined: 24 Jul 2007 Posts: 55 Location: noida
|
|
|
|
Hi Frank
Missed to add 1 thing in above post that the 4 bytes would be added in the above mentioned field . For Eg. field at 591 position would be condidered at 595. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Dividing by 100 is pretty easy. You really don't even have to divide ... you just need to manipulate the fields.
If you want the result to be 00123.45, you can use these DFSORT control statements:
Code: |
OPTION COPY
INREC IFTHEN=(WHEN=(595,1,CH,EQ,C'8',AND,802,1,CH,EQ,C'R'),
OVERLAY=(653:653,5,UFF,EDIT=(00TTT.TT)))
|
If you want the result to be 123.4512, you can use these DFSORT control statements:
Code: |
OPTION COPY
INREC IFTHEN=(WHEN=(595,1,CH,EQ,C'8',AND,802,1,CH,EQ,C'R'),
OVERLAY=(653:653,8,UFF,EDIT=(TTT.TTTT)))
|
|
|
Back to top |
|
|
puneetvirmani143
New User
Joined: 24 Jul 2007 Posts: 55 Location: noida
|
|
|
|
Hi Frank
Thanks for the reply. There is a slight change in requirement. The field at 653 position should be divided by 100 but the o/p should be displayed in format 9(2).((5) . For example if the value in field is 00030.00, the o/p value should be 00.30000 and if the value is 01000.00 the value should be 10.00000.
Please let me know the syntax of control statement in this case.
Thanks in advance
Puneet |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Puneet,
This is the PERFECT oppurtunity for you to use your skills and figure this out.
Frank gave you two examples of formatting output.
Surely you can use them and figure this out on your own.
But alas Frank will come to the rescue with the answer.
PS - My ten year old son can figure this one out. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Dave,
Please do have your 10 year old son respond with the answer. (I'd get one my pet rats to do it, but they're busy working on a new theory of relativity.)
Thanks. |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
He is still in school until 3:30 eastern time.
He also does not have DFSORT installed on his MAC.
Puneet is on his own. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
A good opportunity for you to show him how to use the mainframe if you have access from home. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Puneet,
Compliments of my pet rat Nora, who took a few minutes to figure it out during her lunch break.
Code: |
OPTION COPY
INREC IFTHEN=(WHEN=(595,1,CH,EQ,C'8',AND,802,1,CH,EQ,C'R'),
OVERLAY=(653:654,7,UFF,EDIT=(TT.TTTT),C'0'))
|
|
|
Back to top |
|
|
puneetvirmani143
New User
Joined: 24 Jul 2007 Posts: 55 Location: noida
|
|
|
|
Hi Frank/All
Thanks for all your support. The Sort card provided by you worked successfully.
1 more requirement is added to this. Now by using above SORT card, field at position 653 has been changed for records in o/p gdg version.
My requirement is to compare the particular field at pos 653 of both i/p and o/p gdg versions and report the records having differences in sysout or a pds.
Please suggest if it could be done using Sort. By using utility IEBCOMP the complete files can be compared but i am not sure how to compare particular column.It would be great help if you provide the syntax for it. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I suspect you could do what you want with JOINKEYS, but you haven't given enough information for me to know exactly what it is you want to do.
For more information on JOINKEYS, see:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000174
If you need more specific help, show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.
Also, run this job and show the //SYSOUT messages you receive, so I can see what level you're at:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
RECORD
//SORTOUT DD DUMMY
//SYSIN DD *
OPTION COPY
/*
|
|
|
Back to top |
|
|
|