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
 

 

Creating a sort card with multiconditions

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

New User


Joined: 16 Oct 2007
Posts: 7
Location: pune

PostPosted: Wed Nov 23, 2011 9:24 pm    Post subject: Creating a sort card with multiconditions
Reply with quote

Hi ,

I want to create a sort card which executes multiple conditions like the below.

I have a input file of 285 length which has a header starting with T . Need to split this file into three.

first file having 1:568 ( possible by coding outrec)
second file ( backup of inp without header, possible by including all records without first char 'T')

the third file which is having data from length 1:14 and 580 to 685 of input file. I need to append a header for this file and should format it to make it a Tab delimited file.

Thanks and regards,
Nithya
Back to top
View user's profile Send private message

Skolusu

Senior Member


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

PostPosted: Thu Nov 24, 2011 12:04 am    Post subject: Re: Creating a sort card with multiconditions
Reply with quote

Nithya Usha Mohanan wrote:
Hi ,
I have a input file of 285 length which has a header starting with T . Need to split this file into three.

the third file which is having data from length 1:14 and 580 to 685 of input file. I need to append a header for this file and should format it to make it a Tab delimited file.

Thanks and regards,
Nithya


Nithya,

If your input file is only 285 bytes , how do you plan to create the 3rd with data from bytes 580? for a length of 106 bytes? was that a typo? is it meant to be 280 to 285? Assuming that it is a typo , use the following DFSORT JCL which will give you the desired results.

Code:

//STEP0100 EXEC PGM=SORT   
//SYSOUT   DD SYSOUT=*     
//SORTIN   DD DSN=your input FB 285 byte file,DISP=SHR
//OUT1     DD SYSOUT=*     
//OUT2     DD SYSOUT=*     
//OUT3     DD SYSOUT=*     
//SYSIN    DD *           
  SORT FIELDS=COPY                                   
  OUTFIL FNAMES=OUT1,OVERLAY=(568:X)                 
  OUTFIL FNAMES=OUT2,OMIT=(1,1,CH,EQ,C'T')           
  OUTFIL FNAMES=OUT3,
  IFTHEN=(WHEN=(1,1,CH,EQ,C'T'),                     
  BUILD=(C'COLUMN HEADER1',X'05',C'HEAD2')),         
  IFTHEN=(WHEN=NONE,BUILD=(1,14,X'05',280,6))       
//*
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 change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
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
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm


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