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
 

 

sort utility

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
nithivenkat

New User


Joined: 15 Sep 2008
Posts: 22
Location: Mumbai

PostPosted: Mon Dec 15, 2008 3:03 pm    Post subject: sort utility
Reply with quote

I want to write a sort parm for which the input file is a flat file.If the input file has record as '00', the output file should be created as 00 00 00 00 .... till the end . if the input file has '11' , then output must be 11 11 11 11 .... till the end.

I/P1 : 00
O/P1 : 00 00 00 00 00 ..... til the end

I/P2 : 11
O/P2 : 11 11 11 11 11 ..... til the end
Back to top
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2276
Location: @my desk

PostPosted: Mon Dec 15, 2008 3:12 pm    Post subject:
Reply with quote

nithivenkat,

Does your input file have only these 2 possible values- '00' and '11' ? Or do you expect something else? What is the input/output LRECL?
Back to top
View user's profile Send private message
nithivenkat

New User


Joined: 15 Sep 2008
Posts: 22
Location: Mumbai

PostPosted: Mon Dec 15, 2008 3:17 pm    Post subject:
Reply with quote

Hi Arun,

LRECL of both the file is 100 bytes.
the input file can have any value. the logic is i want the value repeated with a space in between in the output file.

Thanks
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2276
Location: @my desk

PostPosted: Mon Dec 15, 2008 3:27 pm    Post subject:
Reply with quote

nithivenkat,

What business requirement is served by merely repeating the values n number of times? I have seen efforts being made to reduce reduntant information. You're trying to do the reverse. icon_rolleyes.gif

I dont see anything other than this.
Code:
//STEP1    EXEC PGM=SORT                 
//SYSOUT   DD SYSOUT=*                   
//SORTIN   DD DSN= Input file           
//SORTOUT  DD DSN= Output file           
//SYSIN    DD *                         
  OPTION COPY                           
  INREC BUILD=(1,2,X,1,2,X,1,2,X,.......)
Back to top
View user's profile Send private message
umasankarmf

New User


Joined: 08 Sep 2008
Posts: 43
Location: india

PostPosted: Mon Dec 15, 2008 3:30 pm    Post subject:
Reply with quote

Hi,

If I/P and O/P files have save LRECL, what about the spaces in the O/P file? Some data will be truncated...........!
Back to top
View user's profile Send private message
nithivenkat

New User


Joined: 15 Sep 2008
Posts: 22
Location: Mumbai

PostPosted: Mon Dec 15, 2008 3:45 pm    Post subject:
Reply with quote

Hi,

Instead of giving 1,2,x many times in the sort, I want to know if there is any single command to be given in the sort to get the values repeated with a space in between in the output file...

Thanks,
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: Mon Dec 15, 2008 9:36 pm    Post subject:
Reply with quote

Hi Arun,

Quote:
What business requirement is served by merely repeating the values n number of times? I have seen efforts being made to reduce reduntant information. You're trying to do the reverse.
Not only a questionable request, but
Quote:
Instead of giving 1,2,x many times in the sort, I want to know if there is any single command to be given in the sort to get the values repeated with a space in between in the output file...
a lazy request as well. . .

I wonder what should happen if the input is other than 2 characters? Should 111 become 111 111 111 or something else?

People would get useful replies so much quicker if they explained what they really needed to accomplish rather than technical tidbit. If we understand the business requirement, we can provide far better replies. . .[sigh]
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 -> JCL & VSAM 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 change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts DB2 - TERMINATE utility vasanthz DB2 5 Mon May 15, 2017 11:49 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm


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