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
 

 

How can I do this using sort

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

New User


Joined: 06 Jun 2007
Posts: 58
Location: Hyderabad

PostPosted: Wed Aug 08, 2007 5:59 pm    Post subject: How can I do this using sort
Reply with quote

Can anyone help,
I have a file which contains some records.In this file at 21st position if I have 'AC' then I need to format the data at 55th position for all the records.How can I do this using sort and also the rest of the records have to be copied?
Back to top
View user's profile Send private message

krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed Aug 08, 2007 6:14 pm    Post subject:
Reply with quote

shchan
You can do the this using IFTHEN clause.
Quote:
then I need to format the data at 55th position

Give the sample of i/p and o/p datasets, LRECL and RECFM, and elaborate about reformatting.

In the link

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html

you find z/OS DFSORT: Getting Started and other books on DFSORT/ICETOOL. Which will help you in knowing about DFSORT and its features.

Also Check the topic Reformatting Records with IFTHEN at http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ice1cg20/2.4.16?ACTION=MATCHES&REQUEST=IFTHEN&TYPE=FUZZY&SHELF=ICE1SH20&DT=20060615173822&CASE=&searchTopic=TOPIC&searchText=TEXT&searchIndex=INDEX&rank=RANK&ScrollTOP=FIRSTHIT#FIRSTHIT
Back to top
View user's profile Send private message
shchan

New User


Joined: 06 Jun 2007
Posts: 58
Location: Hyderabad

PostPosted: Wed Aug 08, 2007 6:34 pm    Post subject:
Reply with quote

When it contains AC i want to pad 4 zeroes at 32nd position
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Wed Aug 08, 2007 7:50 pm    Post subject: Re: How can I do this using sort
Reply with quote

Unless I'm missing something here, wouldn't it be a simple:

Code:

//STEP1   EXEC PGM=SORT                               
//SORTIN  DD   DSN=VV8.RECORD.SORTEX,DISP=SHR               
//SYSOUT  DD   SYSOUT=*                               
//SORTOUT DD   DSN=VV8.RECORD.SORTRES1,             
//        DISP=(,CATLG,DELETE),UNIT=SYSDA,     
//        SPACE=(TRK,(1,1),RLSE)
//SYSIN   DD   *                                       
  OPTION COPY     
  OUTREC IFTHEN=(WHEN=(21,2,CH,EQ,C'AC'),
    OVERLAY=(32:C'0000'))
/* 
Back to top
View user's profile Send private message
shchan

New User


Joined: 06 Jun 2007
Posts: 58
Location: Hyderabad

PostPosted: Wed Aug 08, 2007 8:02 pm    Post subject:
Reply with quote

Thank you so much superk..it worked..
Back to top
View user's profile Send private message
shchan

New User


Joined: 06 Jun 2007
Posts: 58
Location: Hyderabad

PostPosted: Wed Aug 08, 2007 8:05 pm    Post subject:
Reply with quote

But can u please tell me how to do the same thing using ICETOOL. Actually as far as formatting is concerned I want the 4 digits from 32 position to be moved to 36th and they should be preceeded by 4 zeroes.
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 08, 2007 8:13 pm    Post subject:
Reply with quote

Here's how you do the same thing with DFSORT's ICETOOL:

Code:

//STEP1   EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN  DD   DSN=VV8.RECORD.SORTEX,DISP=SHR
//OUT DD   DSN=VV8.RECORD.SORTRES1,
//        DISP=(,CATLG,DELETE),UNIT=SYSDA,
//        SPACE=(TRK,(1,1),RLSE)
//TOOLIN  DD   *
COPY FROM(IN) TO(OUT) USING(CTL1)
//CTL1CNTL DD *
  OUTREC IFTHEN=(WHEN=(21,2,CH,EQ,C'AC'),
    OVERLAY=(32:C'0000'))
/*


Quote:
I want the 4 digits from 32 position to be moved to 36th and they should be preceeded by 4 zeroes.


To show you how to do that, I need you to tell me the RECFM and LRECL of your input file and output file. Since you're adding 4 bytes to those records, do you want to remove the last 4 bytes from those records, or do you want to expand all of the records by 4 bytes. It would be best if you showed an example of your input records and expected output records.

You could have saved everyone time by giving the details of what you wanted in your first post. Please do that in the future.
Back to top
View user's profile Send private message
shchan

New User


Joined: 06 Jun 2007
Posts: 58
Location: Hyderabad

PostPosted: Wed Aug 08, 2007 8:37 pm    Post subject:
Reply with quote

Thanks Frank.I will try to give all the details next time in my first post only
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 Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts JCL sort Match and NoMatch rakeshsekar1987 SYNCSORT 2 Thu Feb 02, 2017 10:26 pm


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