Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Remove leading spaces from numeric field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
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    Post subject: Remove leading spaces from numeric field
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

Active User


Joined: 29 Apr 2008
Posts: 363
Location: Maryland

PostPosted: Wed Sep 06, 2017 2:35 am    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 2016
Location: NY,USA

PostPosted: Wed Sep 06, 2017 8:05 am    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 2016
Location: NY,USA

PostPosted: Wed Sep 06, 2017 3:24 pm    Post subject:
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    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 2016
Location: NY,USA

PostPosted: Wed Sep 06, 2017 8:44 pm    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 2016
Location: NY,USA

PostPosted: Wed Sep 06, 2017 9:05 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Replace comp-3 field value to comp-3 ... dharmaraok DFSORT/ICETOOL 5 Fri Sep 14, 2018 3:46 pm
No new posts Extra data in overlay field speermb DFSORT/ICETOOL 2 Thu Sep 13, 2018 6:04 pm
No new posts RPG II Problem with unsigned Packed d... Andi1982 All Other Mainframe Topics 6 Tue Sep 11, 2018 6:11 pm
No new posts Remove selected duplicate rows from t... hnharish DFSORT/ICETOOL 3 Wed Sep 05, 2018 3:11 am
No new posts Formating of Amount field in CLIST be... Anil Kumar Prajapati CLIST & REXX 9 Fri Aug 03, 2018 6:34 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us