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

sort utility


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 2481
Location: @my desk

PostPosted: Mon Dec 15, 2008 3:12 pm
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
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: 2481
Location: @my desk

PostPosted: Mon Dec 15, 2008 3:27 pm
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
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
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

Moderator Emeritus


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

PostPosted: Mon Dec 15, 2008 9:36 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts REASON 00D70014 in load utility DB2 6
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top