MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Record rewriting

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
maxisnowhere
Beginner


Joined: 25 May 2005
Posts: 59
Topics: 20

PostPosted: Fri Nov 09, 2007 9:02 am    Post subject: Record rewriting Reply with quote

Hello everybody,

I have a question about rewriting a file. My input file is:

Code:
A 11 22     
B 44 55 66
C 77
D 88 99       


I would like to have an output like:

Code:
A 11
A 22   
B 44 
B 55 
B 66
C 77
D 88
D 99


Can somebody help me?
Thx 4 any help!
_________________
Maxisnowhere
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Nov 09, 2007 11:39 am    Post subject: Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for. I assumed your input file has RECFM=FB and LRECL=80 but the job can be changed appropriately for other attributes.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD *
A 11 22
B 44 55 66
C 77
D 88 99
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD SYSOUT=*
//TOOLIN   DD    *
COPY FROM(IN) USING(CTL1)
COPY FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  OUTFIL FNAMES=T1,
    BUILD=(1,4,80:X,/,
           1,2,6,2,/,
           1,2,9,2)
/*
//CTL2CNTL DD *
  OMIT COND=(3,2,CH,EQ,C' ')
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
maxisnowhere
Beginner


Joined: 25 May 2005
Posts: 59
Topics: 20

PostPosted: Mon Jan 07, 2008 8:59 am    Post subject: Reply with quote

Hello Frank,

thank you for your help. Unfortunately I can't do as you said, because my file is too big.

I will try to explain: my file is 2576 bytes long, the first 758 bytes are the fixed part, and then I have 100 times the variable part of 18 bytes. The file has 245164 record, so if I try to move the 100 variable parts one in each record, I have problem with the space.

I think I will do a PLi pgm to do that, but maybe you have an other solution...

Thank you for all help an happy new year!
_________________
Maxisnowhere
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Jan 07, 2008 11:26 am    Post subject: Reply with quote

Quote:
I have problem with the space.


The space for what ... the T1 file? Is it the blank records in the T1 file that cause the space problem? If so, maybe you could use a tape for T1?
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
maxisnowhere
Beginner


Joined: 25 May 2005
Posts: 59
Topics: 20

PostPosted: Tue Jan 08, 2008 2:07 am    Post subject: Reply with quote

Yes the problem is for the T1 dataset. I tried to use tape but i got an S837. It is the first time I use a tape, and i don't know why I got such error ("not enough space on the volume for the file). I made:

Code:
//ICE1  EXEC  PGM=ICETOOL                                         
//TOOLMSG   DD  SYSOUT=*                                           
//DFSMSG    DD  SYSOUT=*                                           
//IN        DD   DSN=FINPUT,DISP=SHR                     
//T1        DD   DSN=N.NASTRO.MYFILE(+1),UNIT=VTAPE,                 
//          DCB=(N.MODEL,RECFM=FB,LRECL=776,BLKSIZE=7760),         
//          DISP=(,CATLG,DELETE),RETPD=1                           
//TOOLIN    DD    *                                               
COPY FROM(IN) USING(CTL1)                                         
/*                                                                 
//CTL1CNTL  DD *                                                   
  OUTFIL FNAMES=T1,                                               
    BUILD=(1,758,759,18,/,                                         
           1,758,777,18,/,                                         
           1,758,795,18,/,                                         
           1,758,795,18,/,                                         
           1,758,813,18,/,                                         
           1,758,831,18,/,                                         
           1,758,849,18,/,                                         
          1,758,885,18,/,                                 
          1,758,903,18,/,                                 
          1,758,921,18,/,                                 
          1,758,939,18,/,                                 
          1,758,957,18,/,                                 
          1,758,975,18,/,                                 
          1,758,993,18,/,                                 
          1,758,1011,18,/,                                 
          1,758,1029,18,/,                                 
          1,758,1047,18,/,                                 
          1,758,1065,18,/,                                 
          1,758,1083,18,/,                                 
          1,758,1101,18,/,                                 
          1,758,1119,18,/,                                 
          1,758,1137,18,/,                                 
          1,758,1155,18,/,                                 
          1,758,1173,18,/,                                 
          1,758,1191,18,/,                                 
          1,758,1209,18,/,                                 
          1,758,1227,18,/,                                   
          1,758,1245,18,/,                                   
          1,758,1263,18,/,                                   
          1,758,1281,18,/,                                   
          1,758,1299,18,/,                                   
          1,758,1317,18,/,                                   
          1,758,1335,18,/,                                   
          1,758,1353,18,/,                                   
          1,758,1371,18,/,                                   
          1,758,1389,18,/,                                   
          1,758,1407,18,/,                                   
          1,758,1425,18,/,                                   
          1,758,1443,18,/,                                   
          1,758,1461,18,/,                                   
          1,758,1479,18,/,                                   
          1,758,1497,18,/,                                   
          1,758,1515,18,/,                                   
          1,758,1533,18,/,                                   
          1,758,1551,18,/,                                   
          1,758,1569,18,/,               
          1,758,1587,18,/,               
          1,758,1605,18,/,               
          1,758,1623,18,/,               
          1,758,1641,18,/,               
          1,758,1659,18,/,               
          1,758,1677,18,/,               
          1,758,1695,18,/,               
          1,758,1713,18,/,               
          1,758,1731,18,/,               
          1,758,1749,18,/,               
          1,758,1767,18,/,               
          1,758,1785,18,/,               
          1,758,1803,18,/,               
          1,758,1821,18,/,               
          1,758,1839,18,/,               
          1,758,1857,18,/,               
          1,758,1875,18,/,               
          1,758,1893,18,/,               
          1,758,1911,18,/,                         
          1,758,1929,18,/,                         
          1,758,1947,18,/,                         
          1,758,1965,18,/,                         
          1,758,1983,18,/,                         
          1,758,2001,18,/,                         
          1,758,2019,18,/,                         
          1,758,2037,18,/,                         
          1,758,2055,18,/,                         
          1,758,2073,18,/,                         
          1,758,2091,18,/,                         
          1,758,2109,18,/,                         
          1,758,2127,18,/,                         
          1,758,2145,18,/,                         
          1,758,2163,18,/,                         
          1,758,2181,18,/,                         
          1,758,2199,18,/,                         
          1,758,2217,18,/,                         
          1,758,2235,18,/,                         
           1,758,2253,18,/,                                         
           1,758,2271,18,/,                                         
           1,758,2289,18,/,                                         
           1,758,2307,18,/,                                         
           1,758,2325,18,/,                                         
           1,758,2343,18,/,                                         
           1,758,2361,18,/,                                         
           1,758,2379,18,/,                                         
           1,758,2397,18,/,                                         
           1,758,2415,18,/,                                         
           1,758,2433,18,/,                                         
           1,758,2451,18,/,                                         
           1,758,2469,18,/,                                         
           1,758,2487,18,/,                                         
           1,758,2505,18,/,                                         
           1,758,2523,18,/,                                         
           1,758,2559,18)                                           
/*                                                                   
//*******************************************************************
//*******************************************************************
//* ICE2: TOGLIE PARTI VUOTE                                        *
//*******************************************************************
//ICE2  EXEC  PGM=ICETOOL                                           
//TOOLMSG   DD  SYSOUT=*                                             
//DFSMSG    DD  SYSOUT=*                                             
//IN        DD   DSN=N.NASTRO.MYFILE(+1),                               
//          DISP=OLD                                                 
//OUT       DD   DSN=FOUTPUT,UNIT=SYSDA,                     
//          DCB=(RECFM=FB,LRECL=776),                               
//          SPACE=(CYL,(500,50),RLSE),                               
//          DISP=(NEW,CATLG,CATLG)                                   
//TOOLIN    DD    *                                                 
COPY FROM(T1) TO(OUT) USING(CTL2)                                   
/*                                                                   
//CTL2CNTL  DD *                                                     
  OMIT COND=(759,18,CH,EQ,C'                  ')                     
/*                                                                   
//


Maybe you can help me....
Thank u a lot!!
_________________
Maxisnowhere
Back to top
View user's profile Send private message
krisprems
Beginner


Joined: 13 Dec 2006
Posts: 101
Topics: 4
Location: india

PostPosted: Tue Jan 08, 2008 2:32 am    Post subject: Reply with quote

Check for this error message IEC028I? if you are getting it?
Also try using extended volume...
This error may be caused because you reached end of volume!!!
_________________
cHEERs
krisprems
Back to top
View user's profile Send private message
maxisnowhere
Beginner


Joined: 25 May 2005
Posts: 59
Topics: 20

PostPosted: Tue Jan 08, 2008 4:50 am    Post subject: Reply with quote

I changed the dataset definition with:
Code:

//T1        DD   DSN=N.VRSG.AICHG(+1),                       
//          DCB=(N.MODEL,RECFM=FB,LRECL=776,BLKSIZE=7760),   
//          DISP=(,CATLG,DELETE),                           
//          UNIT=VTAPE,LABEL=(1,SL,RETPD=1)                 


it should be better but i got the same error as before:

Code:
IEC028I 837-08,IFG05510,AILDBEX4,ICE1,T1,0F56,022424,N.VRSG.AICHG.G0076V00(+1) 
IEA995I SYMPTOM DUMP OUTPUT  643                           
SYSTEM COMPLETION CODE=837  REASON CODE=00000008           
 TIME=10.33.45  SEQ=27133  CPU=0000  ASID=0097             
 PSW AT TIME OF ERROR  075C1000   80E8DCBE  ILC 2  INTC 0D 
   NO ACTIVE MODULE FOUND                                   
   NAME=UNKNOWN                                             
   DATA AT PSW  00E8DCB8 - 41003846  0A0DB20A  00509808     
   GR 0: 0000003C_00E8DEC8   1: 00000000_A4837000           
      2: 00000000_000140E8   3: 00000000_00E8D682           
      4: 00000000_00AD0420   5: 00000000_00EA3000           
      6: 00000000_00AD06C4   7: 00000000_00AD071C           
      8: 00000000_00AD06E4   9: 00000000_00AD1280           
      A: 00000000_00F4A238   B: 00000000_00AD1B58           
      C: 00000000_00AD1280   D: 00000000_00000000           
      E: 00000000_00E8DAE4   F: 00000000_00000008           
 END OF SYMPTOM DUMP                                       
IEF450I AILDBEX4 ICE1 - ABEND=S837 U0000 REASON=00000008  64
        TIME=10.33.46                                           



that drive me crazy ....
_________________
Maxisnowhere
Back to top
View user's profile Send private message
krisprems
Beginner


Joined: 13 Dec 2006
Posts: 101
Topics: 4
Location: india

PostPosted: Tue Jan 08, 2008 5:48 am    Post subject: Reply with quote

Hi
Code:
//*******************************************************       
//STEP1    EXEC PGM=IEFBR14                                     
//SYSOUT   DD SYSOUT=*                                           
//DD1      DD DSN=HLQ.TEMP1.TAPE,DISP=(NEW,CATLG,DELETE),       
//         VOL=SER=('*','*','*'),                               
//         DCB=(DSORG=PS,LRECL=80,RECFM=FB,BLKSIZE=800),UNIT=TAPE
This creates a multi volume Tape dataset try with this
_________________
cHEERs
krisprems
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Tue Jan 08, 2008 8:11 am    Post subject: Reply with quote

Write your file to DASD - you are, anyway, for the final output file. But if you cannot then do not specify the DCB info - DFSORT takes care of that and do not use a GDG for a temporary dataset.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
maxisnowhere
Beginner


Joined: 25 May 2005
Posts: 59
Topics: 20

PostPosted: Tue Jan 08, 2008 9:32 am    Post subject: Reply with quote

Sorry Nic, I don't understand, what do you mean: how should I define the T1 dataset ?
bonk
_________________
Maxisnowhere
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Jan 08, 2008 11:14 am    Post subject: Reply with quote

Nic,

If you read back through the post you'll see that the OP said he couldn't use DASD because of space problems so I suggested tape instead. Note that step1 creates lots of blank records which step2 eliminates, so step1 requires more space than step2. Hence the suggestion to use tape for step1.

max,

Nic's suggestion to allow DFSORT to automatically specify the DCB info is a good one since it will probably result in a larger BLKSIZE which will help reduce the space needed. Remove this line:

// DCB=(N.MODEL,RECFM=FB,LRECL=776,BLKSIZE=7760),

I don't know that much about setting up tape data sets. But FWIW: For a temporary data set, I would use DSN=&&T1 rather than a GDG. Could UNIT=VTAPE be giving you something other than a real tape? If a single volume isn't large enough, then you can use multiple volumes as mentioned by Krisprems.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
maxisnowhere
Beginner


Joined: 25 May 2005
Posts: 59
Topics: 20

PostPosted: Wed Jan 09, 2008 3:56 am    Post subject: Reply with quote

Sad
I allways get an error for space... I made a pgm in Pl1 do do that and with tape it function ....

Anyway, thanks a lot for all help!!!!!

See ya!
_________________
Maxisnowhere
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group