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

pleas help me in formatting the the file by using ICETOOL


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

New User


Joined: 27 Feb 2008
Posts: 3
Location: hyderabad

PostPosted: Mon Nov 17, 2008 7:48 pm
Reply with quote

Hi,
I want to reformat a file with LRECL=126 into the below format.changes need to do are in bold.As i haven't use ICETOOL finding bit difficult.please help me

Header:
Col character_lenght notes
1 3 constant
4 3 constant-left justify
7 20 constant-left justify

Detail:
col character_length notes
1 3 constant
27 17 constant-left justify
44 20 constant-left justify
64 28 right justified with spaces
92 10 date in YYYYMMDD format
112 15 left justified with spaces except add a zero before
the value
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: Mon Nov 17, 2008 11:21 pm
Reply with quote

Please show an example of the records in the input file and the expected output records.

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

New User


Joined: 27 Feb 2008
Posts: 3
Location: hyderabad

PostPosted: Tue Nov 18, 2008 1:27 pm
Reply with quote

LRECL =126,RECFM =F for both input and output files.

Input file description:
header:
pos value in field
1-3 000
4-3 1 (first 2 are spaces)
7-20 72341765 (first and last 6 are spaces ,data is in the middle)

Detail:
pos value in field
1-3 110
4-26 spaces-no data
27-43 8901034567 (first 8 are spaces then data )
44-63 tmt (first 17 are spaces then value 'tmt')
64-91 0000043634(first 19 are spaces then value)
92-101 20081118(date in YYYYMMDD format with leading 2 spaces)
102-111 spaces-no data
112-126 0000038164(first 5 are spaces then data starts with zeros)

Output needs to be:
Header:
pos value in field
1-3 000(no change)
4-3 1 (left justify with spaces)
7-20 72341765 (left justify with spaces)

detail:
pos value in field
1-3 110(no change)
4-26 spaces-no data(no change)
27-43 8901034567 (left justify-i.e first data starts then with 8 trailing spaces)
44-63 tmt (left justify-i.e. first 'tmt' then 17 trailing spaces)
64-91 000000000000000043634(instead of leading spaces and >0 we need to move zeros then data)
92-101 20081118(no change)
102-111 spaces-no data(no change)
112-126 038164(left justify with spaces and add zero before the value

Please let me know if you need more information

Appreciate your help in advance
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 Nov 19, 2008 12:11 am
Reply with quote

Your descriptions are a bit difficult to follow, but here's a DFSORT job that will do what you asked for based on my best guess of what your data looks like from the descriptions you gave. Change as needed.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=... input file (FB/126)
//SORTOUT DD DSN=...  output file (FB/126)
//SYSIN    DD    *
  OPTION COPY
  INREC IFOUTLEN=126,
    IFTHEN=(WHEN=(1,3,CH,EQ,C'000'),
      BUILD=(1,3,4,3,JFY=(SHIFT=LEFT),7,20,JFY=(SHIFT=LEFT))),
  IFTHEN=(WHEN=NONE,BUILD=(1,3,27:27,17,JFY=(SHIFT=LEFT),     
     44:44,20,JFY=(SHIFT=LEFT),64:64,28,UFF,M11,LENGTH=21,   
     92:92,10,112:112,15,UFF,M10,LENGTH=15)),                 
  IFTHEN=(WHEN=NONE,                                         
    OVERLAY=(112:112,15,JFY=(SHIFT=LEFT,LEAD=C'0')))         
/*
Back to top
View user's profile Send private message
Madhuri Polimetla

New User


Joined: 27 Feb 2008
Posts: 3
Location: hyderabad

PostPosted: Wed Nov 19, 2008 3:19 pm
Reply with quote

Thank you very much.This code is working fine
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 Nov 19, 2008 9:15 pm
Reply with quote

Actually, it won't work correctly if the numeric value in 112-126 has trailing zeros (e.g. 12300). So I've changed my post above to use the correct control statements for handling that situation.
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top