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
 

 

Appending Zeros to Input

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

New User


Joined: 17 Feb 2007
Posts: 39
Location: Chennai

PostPosted: Mon Jan 10, 2011 12:26 pm    Post subject: Appending Zeros to Input
Reply with quote

Hi all,

Hope all are doing good and (belated) Happy New Year to all. icon_biggrin.gif

I have the following sample input.

bytes: 1-9
Code:
----------
123456789
1234567
12345678
----------


I am looking for the below output, where zeros are appending in the front if the length is not equal to 9.

bytes: 1-11
Code:
-----------
123-45-6789
001-23-4567
012-34-5678
-----------


I tried the below code:

Code:
INREC BUILD=(1,9,ZD,EDIT=(TTTTTTTTT))


But I could see that zeros are appended only the end as below.

bytes: 1-11
Code:
-----------
123-45-6789
123-45-6700
123-45-6780
-----------
Back to top
View user's profile Send private message

hailashwin

New User


Joined: 16 Oct 2008
Posts: 73
Location: Boston

PostPosted: Mon Jan 10, 2011 6:48 pm    Post subject:
Reply with quote

Please try this
Code:
 
OPTION COPY                                   
  INREC IFTHEN=(WHEN=(1,3,CH,NE,C'---'),       
      BUILD=(1,9,SQZ=(SHIFT=RIGHT)))           
 OUTREC FINDREP=(INOUT=(C' ',C'0'))           
 OUTFIL FILES=OUT,BUILD=(1,3,C'-',4,2,C'-',6,4)
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Jan 10, 2011 11:02 pm    Post subject:
Reply with quote

purusothaman,

Use the following DFSORT JCL which will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT                   
//SYSOUT   DD SYSOUT=*                     
//SORTIN   DD *                             
123456789                                   
1234567                                     
12345678                                   
//SORTOUT  DD SYSOUT=*                     
//SYSIN    DD *                             
  SORT FIELDS=COPY                         
  INREC OVERLAY=(1,9,UFF,EDIT=(TTT-TT-TTTT))
/*


The output is

Code:

123-45-6789
001-23-4567
012-34-5678
Back to top
View user's profile Send private message
hailashwin

New User


Joined: 16 Oct 2008
Posts: 73
Location: Boston

PostPosted: Mon Jan 10, 2011 11:24 pm    Post subject:
Reply with quote

Wasn't the 'Hyphed' line appearing as the header and trailer also part of the requirement? Please correct my understanding..
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Jan 10, 2011 11:57 pm    Post subject:
Reply with quote

hailashwin wrote:
Wasn't the 'Hyphed' line appearing as the header and trailer also part of the requirement? Please correct my understanding..


Ashwin,

I don't think so. It is just to show the top of the data line and Bottom of data lines.

Even if they are indeed actual data line , UFF will translate them to zeroes.
Back to top
View user's profile Send private message
purusothaman

New User


Joined: 17 Feb 2007
Posts: 39
Location: Chennai

PostPosted: Tue Jan 11, 2011 10:00 am    Post subject:
Reply with quote

Dear Ashwin,
The hypens are not part of data. As Kolusu mentioned, it was used to show the boundary of the data.

Kolusu,
Thanks a lot. I will try this one and let you know the result.
Back to top
View user's profile Send private message
hailashwin

New User


Joined: 16 Oct 2008
Posts: 73
Location: Boston

PostPosted: Tue Jan 11, 2011 10:37 am    Post subject:
Reply with quote

I have indeed made it look complicated then.. icon_rolleyes.gif

Thanks Kolusu and purusothaman.
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 How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Need input in Scheduling Benchwarmer CA Products 5 Tue Jun 06, 2017 1:44 am
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Formating the Input file sreekusr DFSORT/ICETOOL 3 Fri Feb 17, 2017 10:40 pm
No new posts Submit job from Cobol with input data abdulrafi COBOL Programming 4 Wed Feb 01, 2017 12:41 pm


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