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
 

 

Can we overlay two files to prepare a dynamic cntl card

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

New User


Joined: 26 Sep 2007
Posts: 7
Location: Chennai

PostPosted: Sat Dec 13, 2008 12:35 am    Post subject: Can we overlay two files to prepare a dynamic cntl card
Reply with quote

Hi,

Can any one help me out in joining the two files to prepare a dynamic cntl card?

File 1 - will have 2 rows.
Row1 sort fields=copy
Row2 Include condition

I need to get the date from file 2 and place that in 27th position of the 2nd row in file1 as shown below.

File1:
SORT FIELDS=COPY
INCLUDE COND=(39,4,PD,GE,<date from file2> ,AND,43,4,PD,GT,<time from file2>)

File2:
will have the date in CYYMMDD format and time in HHMMSS.

Output should be like below:
SORT FIELDS=COPY
INCLUDE COND=(39,4,PD,GE,1081212,AND,43,4,PD,GT,123333)
Back to top
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2275
Location: @my desk

PostPosted: Sat Dec 13, 2008 12:53 am    Post subject:
Reply with quote

How two topics can be this similar?
http://ibmmainframes.com/viewtopic.php?t=36687
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Dec 13, 2008 2:29 am    Post subject: Reply to: Can we overlay two files
Reply with quote

Same homework assignment. . .?
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: Sat Dec 13, 2008 6:56 am    Post subject:
Reply with quote

And I received the same question in a private message. Here's the response I gave:

You can use a DFSORT job like the following to do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
date (1081211) - CYYMMDD             time (072412) HH-MM-SS
/*
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL BUILD=(C'Tdate,''',7,7,C'''',80:X,/,
                C'Ttime,''',44,6,C'''')
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD *
 SORT FIELDS=(51,11,CH,A)
 INCLUDE COND=(39,4,PD,GE,       ,AND,43,4,PD,GT,      ,
 AND,438,3,CH,EQ,C'146',AND,717,9,CH,NE,C' ')
/*
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=(2,7,CH,EQ,C'INCLUDE'),
    OVERLAY=(27:Tdate,50:Ttime))
/*
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2275
Location: @my desk

PostPosted: Sat Dec 13, 2008 12:32 pm    Post subject:
Reply with quote

Frank,

AFAIK, Here the first step produces Symbols like this,
Code:
Tdate,'cyymmdd'
Ttime,'hhmmss'
Since the final comparison is done against a numeric PD field, wont this quotes around the date and time values be a problem? Should n't this be something like this?
Code:
Tdate,+cyymmdd
Ttime,+hhmmss
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: Sat Dec 13, 2008 9:43 pm    Post subject:
Reply with quote

No, it works fine as coded. I used:

Code:

   OVERLAY=(27:Tdate,50:Ttime))


This overlays the blanks in the INCLUDE statement with the character constants - it does not use the symbols to do the compare.

If you run the job, you'll see that the resulting statements are:

Code:

 SORT FIELDS=(51,11,CH,A)                                 
 INCLUDE COND=(39,4,PD,GE,1081211,AND,43,4,PD,GT,072412,   
 AND,438,3,CH,EQ,C'146',AND,717,9,CH,NE,C' ')             
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2275
Location: @my desk

PostPosted: Sun Dec 14, 2008 11:54 am    Post subject:
Reply with quote

Frank,

I got it. I was just comparing this with my solution. Did not notice that you were not doing the comparison. icon_mad.gif Thank you
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 Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm


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