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

how to copy this two headers


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

New User


Joined: 14 Aug 2006
Posts: 25

PostPosted: Wed May 28, 2008 12:26 pm
Reply with quote

i have an input file, have to convert amty from pd to ch, and output as following. now i use 8,8,PD,EDIT=(SIIIIIIIIIIIIT.TT),SIGNS=(,-) to do the conversion, it works well.
but i don't know how to copy the first two lines to output file, can anybody help. thanks very much.

input
Code:
2008-05-28-14.11.14.635536       <- timestamp
NAME,AMTY                        <- field name
6M6100,                          <- data
FDFFFF600000100                  <-  hex value
646100B0000000C                  <- hex value


output

Code:
2008-05-28-14.11.14.635536
NAME,AMTY
6M6100,      100.00
Back to top
View user's profile Send private message
Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Wed May 28, 2008 6:02 pm
Reply with quote

Hi ,

I just tried for these three records assuming the amount will always be the third record. I also tried to expand this assuming that the amount record will always be the record with record number as multiples of 3 but couldn't get the syntax of MOD (modulus) funtion right.

Here is the code which i used. This works if there are only 3 records. I am looking for something like WHEN=(71,8,ZD,MOD,=3,EQ,+0) i.e modulus of the seqnum divided by 3 should be zero. Sorry if i had deviated from the topic but just trying to experiment.

Code:


 OPTION COPY                                                     
 INREC OVERLAY=(71:SEQNUM,8,ZD)                                 
 OUTREC IFTHEN=(WHEN=(71,8,ZD,EQ,+3),                           
         BUILD=(1,7,8,8,PD,EDIT=(SIIIIIIIIIIIIT.TT),SIGNS=(,-)))
                                                                 
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Wed May 28, 2008 8:54 pm
Reply with quote

Manuneedhi K,

Here is a DFSORT JCl which will give you the desired results

Code:

//STEP0100 EXEC PGM=ICEMAN                                           
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD *                                                       
2008-05-28-14.11.14.635536                                           
NAME,AMTY                                                             
                                                                     
2008-05-29-14.11.14.635536                                           
NAME,AMTY                                                             
                                                                     
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD *                                                       
  SORT FIELDS=COPY                                                   
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(71:SEQNUM,8,ZD)),                 
        IFTHEN=(WHEN=INIT,OVERLAY=(71:71,8,ZD,MOD,+3,TO=ZD,LENGTH=8)),
        IFTHEN=(WHEN=(71,8,ZD,EQ,+0),                                 
       BUILD=(1,7,8,8,PD,EDIT=(SIIIIIIIIIIIIT.TT),SIGNS=(,-)))       
/*
Back to top
View user's profile Send private message
Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Wed May 28, 2008 9:00 pm
Reply with quote

Thanks Kolusu. This is exactly what i was attempting but wasn't sure of the MOD syntax.
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 VB to VB copy - Full length reached SYNCSORT 8
No new posts Grouping by multiple headers DFSORT/ICETOOL 7
No new posts Need COBOL COPY Help in MVS Environment COBOL Programming 4
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts DB2 Table - Image copy unload IBM Tools 2
Search our Forums:

Back to Top