Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : When you specified V for RECFM parameter, LRECL value is largest record in the file plus 4 bytes. These four bytes contain the actual length of each variable length record in the file

Google
 
Web mainframegurukul.com

How to concatenate records from two ps into one ps?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> JCL
  View previous topic :: View next topic  
Author Message
nidhi1985
Member


Joined: 15 Jun 2009
Posts: 14

Answer was approved by Question owner.
Useful Post
1 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Jun 16, 2009 10:27 am    Post subject: How to concatenate records from two ps into one ps? Reply with quote

I have two ps in which:

One is having records like name of files in 1-20 columns and LRECL of the file is 80 and RECFM is FB.

Another one is having records like date when each file was processed in 1-20 columns and LRECL of the file is 80 and RECFM is FB.

I want to concatenate the records in two files in such a way that the name and the date in which that file was processed will come in same record.

as for example:

PS1:
uytreh.ijhdftg.gtyhkmn
retghb.iuhhhh.uhuhuhh
huhjhh.ujhjhju.uhjjhjhj

PS2:
2009-05-062009-09-05
2009-04-072009-02-06
2008-10-272009-04-12

Output:
uytreh.ijhdftg.gtyhkmn 2009-05-062009-09-05
retghb.iuhhhh.uhuhuhh 2009-04-072009-02-06
huhjhh.ujhjhju.uhjjhjhj 2008-10-272009-04-12

And I want to do all this using jcl utilities or dfsort.
The output file can be a new file or this can be modified in an old file.

Please give me some solution
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.

Shashank Gite
Member


Joined: 24 Feb 2009
Posts: 4
Location: Pune

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Jun 16, 2009 4:56 pm    Post subject: Reply with quote

I don't think you can do it using only jcl utilities or sort. You will have to write a small application program because you are merging two saparate records from different files into a single record.
If you find such solution than please let me know at my mail
Shashank.Gite@Steria.co.in
_________________
Cheers...
Shashank Gite
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
skolusu
Member


Joined: 26 Jul 2008
Posts: 43

Answer was approved by Question owner.
Useful Post
2 votes
Not an useful post
Greate Post!! Salute Author
8 salutes

PostPosted: Wed Jun 17, 2009 6:41 am    Post subject: Reply with quote

Concatenate both files together and using group function we can push the first record of first file on to the first record of second file.

You mentioned that second file only has only dates , so it is always numeric and the first file is dataset names and you cant have a numeric in them. So we check that and pad a seqnum to match. The dataset names can be a max of 44 bytes , so we put the dates in pos 46 of the output file

Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD *                                               
UYTREH.IJHDFTG.GTYHKMN                                         
RETGHB.IUHHHH.UHUHUHH                                         
HUHJHH.UJHJHJU.UHJJHJHJ                                       
//         DD *                                               
2009-05-062009-09-05                                           
2009-04-072009-02-06                                           
2008-10-272009-04-12                                           
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                               
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:C'1',SEQNUM,8,ZD)),     
  IFTHEN=(WHEN=(1,1,SS,EQ,C'1234567890'),                     
  OVERLAY=(46:1,20,01:45X,81:C'2',SEQNUM,8,ZD,RESTART=(81,1)))
  SORT FIELDS=(82,8,CH,A),EQUALS                               
                                                               
  OUTREC IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(1:1,45))           
                                                               
  OUTFIL BUILD=(1,80),OMIT=(81,1,ZD,EQ,1)                     
/*                                                             


The following is the output from the job

Code:

UYTREH.IJHDFTG.GTYHKMN                       2009-05-062009-09-05
RETGHB.IUHHHH.UHUHUHH                        2009-04-072009-02-06
HUHJHH.UJHJHJU.UHJJHJHJ                      2008-10-272009-04-12

_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
nidhi1985
Member


Joined: 15 Jun 2009
Posts: 14

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Jun 17, 2009 1:34 pm    Post subject: Thanx skolusu Reply with quote

But the problem is that I don't have a fixed number of records in the file, it changes as per the files included in a cycle.
The only thing that is fixed is that both the files will have same number of records.
I think you got what I mean.
You can use icetool also but I don't want to use any programming language.
Please reply as soon as possible.
Its urgent.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
skolusu
Member


Joined: 26 Jul 2008
Posts: 43

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
1 salutes

PostPosted: Wed Jun 17, 2009 8:53 pm    Post subject: Re: Thanx skolusu Reply with quote

nidhi1985 wrote:
But the problem is that I don't have a fixed number of records in the file, it changes as per the files included in a cycle.
The only thing that is fixed is that both the files will have same number of records.
I think you got what I mean.
You can use icetool also but I don't want to use any programming language.
Please reply as soon as possible.
Its urgent.


nidhi1985,

what makes you think that my solution will NOT handle it ? Did you even run and see if it works?
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
nidhi1985
Member


Joined: 15 Jun 2009
Posts: 14

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Jun 18, 2009 12:19 pm    Post subject: Thanx skolusu Reply with quote

I will definitely try this
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
nidhi1985
Member


Joined: 15 Jun 2009
Posts: 14

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Jun 18, 2009 12:44 pm    Post subject: Thanx Skolusu, Reply with quote

The second file has only the names but the names are as such IHM.CXDTRN1.TRNSFR, so what I mean to say is that the file names too have numbers in them

And one more thing:
Can I mention the name of two files that I am using instead of copying data from them in SORTIN statement as:
//SORTIN1 DD DSN=dsn name1, DISP=shr
//SORTIN2 DD DSN=dsn name2, DISP=shr

Please clear up my doubts as I am not able to understand the full code.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
skolusu
Member


Joined: 26 Jul 2008
Posts: 43

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Jun 18, 2009 8:53 pm    Post subject: Reply with quote

nidhi1985 wrote:
The second file has only the names but the names are as such IHM.CXDTRN1.TRNSFR, so what I mean to say is that the file names too have numbers in them


It doesn't matter , as long as they are mainframe dataset names, the first alphabet can never be a number and I am only checking the first byte to see if it is a number



nidhi1985 wrote:
And one more thing:
Can I mention the name of two files that I am using instead of copying data from them in SORTIN statement as:
//SORTIN1 DD DSN=dsn name1, DISP=shr
//SORTIN2 DD DSN=dsn name2, DISP=shr


If you read my post clearly you should have found this

Quote:
Concatenate both files together and using group function we can push the first record of first file on to the first record of second file.


ie.
Code:

//SORTIN   DD DSN=your file with dataset names,DISP=SHR
//         DD DSN=your file with numerical dates,DISP=SHR



For complete details on the new WHEN=GROUP and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
nidhi1985
Member


Joined: 15 Jun 2009
Posts: 14

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Fri Jun 19, 2009 5:05 pm    Post subject: Reply with quote

Thanks
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
nidhi1985
Member


Joined: 15 Jun 2009
Posts: 14

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Fri Jun 19, 2009 5:07 pm    Post subject: Reply with quote

Thanks 4 clearing up my doubts
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
nidhi1985
Member


Joined: 15 Jun 2009
Posts: 14

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Fri Jun 19, 2009 5:15 pm    Post subject: hi skolusu Reply with quote

Thanks for ur support
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
nidhi1985
Member


Joined: 15 Jun 2009
Posts: 14

Answer was approved by Question owner.
Useful Post
1 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Jun 22, 2009 11:20 am    Post subject: Hi skolusu Reply with quote

I tried that jcl but
while doing a jjscan its giving me an error of severity 8
and that is
Parameter keyword records unidentified
Parameter keyword push unidentified

Please advice me what to do in this situation
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
maheshvamsi
Active Member


Joined: 25 Mar 2009
Posts: 52
Location: Banglore

Answer was approved by Question owner.
Useful Post
1 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Jun 22, 2009 1:17 pm    Post subject: Reply with quote

Could you please post JCL & Errors. So that it will be easy for everyone to check
_________________
Thanks

MaheshVamsi
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Anuj Dhawan
Moderator


Joined: 09 Aug 2008
Posts: 1625
Location: Mumbai, India

Answer was approved by Question owner.
Useful Post
-1 votes
Not an useful post
Greate Post!! Salute Author
1 salutes

PostPosted: Mon Jun 22, 2009 4:22 pm    Post subject: Reply with quote

Quote:
Parameter keyword records unidentified
Parameter keyword push unidentified
If you are a DFSORT user you are missing PTF supporting PUSH parameter. Or id you are a SYncSort user which version of it?
_________________
Regards,
Anuj
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
arcvns
Member


Joined: 30 May 2009
Posts: 28
Location: Chennai, India

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Jun 22, 2009 6:46 pm    Post subject: Reply with quote

nidhi1985 wrote:
while doing a jjscan its giving me an error of severity 8

nidhi1985,

Some of the third party jcl-check products are so outdated that they dont recognize some the keywords used in sort control statements. Try submitting the job and post the error messages from SYSOUT here if you come across any issues.
_________________
Arun
Back to top
View user's profile Send private message Yahoo Messenger
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> JCL All times are GMT + 5 Hours
Goto page 1, 2  Next
Page 1 of 2



 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Cobol Tutorial
This cobol tutorial covers most of the important topics like STRING, UNSTRING, COMP, COMP-3.....
DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. Explains in simple language. Some Chapters are locked, Forum members have free access to these chapters
CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming...
JCL Tutorial
This is most popular JCL tutorial from mainframegurukul. It does contain important jcl ....
SORT Tutorial
This Tutorial covers all important aspects of DFSORT. Has more SORT examples
INTERVIEW Questions
This page covers important interview questions
Mainframe Jobs
Mainframe Jobs posted by members of mainframegurukul forum
FaceBook Page
MainframeGurukul FaceBook Page
LinkedIn Page
MainframeGurkul Linkedin Page

This widget requires Flash Player 9 or better







Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials || Mainframe CICS tutorial|| Mainframe COBOL Tutorial

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB

mainframetopic-4203.html