IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Pass a value from one file to next file dynamically


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
senjay

Active User


Joined: 10 May 2007
Posts: 147
Location: India

PostPosted: Wed Oct 15, 2008 11:29 pm
Reply with quote

Hi,

I have the following requirement.

File 1:
-----
VB, LRECL=18. only one record is present

File 2:
------
VB, LRECL=250. n number of records can be present.

File 1 has one record and the value present in the first 14 (excluding RDW) should be matched with the 232nd postion of length 14 in all 'file 2' records. If both are equal, then records from file 2 should be written in output file.

Could you tell me how to dynamically pass the value of file1 to file2 and achieve my requirement?
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Thu Oct 16, 2008 12:20 am
Reply with quote

senjay,

The following DFSORT JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=ICEMAN                                       
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD DSN=YOUR 18 BYTE VB FILE,DISP=SHR
//SORTOUT  DD DSN=&&C1,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE)       
//SYSIN    DD *                                           
  SORT FIELDS=COPY                                         
  OUTFIL VTOF,                                             
  BUILD=(C'PICKVAL,C''',5,14,C'''',80:X)                   
/*                                                         
//STEP0200 EXEC PGM=ICEMAN                                 
//SYMNAMES DD DSN=&&C1,DISP=SHR
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD DSN=YOUR 250 BYTE VB FILE,DISP=SHR
//SORTOUT  DD SYSOUT=*                             
//SYSIN    DD *                                           
  OPTION COPY,VLSHRT                                       
  INCLUDE COND=(232,14,CH,EQ,PICKVAL)                     
/*


The first step creates a symbol named pickval which can be used in the next step
Back to top
View user's profile Send private message
senjay

Active User


Joined: 10 May 2007
Posts: 147
Location: India

PostPosted: Fri Oct 17, 2008 11:42 pm
Reply with quote

Thanks Kolusu,

I have 2 questions here.

1) Don't you think the control card (BUILD alone) in Step100 should be like this?

Instead of
Quote:
BUILD=(C'PICKVAL,C''',5,14,C'''',80:X)


it should be like this
Code:
BUILD=(C'PICKVAL,''',5,14,C'''',80:X)


And i got the solution with my control card. I am just using SYMBOLS and I'll be going through SYMBOLS shortly. Just out of curiosity i am asking this.

2) I tried this requriement with different approach. (LRECl for the file 2 is changed to 23050). I am getting RC 16.

Code:

//S010   EXEC PGM=ICETOOL,COND=(0,LT),PARM='DYNALLOC=(3390,50)'     
//TOOLMSG  DD SYSOUT=*                                             
//DFSMSG   DD SYSOUT=*                                             
//TOOLOUT  DD SYSOUT=*                                             
//EIN2     DD DSN=file2 of VB 23050,                   
//            DISP=SHR                                             
//EIN1     DD DSN=file1 of VB 18,               
//            DISP=SHR                                             
/*                                                                 
//T1       DD DSN=&&T1,UNIT=SYSDA,SPACE=(TRK,(5,5)),DISP=(,PASS)   
//AUS1     DD DSN=output,               
//            DISP=(NEW,CATLG,DELETE),                             
//            DATACLAS=DCCOMP,                                     
//            DCB=(RECFM=VB,LRECL=23036,BLKSIZE=0),                 
//            SPACE=(CYL,(2,4),RLSE),                               
//            UNIT=(3390,6)                                         
//TOOLIN   DD *                                                     
 COPY FROM(EIN1) USING(CTL1)                                       
 COPY FROM(EIN2) USING(CTL2)                                       
/*                                                                 
//CTL1CNTL DD *                                                         
 OUTFIL FNAMES=T1,VTOF,                                                 
 BUILD=(3:C'INCLUDE=(23037,14,CH,EQ,C''',5,14,C'''),OUTREC=(5,23036)') 
/*                                                                     
//CTL2CNTL DD *                                                         
  OPTION COPY                                                           
  OUTFIL FNAMES=AUS1,                                                   
/*                                                                     
//         DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,PASS)                     
//SYSPRINT DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 


The error message is
Code:

ICE000I 0 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 20:05 ON FRI OCT
            OPTION COPY                                                         
            OUTFIL FNAMES=AUS1,                                                 
          $                                                                     
ICE001A 0 TEXT BEGINS IN WRONG COLUMN                                           
            INCLUDE=(23037,14,CH,EQ,C'19011209221000'),OUTREC=(5,23036)         
.

I am banging my head how to solve this though i got the solution by using SYMBOLS. Could you help me out here?
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Sat Oct 18, 2008 1:27 am
Reply with quote

senjay,


PICKVAL,'your 14 byte value'
PICKVAL,C'your 14 byte value'

are both valid as symbols. In the first case DFSORT internally translates the PICKVAL,'your 14 byte value' into PICKVAL,C'your 14 byte value'. You can check this out by the adding the
following line to your JCL
Code:

//SYMNOUT  DD SYSOUT=*


Coming to your error, it is because you created the include card with only 55 bytes of data and the sysin should be 80 bytes. So change your CTL1CNTL to the following

Code:

BUILD=(3:C'INCLUDE=(23037,14,CH,EQ,C''',5,14,C'''),OUTREC=(5,23036)',
   80:X)


Also unless you are converting the output file AUS1 to FB record format you really dont need OUTREC parm. if you are indeed converting AUS1 to FB file I suggest that you add the parm VTOF on your OUTFIL statement

Hope this helps...

Cheers
Back to top
View user's profile Send private message
senjay

Active User


Joined: 10 May 2007
Posts: 147
Location: India

PostPosted: Wed Oct 29, 2008 8:29 pm
Reply with quote

Hi Kolusu,

Thanks a lot. Your suggestion really helps.
Sorry for the late reply.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top