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

delete first record in file and shift value up (Column wise)


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

New User


Joined: 30 Sep 2005
Posts: 5
Location: bahrain

PostPosted: Tue Mar 18, 2008 8:47 am
Reply with quote

Hey,
I need your help.

I have file which needs to be edited.( Delete first record and shift column up)



Input file:
Code:
----+----1----+----2----+----3----+---
1                                     
1AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
0CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
0BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
0BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC



The output file should be like this:
Code:
----+----1----+----2----+----3----+---
1                                     
 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
0BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
0CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC


I tried to find way to edit the file directly but I didn’t find solution.

So, what I did is extract first column to new DSN and delete the first record using ICETOOL. But im not able or re-merge it with the original DSN!!!
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: Tue Mar 18, 2008 11:34 pm
Reply with quote

Hello lb and welcome to the forums,

It appears as though you want to re-arrange a print file. It does not appear as though you have an "editing" problem.

If this is a prinf tile, is there any good reason not to correct the report?

If you post your actual requirement rather than how you want to solve it, we may be able to offer better suggestions.
Back to top
View user's profile Send private message
link-beast

New User


Joined: 30 Sep 2005
Posts: 5
Location: bahrain

PostPosted: Wed Mar 19, 2008 1:47 am
Reply with quote

The reason to change the control character in the file is because I need to send the file to client who needs to print the file on their printers, and their printer doesn’t support this control character setup. Currently I am editing the file manually in my PC using Text editing software ULTA Edit.
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: Wed Mar 19, 2008 1:52 am
Reply with quote

Hello,

Quote:
The reason to change the control character in the file is because I need to send the file to client who needs to print the file on their printers, and their printer doesn’t support this control character setup.
That is what i expected.

Why not change the code to produce the report in a client-usable format?
Back to top
View user's profile Send private message
link-beast

New User


Joined: 30 Sep 2005
Posts: 5
Location: bahrain

PostPosted: Wed Mar 19, 2008 2:35 am
Reply with quote

it cant be done because this file will be genareted for more than one client therfore cant change the format for others.

thanks
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: Wed Mar 19, 2008 2:40 am
Reply with quote

Hello,

Quote:
it cant be done because this file will be genareted for more than one client therfore cant change the format for others.
Well, that is no surprise. . . icon_smile.gif

Might a second report format be added to the existng code?

If you must work with the report file, what you want to do should be straightforward with a bit of cobol code. That is surely better than doing it by hand each run.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Mar 19, 2008 5:15 am
Reply with quote

Hi,
can you please explain exactly what you mean by deleting first record and
shift column up.

From your output file all I can see is that the "1" has changed to a blank for the second record

Gerry
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: Wed Mar 19, 2008 5:38 am
Reply with quote

Quote:
Delete first record and shift column up


lb,

It looks to me like you shifted all of the ccs up one record (so the 1 from the As record was shifted up to the blank record, the blank from the B's record was shifted up to the A's record, etc). The first record (the blank one) was NOT actually deleted - it's still there. Of course, there's no cc to shift up to the last record, so I assume it just gets a blank cc.

Is that correct?

What is the RECFM and LRECL of the input file?
Back to top
View user's profile Send private message
link-beast

New User


Joined: 30 Sep 2005
Posts: 5
Location: bahrain

PostPosted: Wed Mar 19, 2008 6:12 am
Reply with quote

yep its like what u said!!

what i done now i extracted the control charcter to diffrent file and delete the first line using insync here is the code
note RECFM=FBA and LRECL=134 input file

step1: extract contol charcters
Code:
//ICETOOL EXEC PGM=ICETOOL                                           
//TOOLMSG DD SYSOUT=*                                               
//DFSMSG  DD SYSOUT=*                                               
//IN1     DD DSN=..........INPUT,DISP=SHR                           
//OUT1    DD DSN=.........OUTPUT,                                   
//             DISP=(NEW,CATLG,DELETE),                             
//             UNIT=(SYSDA,8),SPACE=(CYL,(1,1),RLSE),               
//             DCB=(RECFM=FBA,LRECL=134,DSORG=PS)                   
//TOOLIN  DD *                                                       
 COPY FROM(IN1) TO(OUT1) USING(COPY)                                 
//COPYCNTL DD *                                                     
  OUTREC FIELDS=(1,1)


step2: delete first line from contol charcter file using insync batch

Code:
//STEP     EXEC PGM=INSYNC,PARM=MVS           
//#INDD    DD DSN=........INPUT,DISP=SHR     
//#OUTDD   DD DSN=........OUTPUT,DISP=SHR     
//SYSTSPRT DD SYSOUT=W                       
//#LOG     DD SYSOUT=W                       
//#PRINT   DD SYSOUT=W                       
//#PARM    DD *                               
FUNCTION=DELETE                               
INDD=#INDD                                   
OUTDD=#OUTDD                                 
RDW=OFF                                       
MAXRECORDS=000000001                         
LINESPERPAGE=031                             
SEARCHDATA=(00001,001,EQ,'1')                 


step3: extract report records

Code:
//ICETOOL EXEC PGM=ICETOOL                                       
//TOOLMSG DD SYSOUT=*                                           
//DFSMSG  DD SYSOUT=*                                           
//IN1     DD DSN=....INPUT,DISP=SHR                             
//OUT1    DD DSN=...OUTPUT,                                     
//             DISP=(NEW,CATLG,DELETE),                         
//             UNIT=(SYSDA,8),SPACE=(CYL,(1,1),RLSE),           
//             DCB=(RECFM=FBA,LRECL=133,DSORG=PS)               
//TOOLIN  DD *                                                   
 COPY FROM(IN1) TO(OUT1) USING(COPY)                             
//COPYCNTL DD *                                                 
  OUTREC FIELDS=(2,133)                                     


now the control charcter file looks like this:

Code:
1
 
0
0
0



and report file will look like this:

Code:
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC



How can i re-merge them together ???
Back to top
View user's profile Send private message
sclater

New User


Joined: 22 Jun 2007
Posts: 14
Location: South Africa

PostPosted: Wed Mar 19, 2008 5:47 pm
Reply with quote

Here is a sort job that will hopefully do what you want:

Code:
//S1    EXEC  PGM=ICETOOL                     
//SYSOUT   DD SYSOUT=*                         
//TOOLMSG  DD  SYSOUT=*                       
//DFSMSG   DD  SYSOUT=*                       
//IN       DD DSN=your.input.dataset                               
//T1       DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS) 
//OUT      DD DSN=your.output.dataset                           
//TOOLIN   DD    *                                                   
COPY FROM(IN) TO(T1) USING(CTL1)                                     
COPY FROM(IN) TO(T1) USING(CTL2)                                     
SPLICE FROM(T1) TO(OUT) ON(135,8,ZD) WITH(2,133)                       
/*                                                                   
//CTL1CNTL DD *                                                     
  OUTFIL FNAMES=T1,BUILD=(1,1,135:SEQNUM,8,ZD),STARTREC=2             
//CTL2CNTL DD *                                                     
  OUTFIL FNAMES=T1,BUILD=(2:2,133,135:SEQNUM,8,ZD)                     
/*                                                                   
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Mar 19, 2008 5:57 pm
Reply with quote

the only difference between the two files is an extra blank page printed at the beginning,
also since it looks like that the format is "ASA"
by shuffling/shifting thing the way You ask You ill get a printout completely different

so there should not be any difference as far as printer support is concerned
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Wed Mar 19, 2008 11:58 pm
Reply with quote

link-beast,

The following DFSORT/ICETOOL JCL will give you the desired results


Code:

//STEP0100 EXEC PGM=ICETOOL                                         
//TOOLMSG  DD SYSOUT=*                                               
//DFSMSG   DD SYSOUT=*                                               
//IN       DD DSN=YOUR INPUT FILE,
//            DISP=SHR
//T1       DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(1,1),RLSE)       
//OUT      DD SYSOUT=*
//TOOLIN   DD *                                     
 COPY FROM(IN) USING(CTL1)                           
 SPLICE FROM(T1) TO(OUT) ON(135,8,CH) WITH(134,1) - 
 WITHALL KEEPNODUPS USING(CTL2)                     
//CTL1CNTL DD *                                     
  OPTION SKIPREC=1                                   
  OUTFIL FNAMES=T1,                                 
  BUILD=(133:X,1,1,SEQNUM,8,ZD,START=0,INCR=1,/,     
         002:2,132,X,SEQNUM,8,ZD)                   
//CTL2CNTL DD *                                     
  OUTFIL FNAMES=OUT,
  BUILD=(134,1,2,132)                               
/*     
Back to top
View user's profile Send private message
link-beast

New User


Joined: 30 Sep 2005
Posts: 5
Location: bahrain

PostPosted: Thu Mar 20, 2008 3:53 am
Reply with quote

thanx Skolusu,

its working fineeeeeeeeeee icon_razz.gif
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
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
Search our Forums:

Back to Top