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
 

 

Sort 2 input VSAM files and output a flat file with Lrec 250

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

New User


Joined: 19 Jul 2010
Posts: 21
Location: Chennai

PostPosted: Wed May 11, 2011 11:25 am    Post subject: Sort 2 input VSAM files and output a flat file with Lrec 250
Reply with quote

Hi ,

I have 2 VSAM files or rec len 200 / 240 each
file 1 - 200
File 2 - 240

Code:
01 File 1
    03 field1 - x20
    03 filler   - x
    03 field2 - x4
    03 field 3- 175

01 file 2
   03 col1 - x20
   03 filler   - x
   03 col2 - x4
   03 filler - x
   03 col3- 224

Output file
01 File 3
      03 filler1s9(4) usage comp
      03 filler  x20
      03 filler  x10
      03 field1 x20
      03 filler x
      03 col2 x4
      03 filler rest of the space

I want the 2 i/p files to be sorted based on codition that
field2 = col1 then it needs to be sorted to output file . Also the file needs to have a header and trailer and in trailer the file must contain the rec-count.

Job1919
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1788
Location: UK

PostPosted: Wed May 11, 2011 2:29 pm    Post subject:
Reply with quote

field2 compared to col1 you typed but field2 is 4 bytes and col1 is 20 bytes. Suggest you check your posting.

What is the header to look like? What is the trailer to look like? Can there be duplicates.

If you have not already done so - review some of the other sort topics to make sure you have supplied all the required details including sample data.

Have you checked other postings for headers and trailers?

Have you done ANYTHING to answer the question yourself?
Back to top
View user's profile Send private message
job1919

New User


Joined: 19 Jul 2010
Posts: 21
Location: Chennai

PostPosted: Wed May 11, 2011 4:42 pm    Post subject:
Reply with quote

Dear Nic,

Like I said , I have already done it in COBOL , I am only looking for any sort card.

And to answer your queries. Felied2 = Col2 Its a typo of X(20) . Here is the format

01 File 1
03 field1 - x20
03 filler - x
03 field2 - x4
03 field 3- 175

01 file 2
03 col1 - x4
03 filler - x
03 col2 - x4
03 filler - x
03 col3- 240

Output file
01 File 3
03 filler1s9(4) usage comp
03 filler x20
03 filler x10
03 field1 x20
03 filler x
03 col2 x4
03 filler rest of the space


I am sure you know the Col3 is left for the future use.

And about the header & Trailers.
here is the format that the utput is to look like
--------------------
File _Id: HDR
Date : Current date
Time : Current Time
--------------------

Records

--------------------
Trl_Id: TRL
Rec Count :
______________

Hope this informative

Thanks
job1919
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Wed May 11, 2011 7:12 pm    Post subject:
Reply with quote

job1919,
Could you post sample input and expected output along header and trailer?

Thanks,
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1788
Location: UK

PostPosted: Wed May 11, 2011 11:37 pm    Post subject:
Reply with quote

Quote:
Like I said , I have already done it in COBOL , I am only looking for any sort card.

Yes, I know you have done it in COBOL but tht is not what I was referring to when I asked about what you have done to resolve it yourself. Perhaps I should have been clearer and asked 'what have you tried with DFSORT?'.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Wed May 11, 2011 11:40 pm    Post subject: Reply to: Sort 2 input VSAM files and output a flat file wit
Reply with quote

Job1919,

Here is a job which will give you the desired results based on my assumptions.

Code:

//STEP0100 EXEC PGM=SORT                             
//SYSOUT   DD SYSOUT=*                               
//INA      DD DSN=Your input vsam file lrecl of 200,DISP=SHR
//INB      DD DSN=Your input vsam file lrecl of 240,DISP=SHR
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *                                   
  OPTION COPY                                     
  JOINKEYS F1=INA,FIELDS=(1,20,A),TYPE=F           
  JOINKEYS F2=INB,FIELDS=(1,20,A),TYPE=F           
  REFORMAT FIELDS=(F1:1,20,F2:22,4)               
  OUTFIL REMOVECC,                                 
  BUILD=(2Z,30X,1,20,X,21,4,250:X),               
  HEADER1=(DATE=(4MD/),X,TIME),                   
  TRAILER1=('REC COUNT : ',COUNT=(M11,LENGTH=8))   
//*                                               
//JNF1CNTL DD *                                   
  INREC BUILD=(1,20)                               
//*                                               
//JNF2CNTL DD *                                   
  INREC BUILD=(1,25)                               
//*


The output will be something like this (lrecl=250)
Code:

2011/05/11 10:38:23                                           
                                BBBBB                0001     
                                DDDDD                0003     
REC COUNT : 00000002                                           
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am


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