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 to add description while merging using sort card

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 130
Location: Guntur

PostPosted: Mon Dec 24, 2007 3:46 pm    Post subject: How to add description while merging using sort card
Reply with quote

Hi All,

I have requirement like i need to add one line description about the file that is merged like given below.

*****cluster***
11111111111111
222222222222222
2344445555555
****1cluster*****
555555555555555
6666666666666
3333333333333333
****2cluster*****
666666666666666666
77777777777777777
55555555557666677

i want the output file after merging the three files like above mentioned
only using sort card

Please help me for this.
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Mon Dec 24, 2007 4:58 pm    Post subject: Reply to: How to add description while merging using sort ca
Reply with quote

From Your signature ... You certainly confused us...
the requirement might be clear for You, but for us is not easy to understand
Back to top
View user's profile Send private message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 130
Location: Guntur

PostPosted: Mon Dec 24, 2007 5:06 pm    Post subject:
Reply with quote

Hi enrico-sorichetti,

I have three description's for three files like below

file1 - "monthly file"

file2 - "half-yearly file"

file3 - "yearly file"

i have some records in each of the file. Now i want to merge these three files so i am expecting the output file as given below
Code:


                    monthly file
dddddddddddddddddddddddd
ssssssssssssssssssssssssssss
ssssssffffffffffffffffffffffffffffffffffff
rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
                    half-yearly file
ttttttttttttttttttttttttttttttttttttttt
yyyyyyyyyyyyyyyyyyyyyyy
                    yearly file
wwwwwwwwwwwwwwwwwwww
eeeeeeeeeeeeeeeeeeeeeee
dddddddddddddddffffffffffffffffff



i have to add one line above each and every file while merging so that in the output file it should be clear like these records are monthly and these records are yearly.

You need any more information please let me know.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon Dec 24, 2007 5:52 pm    Post subject:
Reply with quote

Code:
//*********************************************
//STEP1    EXEC PGM=SORT                       
//SYSOUT   DD SYSOUT=*                         
//SORTIN   DD DSN=FILE1,DISP=SHR               
//         DD DSN=FILE2,DISP=SHR               
//         DD DSN=FILE3,DISP=SHR               
//         DD DSN=FILE4,DISP=SHR               
//         DD DSN=FILE5,DISP=SHR               
//         DD DSN=FILE6,DISP=SHR               
//SORTOUT  DD dsn=o/p file                     
//SYSIN    DD *                               
  SORT FIELDS=COPY                             
/*                                             


I am suggesting this JCL assuming that you are not merging based on any key.

Here File1 contains
Code:
                    monthly file

File2 contains
Code:
dddddddddddddddddddddddd
ssssssssssssssssssssssssssss
ssssssffffffffffffffffffffffffffffffffffff
rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr

File3 contains
Code:
                    half-yearly file

File4 contains
Code:
ttttttttttttttttttttttttttttttttttttttt
yyyyyyyyyyyyyyyyyyyyyyy

File5 contains
Code:
                   yearly file

File6 contains
Code:
wwwwwwwwwwwwwwwwwwww
eeeeeeeeeeeeeeeeeeeeeee
dddddddddddddddffffffffffffffffff
Back to top
View user's profile Send private message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 130
Location: Guntur

PostPosted: Mon Dec 24, 2007 5:57 pm    Post subject:
Reply with quote

Hi kRISPREM,

Thanks for your response, But if i have around 100 files like that ,It will become 200 input files.Is there any other way to add like header to the input file while merging.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon Dec 24, 2007 6:00 pm    Post subject:
Reply with quote

Ok.. then do you have a way to identify the records as different files..?
Hope your are getting my question!
Back to top
View user's profile Send private message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 130
Location: Guntur

PostPosted: Mon Dec 24, 2007 6:24 pm    Post subject:
Reply with quote

No, Once the records are merged i can't identify which record belongs to which file.

Is there a way like count the no. of records and after copying those many records add the description record for the next record like wise for all.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Mon Dec 24, 2007 6:28 pm    Post subject: Reply to: How to add description while merging using sort ca
Reply with quote

Quote:
No, Once the records are merged i can't identify which record belongs to which file.


if You cannot identify which belong to which
what' s the advantage of piling up everything together ???

or... the business reason ???
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon Dec 24, 2007 6:35 pm    Post subject:
Reply with quote

Quote:
Is there a way like count the no. of records and after copying those many records add the description record for the next record like wise for all.
If there are 100 files, you need to find the count of each file and do the processing is it...?
is it not tedious?
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: Mon Dec 24, 2007 8:54 pm    Post subject:
Reply with quote

Balakrishna Reddy,

You're not merging the files, you're copying them (copying is different from merging).

You can use a DFSORT/ICETOOL job like the following to add a header line for each file to one MOD output file:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD DSN=...  input file1
//IN2 DD DSN=...  input file2
//IN3 DD DSN=...  input file3
//*  USE MOD FOR OUTPUT FILE
//OUT DD DISP=MOD,DSN=...  output file
//TOOLIN DD *
COPY FROM(IN1) USING(CTL1)
COPY FROM(IN2) USING(CTL2)
COPY FROM(IN3) USING(CTL3)
/*
//CTL1CNTL DD *
  OUTFIL FNAMES=OUT,REMOVECC,
    HEADER1=(21:'Monthly file')
/*
//CTL2CNTL DD *
  OUTFIL FNAMES=OUT,REMOVECC,
    HEADER1=(21:'half-yearly file')
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,REMOVECC,
    HEADER1=(21:'yearly file')
/*
Back to top
View user's profile Send private message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 130
Location: Guntur

PostPosted: Wed Dec 26, 2007 11:54 am    Post subject:
Reply with quote

Hi Frank,

Thanks a lot for your jcl, Its working,But i couldn't understand what is the use of REMOVECC can you please explain me if you have time.

I once again thank all of you for your valuable responses.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed Dec 26, 2007 4:24 pm    Post subject:
Reply with quote

look at No Data or Carriage Control Characters
Back to top
View user's profile Send private message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 130
Location: Guntur

PostPosted: Wed Dec 26, 2007 6:25 pm    Post subject:
Reply with quote

thank you krisprem for your information.
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 Dec 26, 2007 9:35 pm    Post subject:
Reply with quote

Balakrishna,

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
Back to top
View user's profile Send private message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 130
Location: Guntur

PostPosted: Fri Dec 28, 2007 1:23 pm    Post subject:
Reply with quote

Hi Frank,

Slight modification in the above requirement, Now i need to add one more header for the first file.I tried to add it below the first one but it is giving RC 16 for that.Can you suggest me any alternative.

Code:

//CTL1CNTL DD *                           
  OUTFIL FNAMES=OUT,REMOVECC,             
    HEADER1=(21:'MONTHLY FILE')           
    HEADER0=(5:'THIS IS FOR MONTH OF JAN')
/*                                         

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

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Dec 28, 2007 1:33 pm    Post subject:
Reply with quote

Try this balakrishna
Code:
OUTFIL FNAMES=OUT,REMOVECC,             
   HEADER1=(21:'MONTHLY FILE',/,         
            5:'THIS IS FOR MONTH OF JAN')
Back to top
View user's profile Send private message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 130
Location: Guntur

PostPosted: Fri Dec 28, 2007 3:30 pm    Post subject:
Reply with quote

kRISPREM,

Before searching in the document given by frank i have posted this, Its there in the document, Anyway thanks krisprem.

From now onwards before posting i will search all the documents
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


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