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

building 2 fileout


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

New User


Joined: 14 Sep 2009
Posts: 60
Location: Milan

PostPosted: Fri Mar 19, 2010 9:55 pm
Reply with quote

i need to compare the position 1 length 9 of fileinp 1 and position 9 of 9 length fileinp 2.

If i do, I write the FileOut 1 (as example)

if I don't, I write the record of fileinp 2 in FileOut 2

FILEINP 1 (FB LENGHT 31)
081302602;201001;20100227;01;10

FILEINP 2 (FB LENGHT 100)
05228000081302602
05228000011111111

FILEOUT 1 (FB LENGHT 31)
(it's composed of : record of fileinp 2(1:17)+record of fileinp 1 (17:2) +record of fileinp 1 (30:2)
052280000813020010110

FILEOUT 2 (FB LENGHT 31)
05228000011111111


thank you
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Mar 19, 2010 11:16 pm
Reply with quote

Can File1 have duplicates within it?

Can File2 have duplicates within it?

If either file can have duplicates, please show a better example of input and expected output for all cases. Even if neither file can have duplicates, show a better example of input and expected output with more records and all cases.

Please run the following job and show me the //SYSOUT messages so I can see what level of DFSORT you have:

Code:

//S1    EXEC  PGM=SORT   
//SYSOUT    DD  SYSOUT=* 
//SORTIN DD *             
RECORD                   
//SORTOUT DD DUMMY       
//SYSIN    DD    *       
  OPTION COPY             
/*     
Back to top
View user's profile Send private message
theone1987

New User


Joined: 14 Sep 2009
Posts: 60
Location: Milan

PostPosted: Sat Mar 20, 2010 4:48 pm
Reply with quote

Frank Yaeger wrote:



both file can't have duplicates

thank you
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Sat Mar 20, 2010 7:21 pm
Reply with quote

*Sigh*. . .

Where is the DFSORT info that was requested. . . icon_sad.gif
Back to top
View user's profile Send private message
theone1987

New User


Joined: 14 Sep 2009
Posts: 60
Location: Milan

PostPosted: Sun Mar 21, 2010 3:27 am
Reply with quote

Frank Yaeger wrote:
Code:

//S1    EXEC  PGM=SORT   
//SYSOUT    DD  SYSOUT=* 
//SORTIN DD *             
RECORD                   
//SORTOUT DD DUMMY       
//SYSIN    DD    *       
  OPTION COPY             
/*     


i'm sorry why do i have to run that code?
however the result is:
ICE084I 0 BSAM ACCESS METHOD USED FOR SORTOUT
ICE084I 0 BSAM ACCESS METHOD USED FOR SORTIN
ICE751I 1 EF-BASE F0-BASE E8-K48846
ICE090I 0 OUTPUT LRECL = 80, BLKSIZE = 80, TYPE = FB
ICE055I 0 INSERT 0, DELETE 0
ICE054I 0 RECORDS - IN: 1, OUT: 1
ICE052I 0 END OF DFSORT
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Sun Mar 21, 2010 6:27 am
Reply with quote

Hello,

The output shows which product and which "ptf level" is in use.

Solutions vary depending on exactly which sort/level is used.
Back to top
View user's profile Send private message
theone1987

New User


Joined: 14 Sep 2009
Posts: 60
Location: Milan

PostPosted: Mon Mar 22, 2010 2:16 pm
Reply with quote

i tried to do
Code:

//EXTRACT  EXEC PGM=ICETOOL                                     
//TOOLMSG  DD SYSOUT=*                                           
//DFSMSG   DD SYSOUT=*                                           
//TOOLIN   DD *                                                 
  COPY FROM(REGNIN1) TO(T1) USING(CTL1)                         
  COPY FROM(REGNIN2) TO(T1) USING(CTL2)                         
  SPLICE FROM(T1) WITHALL -                                     
  ON(1,09,CH)    -                                               
  WITH(1,17)     -                                               
  WITH(1,09)     -                                               
  WITH(27,2)     -                                               
  WITH(30,02)    -                                               
  TO(REGNOUT)                                                   
/*                                                               
//REGNIN1 DD DSN=...&FILEIN1 ,DISP=SHR       
//REGNIN2 DD DSN=...&FILEIN2 ,DISP=SHR
//T1       DD  DISP=(NEW,CATLG),                                 
//             UNIT=(SYSDA,,),                                   
//             SPACE=(CYL,(100,500,),,,),                       
//             DCB=(LRECL=31,RECFM=FB,DSORG=PS),                 
// DSN=...&FILEOUT                                 
//REGNOUT DD *                                       
//CTL1CNTL DD *                                     
* MOVE REGION.IN1 FIELDS TO THEIR LOCATIONS FOR THE 
* OUTPUT DATA SET                                   
  OUTREC FIELDS=(1:1,17)                             
/*                                                   
//CTL2CNTL DD *                                     
* MOVE REGION.IN2 FIELDS TO THEIR LOCATIONS FOR THE 
* OUTPUT DATA SET                                   
  OUTREC FIELDS=(1:1,9,                             
                 18:27,2,                           
                 20:30,2)                           



but it doesn't work at all...
Please help
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon Mar 22, 2010 9:07 pm
Reply with quote

Hello,

Quote:
but it doesn't work at all...
Posting "it didn't work" does not provide info for someone to use to help you. . . What error/abend/undesired result occurred?

As you want to copy multiple things into T1, suggest you use MOD for that DD.

If this does not help, you need to post the specifics of the problem.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Mon Mar 22, 2010 9:16 pm
Reply with quote

theone1987 wrote:

i'm sorry why do i have to run that code?


theone1987,

You can't even paste the complete sysout. *Sigh* we are asking you to run the job so that we can determine which level of DFSORT functions you have available and accordingly provide the solution.

We can provide a solution with the latest PTF available only for you to comeback with a 3 word answer "It doesn't Work" . with no additional information provided. We don't have access to your data or we can't read what is on your mind. So Please provide the information requested instead of question of "why should I do run this?" if you want us to help.

Read this topic and re-run the job frank has shown and post the complete sysout

ibmmainframes.com/viewtopic.php?p=148481#148481
Back to top
View user's profile Send private message
theone1987

New User


Joined: 14 Sep 2009
Posts: 60
Location: Milan

PostPosted: Mon Mar 22, 2010 9:25 pm
Reply with quote

Skolusu wrote:
*Sigh*


sorry...
here the complete result
Code:

1ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED                               
 ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AND MORE                         
 ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 16:48 ON MON MAR 22, 2010 -                       
0            OPTION COPY   
 ICE201I F RECORD TYPE IS F - DATA STARTS IN POSITION 1                         
 ICE751I 0 C5-K48846 C6-K90014 C7-K45047 C8-K42136 E9-K47759 C9-BASE   E5-K48846 E7-K48846                           
 ICE193I 0 ICEAM1 INVOCATION ENVIRONMENT IN EFFECT - ICEAM1 ENVIRONMENT SELECTED
 ICE252I 1 PARMLIB OPTIONS WERE MERGED WITH INSTALLATION MODULE DEFAULTS     
 ICE088I 0 LUCASTOR.S1      .        , INPUT LRECL = 80, BLKSIZE = 80, TYPE = FB
 ICE093I 0 MAIN STORAGE = (MAX,6291456,6278238)                                 
 ICE156I 0 MAIN STORAGE ABOVE 16MB = (6200798,6200798)                           
 ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y,RESET=Y,VSAMEMT=Y,DYNSPC=256         
 ICE128I 0 OPTIONS: SIZE=6291456,MAXLIM=2097152,MINLIM=450560,EQUALS=N,LIST=Y,ERET=RC16 ,MSGDDN=SYSOUT               
 ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=NO   ,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=N,DYNALOC=N             ,ABCODE=MSG
 ICE130I 0 OPTIONS: RESALL=65536,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT=N,COBEXIT=COB2                   
 ICE131I 0 OPTIONS: TMAXLIM=6291456,ARESALL=0,ARESINV=0,OVERRGN=65536,CINV=Y,CFW=N,DSA=0                             
 ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE    ,EXITCK=S,PARMDDN=DFSPARM ,FSZEST=N       
 ICE133I 0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=256 ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAMIO=N,MOSIZE=MAX                       
 ICE235I 0 OPTIONS: NULLOUT=RC0           
 ICE084I 0 BSAM ACCESS METHOD USED FOR SORTOUT                                   
 ICE084I 0 BSAM ACCESS METHOD USED FOR SORTIN                                 
 ICE751I 1 EF-BASE   F0-BASE   E8-K48846
 ICE090I 0 OUTPUT LRECL = 80, BLKSIZE = 80, TYPE = FB                           
 ICE055I 0 INSERT 0, DELETE 0           
 ICE054I 0 RECORDS - IN: 1, OUT: 1         
 ICE052I 0 END OF DFSORT   



now i hope it's what you want....
sorry again
Back to top
View user's profile Send private message
theone1987

New User


Joined: 14 Sep 2009
Posts: 60
Location: Milan

PostPosted: Mon Mar 22, 2010 9:44 pm
Reply with quote

I honestly do not understand if my request was unclear.
I try to rewrite it more clearly:

I have two input files. The two files have different formats and both do NOT contain duplicates within them.

I have to build an output file that contains some of the first file and other fields of the second file (with the same key)

The file consists of:
INPUT FILE N ° 1 (FB LENGTH 31)
081302602;201001;20100227;01;10

FILEINP 2 (FB LENGTH 100)
05228000081302602
05228000056842364

(I highlighted the area that we need to compare)

Therefore, comparing the field from a position 1 length 9 of the first file, with the field position 9 length 9 of the second file.

if it exists in both files, then write the output file n° 1 composed of:
entire input file 1 + pos 27: length 02 (of the 2th fileinp) + pos 30: length 02 (of the 2th fileinp)

if the record of the input file 2 is not present in fileinput 1, write the entire record in FileOut 2

then:
INPUT FILE N ° 1 (FB LENGTH 31)
081302602;201001;20100227;01;10

FILEINP 2 (FB LENGTH 100)
05228000081302602
05228000056842364

FileOut 1 (FB LENGTH 31)
052280000813026020110

FileOut 2 (FB LENGTH 31)
05228000056842364

i hope it's more clear now...
thank you
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Mon Mar 22, 2010 10:22 pm
Reply with quote

theone1987,

The following DFSORT JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD DSN=Your input FB 100 byte file,DISP=SHR
//HDR      DD DSN=&&HDR,DISP=(,PASS),SPACE=(TRK,(1,0),RLSE)         
//TM31     DD DSN=&&TM31,DISP=(,PASS),SPACE=(CYL,(X,Y),RLSE)         
//SYSIN    DD *                                                     
  SORT FIELDS=COPY                                                   
  INREC BUILD=(1,17,31:X)                                           
  OUTFIL FNAMES=TM31                                                 
  OUTFIL FNAMES=HDR,ENDREC=1,BUILD=(3C'$',31:X)                     
//*                                                                 
//STEP0200 EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD DSN=&&HDR,DISP=SHR,VOL=REF=*.STEP0100.HDR             
//         DD DSN=Your input FB 31 byte file,DISP=SHR
//         DD DSN=&&HDR,DISP=SHR,VOL=REF=*.STEP0100.HDR             
//         DD DSN=&&TM31,DISP=SHR                                   
//OUT1     DD SYSOUT=*                                               
//OUT2     DD SYSOUT=*                                               
//SYSIN    DD *                                                     
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'$$$'),PUSH=(32:ID=1)),
  IFTHEN=(WHEN=(32,1,ZD,EQ,1),OVERLAY=(34:1,9)),                     
  IFTHEN=(WHEN=(32,1,ZD,EQ,2),OVERLAY=(34:9,9))                     

  SORT FIELDS=(34,9,CH,A),EQUALS                                     

  OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(43:SEQNUM,2,ZD,RESTART=(34,9))),
  IFTHEN=(WHEN=GROUP,BEGIN=(43,2,ZD,EQ,1),PUSH=(33:32,1,45:27,5))   

  OUTFIL FNAMES=OUT1,INCLUDE=(32,2,ZD,EQ,21),                       
  BUILD=(1,17,45,2,48,2,31:X)                                       

  OUTFIL FNAMES=OUT2,BUILD=(1,17,31:X),                             
  INCLUDE=(32,2,ZD,EQ,22,AND,1,3,CH,NE,C'$$$')                       
//*
Back to top
View user's profile Send private message
theone1987

New User


Joined: 14 Sep 2009
Posts: 60
Location: Milan

PostPosted: Tue Mar 23, 2010 2:37 pm
Reply with quote

Skolusu wrote:



thank you!it works...
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 building java class with zip4j.jar on... Java & MQSeries 0
No new posts Building a sort key DFSORT/ICETOOL 3
No new posts Need help in building a logic All Other Mainframe Topics 4
No new posts Several errors during building altern... JCL & VSAM 11
No new posts Drop building Alternate Index for a p... JCL & VSAM 6
Search our Forums:

Back to Top