Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Moving leading zeroes as Trailing Zeros.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Vigneshwaran S
Warnings : 1

New User


Joined: 10 Dec 2008
Posts: 60
Location: Chennai

PostPosted: Fri Aug 07, 2009 2:23 pm    Post subject: Moving leading zeroes as Trailing Zeros.
Reply with quote

Hi All,

How to move the leading zeroes to trailing zeroes.

This is my sample input record,

Code:


0001234567890123
0002222222222678
0087888888888890
0123456789333330
2345678902345698
3456543457891234
0987654345678761



My output,

Code:


1234567890123000
2222222222678000
8788888888889000
1234567893333300
2345678902345698
3456543457891234
9876543456787610



LRECL = 80, and my input is a FB

Please suggest.
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Aug 07, 2009 7:37 pm    Post subject:
Reply with quote

Hello,

Just curious. . .

What was the reason for this requirement?
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Aug 07, 2009 7:44 pm    Post subject:
Reply with quote

Quote:
Hello,

Just curious. . .

What was the reason for this requirement?


Exactly same from me too...?

What is business need ?
Is it homework given??? icon_rolleyes.gif
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Aug 07, 2009 9:02 pm    Post subject:
Reply with quote

Vicky,

Here's one way to do it with DFSORT. I added a couple of extra input records for a more complete test.

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
0001234567890123
0002222222222678
0087888888888890
0123456789333330
2345678902345698
3456543457891234
0987654345678761
0000000000000000
0000000000000001
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC IFOUTLEN=80,
   IFTHEN=(WHEN=INIT,
    PARSE=(%01=(FIXLEN=15,ENDBEFR=C'1',ENDBEFR=C'2',ENDBEFR=C'3',
      ENDBEFR=C'4',ENDBEFR=C'5',ENDBEFR=C'6',ENDBEFR=C'7',
      ENDBEFR=C'8',ENDBEFR=C'9',ENDBEFR=C' ')),
    BUILD=(1,16,ZD,M10,LENGTH=16,17:%01)),
   IFTHEN=(WHEN=INIT,
    BUILD=(1,31,JFY=(SHIFT=LEFT)))
/*
Back to top
View user's profile Send private message
Vigneshwaran S
Warnings : 1

New User


Joined: 10 Dec 2008
Posts: 60
Location: Chennai

PostPosted: Tue Aug 11, 2009 9:51 am    Post subject:
Reply with quote

Hi all,

This requirement is done by using a cobol code. We were planning to remove this cobol code from installation. So thought of doing in DFSORT way. I tried in so many ways but i dint get the output i wanted, but here is a solution to remove leading zeroes,

Code:

  OPTION COPY                                           
  INREC OVERLAY=(1:1,16,ZD,M10,LENGTH=16)


Thanks Frank!!!!!!!!!

Thanks all for posting
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Aug 11, 2009 9:19 pm    Post subject:
Reply with quote

I don't understand the purpose of your latest post. I gave you what you asked for and you showed control statements for something completely different. Why?

The solution I gave you does what you asked for - it produces the output you said you wanted from the input you showed.

Your INREC statement does NOT do what you asked for and does not produce the output you said you wanted. It just replaces leading zeros with blanks, so the output would be:

Code:

   1234567890123       
   2222222222678       
  87888888888890       
 123456789333330       
2345678902345698       
3456543457891234       
 987654345678761       
               0       
               1       


Obviously, that doesn't match the output you asked for in your first post of:

Code:

1234567890123000
2222222222678000
8788888888889000
1234567893333300
2345678902345698
3456543457891234
9876543456787610
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Aug 11, 2009 9:40 pm    Post subject: Reply to: Moving leading zeroes as Trailing Zeros.
Reply with quote

Yup, kinda why i asked the reason for the requirement earlier icon_rolleyes.gif
Back to top
View user's profile Send private message
Vigneshwaran S
Warnings : 1

New User


Joined: 10 Dec 2008
Posts: 60
Location: Chennai

PostPosted: Wed Aug 12, 2009 9:42 am    Post subject:
Reply with quote

Hi all,

Sorry for confusing everybody!!!!!

Frank the solution which you gave me was perfect for my requirement!!!!

But when i tried, I have learnt how to remove leading zeroes using M10 mask.

So i just posted it like Knowledge sharing!!!!!!

The Solution which you gave me was working perfectly!!!!!!!!

Once again Sorry for the confusion Caused!!!!!!
Back to top
View user's profile Send private message
Vigneshwaran S
Warnings : 1

New User


Joined: 10 Dec 2008
Posts: 60
Location: Chennai

PostPosted: Wed Aug 12, 2009 10:00 am    Post subject:
Reply with quote

Hi all,

Frank has given me the Solution for my requirement. My output has to look like the one which i have asked in my First post.

Please ignore my post which caused all the confiusion.

Sorry frank!!!!
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Aug 12, 2009 9:36 pm    Post subject:
Reply with quote

Oh, ok. That clears it up.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Moving a PD to PD spoorni DFSORT/ICETOOL 8 Fri Oct 07, 2016 9:52 pm
No new posts Moving character data to smallint in db2 rikdeb DB2 5 Thu Jul 14, 2016 12:38 am
No new posts Join key - Populate Zeros when Unpair... rexx77 DFSORT/ICETOOL 6 Thu May 12, 2016 12:22 am
No new posts Syncsort to remove the leading spaces V S Amarendra Reddy SYNCSORT 5 Fri Jan 08, 2016 9:47 pm
This topic is locked: you cannot edit posts or make replies. Mainframe Jobs in Leading Indian MNC aman2248 Mainframe Jobs 0 Mon Dec 21, 2015 3:25 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us