IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Remove leading spaces from numeric field


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rexx77

New User


Joined: 14 Apr 2008
Posts: 78
Location: Mysore

PostPosted: Wed Sep 06, 2017 2:15 am
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Wed Sep 06, 2017 2:35 am
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Wed Sep 06, 2017 8:05 am
Reply with quote

sergeyken, Well said.
Nobody's trying these days or try to find themselves on internet what needs to be done.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Wed Sep 06, 2017 3:24 pm
Reply with quote

sergeyken, Well said.
Nobody's trying these days or try to find themselves on internet what needs to be done.
Back to top
View user's profile Send private message
rexx77

New User


Joined: 14 Apr 2008
Posts: 78
Location: Mysore

PostPosted: Wed Sep 06, 2017 7:35 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Wed Sep 06, 2017 8:44 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Wed Sep 06, 2017 9:05 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
No new posts Remove leading zeroes SYNCSORT 4
Search our Forums:

Back to Top