Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us