|
View previous topic :: View next topic
|
| Author |
Message |
rexx77
New User
Joined: 14 Apr 2008 Posts: 78 Location: Mysore
|
|
|
|
Folks,
Went through the forum , i am not finding a solution for the below issue. Appreciate your inputs.
Issue:
I have a data set(6067 LRECL) which has Zonal decimal form 'Numerical' present from 32 position, length =32. I am planning to trim the leading and trailing spaces from this numeric field and would like to make it 9(5)V9(11) and write to a data set along with other fields.
1. I used Overlay function to trim the spaces, like below. Output data set does not have any values from the input file after 32 position. Not sure what is wrong.
Input file field:
| Code: |
-3----+----4----+----5----+----6---
+0.00000000000
-01 +1.00000000000
|
| Code: |
INREC OVERLAY=(1,31,
32,32,SQZ=(SHIFT=LEFT,MID=X'40'),
64,6003)
|
Tried with another possible overlay also. Output data set has 'Numerical value' from position 1.
| Code: |
INREC IFTHEN=(WHEN=INIT,
OVERLAY=(32,32,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'"',LENGTH=16)))
|
In a nutshell, I would like to move 1,31, Reformat(32,32 ->to length=16), copy remaining fields from input to output data set.
For your reference , below is the complete OUTREC statement.
| Code: |
OUTREC FIELDS=(1:1,10,
11:11,4,
15:16,2,
17:19,2,
19:X'000000000000000000000000000C',
33:X'000000000000000000000000000C',
47:21,1,
48:22,10,
58:32,16,
74:10X,
84:64,40,
124:6064,4)
|
[/code] |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2286 Location: USA
|
|
|
|
1. Run simple tests (without extra fields), - just you to understand the behavior of SQZ, and JFY parameters for yourself
2. Do not use parameters not related in any manner to your task (MID, LEAD, TRAIL, LENGTH)
3. Analyze the results of YOUR OWN TESTS
4. If something is not clear, present the results to the forum, and ask specific questions |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
sergeyken, Well said.
Nobody's trying these days or try to find themselves on internet what needs to be done. |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
sergeyken, Well said.
Nobody's trying these days or try to find themselves on internet what needs to be done. |
|
| Back to top |
|
 |
rexx77
New User
Joined: 14 Apr 2008 Posts: 78 Location: Mysore
|
|
|
|
Thanks for the suggestion. Please understand that the above code is not a rip off from internet or from other forum, i searched and found these functions and example usage and tried it for my problem. Before reaching out to forum, I make sure to try my best.
| Quote: |
2. Do not use parameters not related in any manner to your task (MID, LEAD, TRAIL, LENGTH)
|
Numerical data field has leading as well as trialing spaces and it is 32 bytes length, my target field is 16 bytes. Since this field had leading as well as trialing spaces, i used these functions.
| Quote: |
Run simple tests (without extra fields), - just you to understand the behavior of SQZ, and JFY parameters for yourself
|
As you have suggested, I will explore more simple examples and come back with detailed and specific problem statement.
Again, it is not my intention to ask other folks to do my work, it was rather out of not finding solution to my issue, i posted the above issue. Please see my other posts to know whether i reach the forum without checking it by myself. |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
| Quote: |
| In a nutshell, I would like to move 1,31, Reformat(32,32 ->to length=16), |
Will it be 16 or 8, we are talking about PD? |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
Also, if I understand correctly, try this .
| Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
+9800.34
-57460.00
//SORTOUT DD SYSOUT=*,
//SYSIN DD *
SORT FIELDS=COPY
INREC BUILD=(1,20,SFF,TO=PD,LENGTH=8) |
|
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|