Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Suggest me a sort card for Sorting two files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Suggest me a sort card for Sorting two files
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 Moderator


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

PostPosted: Tue Dec 02, 2008 10:29 pm    Post subject:
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    Post subject: Reply to: Sorting two files
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 Moderator


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

PostPosted: Tue Dec 02, 2008 11:49 pm    Post subject:
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    Post subject:
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    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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us