Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Need to insert a value in the file.

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

New User


Joined: 09 Apr 2008
Posts: 41
Location: chennai

PostPosted: Tue Oct 21, 2008 10:27 pm    Post subject: Need to insert a value in the file.
Reply with quote

Hi..

I need to insert a value in the file header, the inserting value should be taken from the file itself.

ForEx:

Input file:

Code:
*******************************
                REPORT


SRNO                       NAME
*******************************
01                         AAAA
02                         BBBB
03                         CCCC
04                         DDDD




Output file:

Code:
*******************************
                REPORT
Count 04

SRNO                       NAME
*******************************
01                         AAAA
02                         BBBB
03                         CCCC
04                         DDDD



_________
Thanks
Balukanna
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: Tue Oct 21, 2008 11:43 pm    Post subject:
Reply with quote

You need to explain more clearly what you're trying to do.

Is the 04 in the Count 04 line the count of data records, or the first field from the last record, or what?

If it's the count of data records, how do we determine where the data records start in the input file? Is it with the 7th record? Or is there some other rule we need to use?
Back to top
View user's profile Send private message
balukanna

New User


Joined: 09 Apr 2008
Posts: 41
Location: chennai

PostPosted: Wed Oct 22, 2008 12:06 pm    Post subject:
Reply with quote

Sorry,

The "04" is first field of the last record (position 01 - 02),
it is not the count of records, need to move the value present in the first two position of last record.
Back to top
View user's profile Send private message
balukanna

New User


Joined: 09 Apr 2008
Posts: 41
Location: chennai

PostPosted: Wed Oct 22, 2008 1:06 pm    Post subject:
Reply with quote

Very Sorry, missed something in the above reply,

Need the Value of last SRNO field.
In the below Example, in output file the value "04" of SRNO field is to be populated in the header line (i.e count 04)

Input file:

Code:
*******************************
                REPORT


SRNO                       NAME
*******************************
01                         AAAA
02                         BBBB
                           BBBBA
                           BBBBC
03                         CCCC
                           CCCCA                                   
04                         DDDD
                           DDDDA
                           DDDDB




Output file:


Code:
*******************************
                REPORT
Count 04

SRNO                       NAME
*******************************
01                         AAAA
02                         BBBB
                           BBBBA
                           BBBBC
03                         CCCC
                           CCCCA
04                         DDDD
                           DDDDA
                           DDDDB
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Wed Oct 22, 2008 9:07 pm    Post subject:
Reply with quote

balukanna,

The following DFSORT JCL will give you the desired results
Code:

//STEP0100 EXEC PGM=ICEMAN                                 
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DSN=YOUR INPUT FILE,
//            DISP=SHR                         
//SORTOUT  DD DSN=&&T1,DISP=(,PASS),SPACE=(TRK,(1,0),RLSE) 
//SYSIN    DD *                                             
  INCLUDE COND=(1,2,ZD,EQ,NUM)                             
  SORT FIELDS=COPY                                         
  OUTFIL REMOVECC,NODETAIL,                                 
  TRAILER1=('SRNO,C''',1,2,C'''',80:X)                     
/*                                                         
//STEP0200 EXEC PGM=ICEMAN                                       
//SYSOUT   DD SYSOUT=*                                         
//SYMNAMES DD DSN=&&T1,DISP=SHR                                 
//SORTIN   DD DSN=YOUR INPUT FILE,
//            DISP=SHR   
//SORTOUT  DD SYSOUT=*                                           
//SYSIN    DD *                                                 
  SORT FIELDS=COPY                                               
  INREC IFOUTLEN=80,IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),
  IFTHEN=(WHEN=(81,8,ZD,EQ,3),OVERLAY=(1:C'COUNT ',SRNO))       
/*                       
Back to top
View user's profile Send private message
balukanna

New User


Joined: 09 Apr 2008
Posts: 41
Location: chennai

PostPosted: Wed Oct 22, 2008 11:22 pm    Post subject:
Reply with quote

Hi Skolusu,

I tried the above with a file length of 80, it works fine,
When i tried for a file length 410 it is giving S013 Abend,

i tried to clear the S013 Abend
(The SORTIN, SORTOUT, or OUTFIL BLKSIZE parameter),
but i Can't, please help to clear it.
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 23, 2008 1:07 am    Post subject: Reply to: Need to insert a value in the file.
Reply with quote

balukanna,

Change your step0200 control cards to the following

Code:

//SYSIN    DD *                                                   
  SORT FIELDS=COPY                                               
  INREC IFOUTLEN=410,IFTHEN=(WHEN=INIT,OVERLAY=(411:SEQNUM,8,ZD)),
  IFTHEN=(WHEN=(411,8,ZD,EQ,3),OVERLAY=(1:C'COUNT ',SRNO))       
/*                                                               
Back to top
View user's profile Send private message
balukanna

New User


Joined: 09 Apr 2008
Posts: 41
Location: chennai

PostPosted: Thu Oct 23, 2008 1:02 pm    Post subject:
Reply with quote

Hi Skolusu,

i Have tried the below sort for Record length 410, its giving the same abend (S013), please advise if i given anything wrong in the below one.




Code:
//STEP0100 EXEC PGM=ICEMAN                           
//SYSOUT   DD SYSOUT=*                               
//SORTIN   DD DSN=Input File1
//SORTOUT  DD DSN=Temp File/File2
//SYSIN    DD * 
  INCLUDE COND=(1,2,ZD,EQ,NUM)         
  SORT FIELDS=COPY                     
  OUTFIL REMOVECC,NODETAIL,           
  TRAILER1=('SRNO,C''',1,2,C'''',410:X)
/*                                                   
//STEP0200 EXEC PGM=ICEMAN                           
//SYSOUT   DD SYSOUT=*                               
//SYMNAMES DD DSN=Temp File/File2,DISP=SHR
//SORTIN   DD DSN=Input File1,DISP=SHR
//SORTOUT  DD DSN=Outpt File,DISP=SHR
//SYSIN    DD *                                       
  SORT FIELDS=COPY                                               
  INREC IFOUTLEN=410,IFTHEN=(WHEN=INIT,OVERLAY=(411:SEQNUM,8,ZD)),
  IFTHEN=(WHEN=(411,8,ZD,EQ,3),OVERLAY=(1:C'COUNT ',SRNO))       
/*                                                               
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: Thu Oct 23, 2008 9:09 pm    Post subject:
Reply with quote

Kolusu had:

Code:

  TRAILER1=('SRNO,C''',1,2,C'''',80:X)           


You changed it to:

Code:

  TRAILER1=('SRNO,C''',1,2,C'''',410:X)


Kolusu showed you the change needed in STEP0200. He did NOT tell you to change anything in STEP0100, so why did you change that. You need to change it back to 80:X.
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 Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts How to insert a value on specific pos... Poha Eater DFSORT/ICETOOL 9 Sun Oct 01, 2017 3:04 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us