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

Suggest me a sort card for Sorting two files


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sreekusr
Warnings : 1

New User


Joined: 28 Aug 2006
Posts: 54
Location: Madrid

PostPosted: Tue Dec 02, 2008 7:26 pm
Reply with quote

Hello all,

Following are my requirements.
1. File 1 layout

Header1
Data1
Footer1


2.File 2 Layout

Header2
Data2
Footer2


I want to sort above two files and write it to File2
in the following layout

Header2
Data2
Data1
Footer2

Please suggest me a sort card by which i can execute the sorting successfully.

Thanks,
Sree
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Dec 02, 2008 10:29 pm
Reply with quote

Quote:
I want to sort above two files and write it to File2
in the following layout


It appears from your example that you are NOT sorting - you're just copying Data1 after Data2 and keeping the Header2 and Footer2 records.

You need to show a better example of your actual input records and what you want for output. Give the RECFM and LRECL of the input files. Give the starting position, length and format of all relevant fields.

Is there something in the headers and footers that identify them (e.g. 'H' in position 1 for header and 'T' in position 1 for footer)?

Do you actually want to sort on some field in the data records, or do you just want to copy them in their original order with the Data1 records after the Data2 records?
Back to top
View user's profile Send private message
sreekusr
Warnings : 1

New User


Joined: 28 Aug 2006
Posts: 54
Location: Madrid

PostPosted: Tue Dec 02, 2008 11:08 pm
Reply with quote

Hello Frank,

Thanks a lot for the response.
I am Extremely sorry if my description regarding the problem was not apt.

You are right, as i want to do a copy operation between two files.I put in the DFSORT Forum as i thought Sort utility will be best used for the purpose.

Header records are identified by Low-values after postion 5 and header records are identified by High-values after 5th Postion in the Record of 100 LRECL.

Thanks,
Sree
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Dec 02, 2008 11:49 pm
Reply with quote

You can use a DFSORT/ICETOOL job like the following to do what you asked for. I assume by "low values after position 5", you mean X'00' in position 6, and that by "high values after 5th position", you mean X'FF' in position 6. If not, change the OMIT conditions appropriately. //OUT must be a MOD data set or SYSOUT=*.

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/100)
//IN2 DD DSN=...  input file2 (FB/100)
//TRL DD DSN=&&TR,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//*** Use MOD for //OUT
//OUT DD DISP=MOD,DSN=...   MOD output file
//TOOLIN DD *
COPY FROM(IN2) USING(CTL1)
COPY FROM(IN1) TO(OUT) USING(CTL2)
COPY FROM(TRL) TO(OUT)
/*
//CTL1CNTL DD *
  OUTFIL FNAMES=OUT,OMIT=(5,1,BI,EQ,X'FF')
  OUTFIL FNAMES=TRL,SAVE
/*
//CTL2CNTL DD *
  OMIT COND=(5,1,BI,EQ,X'00',OR,5,1,BI,EQ,X'FF')
/*
Back to top
View user's profile Send private message
sreekusr
Warnings : 1

New User


Joined: 28 Aug 2006
Posts: 54
Location: Madrid

PostPosted: Wed Dec 03, 2008 11:40 am
Reply with quote

Hello Frank,

Thanks a lot for the solution..It WORKED..

Thanks,
Sree
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 -> DFSORT/ICETOOL

 


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 Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top