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
 

 

update trailer count at specific position and date
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
shr_amar
Warnings : 2

Active User


Joined: 02 May 2005
Posts: 126
Location: UK

PostPosted: Fri Mar 12, 2010 1:52 pm    Post subject: update trailer count at specific position and date
Reply with quote

Hello All ,

I need to do the following :-

I have input file(VB , RL= 131) which have data as follows

Frst record is a header.

HHHHHHHHHHHHHHHH
xyzaAxxxx|XXXXXX|YYYYYYYY
ccccccccc|yyyyyy|zzzzzzzz

I wish to wrtite a o/p file(VB) include a trailer record which should be in a format given below


HHHHHHHHHHHHHHHH
xyzaAxxxx|XXXXXX|YYYYYYYY
ccccccccc|yyyyyy|zzzzzzzz
FOOTER|ServiceName|PEGA|NumberOfProcessedRecords|3|ExtractReturnCode|0|ExtractDate|20100312

|3| is the value of number of detail records which is a variable
20100312 is the date O/P file is created.

Please let me know in case more info is required
Back to top
View user's profile Send private message

vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Fri Mar 12, 2010 2:26 pm    Post subject:
Reply with quote

There are numerous threads similar to this requirement. search the forum.
Also "SMART DFSORT TRICKS" Pdf has a solution to your requirement.(if u are using DFSORT)
Back to top
View user's profile Send private message
shr_amar
Warnings : 2

Active User


Joined: 02 May 2005
Posts: 126
Location: UK

PostPosted: Fri Mar 12, 2010 3:12 pm    Post subject:
Reply with quote

I got the solution of the above requirement from the forum .
Now i am looking to supress Zero from my trailer count

e.g
i/p file
yyy
zzz
aaa

o/p file

yyy
zzz
aaa
003

i want to supress leading zero from the trailing count .
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Fri Mar 12, 2010 3:39 pm    Post subject:
Reply with quote

What control statements did you use?

Edit mask could be the solution to supressing zeros.
Back to top
View user's profile Send private message
shr_amar
Warnings : 2

Active User


Joined: 02 May 2005
Posts: 126
Location: UK

PostPosted: Fri Mar 12, 2010 4:37 pm    Post subject:
Reply with quote

Code:

//SYSIN   DD    * 
  OPTION COPY
  OUTFIL REMOVECC,   
      TRAILER1=(COUNT=(M11,LENGTH=9))
Back to top
View user's profile Send private message
shr_amar
Warnings : 2

Active User


Joined: 02 May 2005
Posts: 126
Location: UK

PostPosted: Fri Mar 12, 2010 6:34 pm    Post subject:
Reply with quote

I have tried with edit pattern M10,But it is giving me leading spaces

i want count to display actual count of the records.
eg if the file contains 9 records it should write 9 only without any spaces or leading zeroes .


COUNT=(M10,LENGTH=9)
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Fri Mar 12, 2010 9:59 pm    Post subject: Reply to: update trailer count at specific position and date
Reply with quote

shr_amr,

Use the folllowing DFSORT JCL which will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD DSN=your input vb file,DISP=SHR
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD *                                                     
  SORT FIELDS=COPY                                                   
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,SEQNUM,9,ZD,                   
               C'|EXTRACTRETURNCODE|0|EXTRACTDATE|',DATE1,5)),       
  IFTHEN=(WHEN=INIT,OVERLAY=(5:5,9,ZD,M10,LENGTH=9)),               
  IFTHEN=(WHEN=INIT,OVERLAY=(5:5,50,JFY=(SHIFT=LEFT)))               
                                                                     
  OUTFIL REMOVECC,BUILD=(1,4,55),                                   
  TRAILER1=('FOOTER|SERVICENAME|PEGA|NUMBEROFPROCESSEDRECORDS|',5,50)
//*
Back to top
View user's profile Send private message
shr_amar
Warnings : 2

Active User


Joined: 02 May 2005
Posts: 126
Location: UK

PostPosted: Mon Mar 15, 2010 2:35 pm    Post subject:
Reply with quote

Thanks Kolusu,

What things need to be changed if i have to use Fixed Block output file of RL=127.

Rgrd
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Mar 15, 2010 2:48 pm    Post subject:
Reply with quote

shr_amar wrote:

What things need to be changed if i have to use Fixed Block output file of RL=127.

Rgrd


How about input? Input is still VB or even input is FB RL=127?
Back to top
View user's profile Send private message
shr_amar
Warnings : 2

Active User


Joined: 02 May 2005
Posts: 126
Location: UK

PostPosted: Mon Mar 15, 2010 2:50 pm    Post subject:
Reply with quote

No Imput is same ( VB,RL= 131)
Back to top
View user's profile Send private message
shr_amar
Warnings : 2

Active User


Joined: 02 May 2005
Posts: 126
Location: UK

PostPosted: Mon Mar 15, 2010 3:43 pm    Post subject:
Reply with quote

I have tried to take output in the FB RL=127, With the following card changed .

//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=your input vb file,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,SEQNUM,9,ZD,
C'|EXTRACTRETURNCODE|0|EXTRACTDATE|',DATE1,5)),
IFTHEN=(WHEN=INIT,OVERLAY=(5:5,9,ZD,M10,LENGTH=9)),
IFTHEN=(WHEN=INIT,OVERLAY=(5:5,50,JFY=(SHIFT=LEFT)))

OUTFIL VTOF,REMOVECC,BUILD=(1,4,55),
TRAILER1=('FOOTER|SERVICENAME|PEGA|NUMBEROFPROCESSEDRECORDS|',5,50)
//*


ADDED VTOF option but getting given below error

ICE126A 9 INCONSISTENT REFORMATTING FOR SORTOUT : REASON CODE 02, IFTHEN 0

Please advise
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 15, 2010 9:43 pm    Post subject: Reply to: update trailer count at specific position and date
Reply with quote

shr_amar,

If you want FB 127 LRECL output then it is just 1 line change. Change the OUTFIL statement in my job to the following

Code:

OUTFIL VTOF,REMOVECC,BUILD=(55,127),
Back to top
View user's profile Send private message
shr_amar
Warnings : 2

Active User


Joined: 02 May 2005
Posts: 126
Location: UK

PostPosted: Tue Mar 16, 2010 12:16 am    Post subject:
Reply with quote

Thanks Kolusu ,

I know that in VB first four byte is RDW and data start from 5 byte. Will it be possible for you to tell me what the diffrence here in
BUILD=(55,127), &
BUILD=(1,4,55),

I am new to DFSORT so i apologise if i am asking very basic question's

Regards
Back to top
View user's profile Send private message
shr_amar
Warnings : 2

Active User


Joined: 02 May 2005
Posts: 126
Location: UK

PostPosted: Tue Mar 16, 2010 10:42 am    Post subject:
Reply with quote

Kolusu ,

I have changed outfil statement to BUILD=(55,127), Its not working .Error coming out is :-

ICE027A 9 END OF SORTOUT FIELD BEYOND MAXIMUM RECORD LENGTH
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Mar 16, 2010 11:34 am    Post subject:
Reply with quote

shr_amar wrote:
Kolusu ,

I have changed outfil statement to BUILD=(55,127), Its not working .Error coming out is :-

ICE027A 9 END OF SORTOUT FIELD BEYOND MAXIMUM RECORD LENGTH

Post complete SYSOUT messages(use code tag).
I feel SORTOUT is having different LRECL than 127
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 Mar 16, 2010 10:46 pm    Post subject:
Reply with quote

shr_amar,

Kolusu's VTOF job works as coded. In order to get the ICE027A, you must have something different in your job.

You need to post your complete JCL source and the complete //SYSOUT messages you received in order for us to help you.
Back to top
View user's profile Send private message
shr_amar
Warnings : 2

Active User


Joined: 02 May 2005
Posts: 126
Location: UK

PostPosted: Wed Mar 17, 2010 5:52 pm    Post subject:
Reply with quote

I have tried given below code to fullfil my requiremnt which are as follows

1) Input file is a VB ,131 byte long , the first byte of the input file contain spaces.
2) In output file i want to copy all the data into a FB 126 byte long file (excluding first byte of the input file).


Rules are

Write fixed text header record with date in output file
copy all the data of the input file to o/p starting from 2 byte to 131 byte ( As first byte is space that need to be ommited)
write
write trailer with count .

while executing my code i am getting error

ICE218A 6 5 BYTE VARIABLE RECORD IS SHORTER THAN 12 BYTE MINIMUM FOR FI

//S00001 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=INPUT.FILE (VB,RL131),DISP=SHR
//SORTOUT DD DSN=OUTPUT.FILE (FB,RL126),DISP=SHR
//SYSIN DD *
OMIT COND=(5,8,CH,EQ,C'|||||||')
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,SEQNUM,9,ZD,
C'|TESTTESTHHHHHHHHHHHHHHHHHHHHHHHH',DATE1,5)),
IFTHEN=(WHEN=INIT,OVERLAY=(5:5,9,ZD,M10,LENGTH=9)),
IFTHEN=(WHEN=INIT,OVERLAY=(5:5,50,JFY=(SHIFT=LEFT)))

OUTFIL VTOF,REMOVECC,BUILD=(55,126),
HEADER1=('TESTNAME_BBBBBBBBBBBBBDGFHGGHGHHHILEELTTTTTTTTTTTTTTTTTTTTY'
TESTAGAINTESTAGAINOTESTAGAINTESTAGAINATED'),
TRAILER1=('THIS:ISATESTTRAIERNUMBEROFRECORDPROCESSEDRECORDS|',5,50)
/*
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 17, 2010 9:36 pm    Post subject:
Reply with quote

shr_amar,

Boy. Isn't it a nice shooting practice with a moving target? You show "n" different scenarios and provide very little information.

Let's see you started with ICE027A and when asked to show what you changed you come back with ICE218A? Whatever happened to the previous error?

You wanted an FB output file of 127 and now you change it to Fb 126? Are you even sure what you really want?

*Sigh* Use the following control cards

Code:

//SYSIN    DD *                                                     
  OMIT COND=(5,8,CH,EQ,C'|||||||')                                   
  OPTION COPY,VLSCMP                                                 
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,SEQNUM,9,ZD,                   
               C'|EXTRACTRETURNCODE|0|EXTRACTDATE|',DATE1,5)),       
  IFTHEN=(WHEN=INIT,OVERLAY=(5:5,9,ZD,M10,LENGTH=9)),               
  IFTHEN=(WHEN=INIT,OVERLAY=(5:5,50,JFY=(SHIFT=LEFT)))               
                                                                     
  OUTFIL VTOF,REMOVECC,BUILD=(56,126),                               
  TRAILER1=('FOOTER|SERVICENAME|PEGA|NUMBEROFPROCESSEDRECORDS|',5,50)
//*
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Wed Mar 17, 2010 11:21 pm    Post subject: Reply to: update trailer count at specific position and date
Reply with quote

When adding new functonality to dfsort/icetool, i believe it is time to implement DWIM capability. . . .

Once upon a time, i made some DWIM keyboard keys for "special users" (these were some of our brightest users, but they had a horrible time migrating from character screens to Windows) using blank "chicklets", clear typing tape, and 2-sided tape to attach to the keyboard.

DWIM = Do What I Meant

icon_smile.gif
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: Wed Mar 17, 2010 11:39 pm    Post subject:
Reply with quote

And the related commands icon_rolleyes.gif

DWIWNWITYTD - Do what I wanted, not what I told you to do
DWIDKIW - Do what I didn't know I wanted
DIA - Do it all
RMM - Read my mind
FOWIW - Figure out what I want
and so on
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
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm


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