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
 

 

How to insert zero's in the file using outrec

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

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Mon Aug 21, 2006 12:57 pm    Post subject: How to insert zero's in the file using outrec
Reply with quote

How to insert zero's (not binary zero's) in the file using outrec?
Like

outrec (1,10 420Z,11, 20)
with this statement i could insert only binary zero's.likewise i want to insert numeric 0 in 420 bytes ( F0)

details:
Sortin: FB
File length 7116
i have to insert 420 bytes of numeric 0 after 7096 and then copy the remaining bytes after 7097 to create sortout

-deepa
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: Mon Aug 21, 2006 8:43 pm    Post subject:
Reply with quote

You can use 420C'0' or 420X'F0'.
Back to top
View user's profile Send private message
Deepa.m
Warnings : 1

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Tue Aug 22, 2006 3:12 pm    Post subject:
Reply with quote

After adding 0's with the control card suggested by you I am getting invalid data if i view the file in file-aid as Comp-3 variable.

actually I have to read this file(in which we inserted 0's ) using a comp-3 variable in a copybook and move it to other variable in our program.

program executed successfully but the output file has invalid data and not 0's as we inserted.

-deepa
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 Aug 22, 2006 7:29 pm    Post subject:
Reply with quote

Sigh. You didn't say these were COMP-3 variables. COMP-3 is PD (packed decimal). You said you wanted X'F0' - that's a ZD zero, not a PD zero. A 1-byte PD zero is X'0C', a 2-byte PD zero is X'000C', etc. If you want 420 1-byte PD zero values, that would be 420X'0C'. If you want something else (e.g. 2-byte PD zero values), you need to say exactly what it is you want.
Back to top
View user's profile Send private message
Deepa.m
Warnings : 1

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Thu Aug 24, 2006 5:00 pm    Post subject:
Reply with quote

Even after making this changes 420X'0C' the field shows invalid with comp-3 variable when viewed through file-aid. it has not inserted 0 in the file.

-Deepa
Back to top
View user's profile Send private message
IQofaGerbil

Active User


Joined: 05 May 2006
Posts: 183
Location: Scotland

PostPosted: Thu Aug 24, 2006 6:46 pm    Post subject: Re: insert numeric 0 into a file
Reply with quote

what does the file look like when viewed in hex mode (not via file-aid) ?
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 Aug 24, 2006 9:23 pm    Post subject:
Reply with quote

X'0C' is a valid 1-byte PD value. I suspect you don't really want 1-byte PD values and that's not what FileAid is looking at, but you don't seem to actually know what you need so it's hard to help you. How does FileAid know the format of the field? Is there a layout of some kind it uses? If so, what is it using for the description of the field? And what does it display for the field?
Back to top
View user's profile Send private message
Deepa.m
Warnings : 1

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Fri Aug 25, 2006 11:56 am    Post subject:
Reply with quote

Frank,

I believe I expalined my problem clearly. but still i haven't got the solution. I will go still deeper to expalin my query.
I have a got a file with size 7716 ..for my program needs i need to expand this length to 7836 ( 120 bytes more ..now the requirement changed from 420 120 ..it happens :-)) the layout for this 120 bytes is

03 LNB-PSE-CV-FACTOR-SCHEDULE OCCURS 30 TIMES.
04 LNB-PSE-CV-FACTOR PIC S9V9(5) USAGE COMP-3.
03 FILLER PIC X(21).

hope I am clear.

now with our sortin card I added 4*30 =120 bytes of PD 0
SORT FIELDS=COPY
OUTREC FIELDS=(1,7696,30X''0000000C'',7697,20)

and my file becomes 7836 . when I view with the above alyout ..instead of 0 I am getting Invalid fields

LNB-PSE-CV-FACTOR(17) LNB-PSE-CV-FACTOR(18) LNB-PSE-CV-FACTOR(19)
4/PS 4/PS 4/PS
(7760-7763) (7764-7767) (7768-7771)
150------------------ 150------------------ 150------------------
***************************** TOP OF DATA ******************-CAPS
INVALID INVALID INVALID
INVALID INVALID INVALID
INVALID INVALID INVALID
INVALID INVALID INVALID
INVALID INVALID INVALID
INVALID INVALID INVALID
INVALID INVALID INVALID
INVALID INVALID INVALID
INVALID INVALID INVALID
INVALID INVALID INVALID
INVALID INVALID INVALID

in hex mode the same file is seen as below (0's are not seen)

000001
00000000000000000000000000000000000000000000000000004
000C000C000C000C000C000C000C000C000C000C000C000C000C0
------------------------------------------------------------
000002
00000000000000000000000000000000000000000000000000004
000C000C000C000C000C000C000C000C000C000C000C000C000C0
. . . . . . . . . . . . . . . . . . . .


I gave you as much details I can to describe this issue..Can you suggest a solution
Back to top
View user's profile Send private message
IQofaGerbil

Active User


Joined: 05 May 2006
Posts: 183
Location: Scotland

PostPosted: Fri Aug 25, 2006 4:30 pm    Post subject: Re: How to insert zero's in the file using outrec
Reply with quote

I tried this myself and my fileaid looks like this (ie fine!)
are you sure that your layout matches the file?

RECORD: 1
---- FIELD LEVEL/NAME ------- -FORMAT- ----+----1--
2 FILLER (POS 7269-7360)
(POS 7361-7452)
(POS 7453-7544)
(POS 7545-7636)
(POS 7637-7696)
2 LNB-PSE-CV-FACTOR-SCHEDULE(1) OCCURS 30 TIMES
4/GRP
4 LNB-PSE-CV-FACTOR(1) 4/PS 0
2 LNB-PSE-CV-FACTOR-SCHEDULE(2)
4/GRP
4 LNB-PSE-CV-FACTOR(2) 4/PS 0
2 LNB-PSE-CV-FACTOR-SCHEDULE(3)
4/GRP
4 LNB-PSE-CV-FACTOR(3) 4/PS 0
2 LNB-PSE-CV-FACTOR-SCHEDULE(4)
4/GRP
4 LNB-PSE-CV-FACTOR(4) 4/PS 0
2 LNB-PSE-CV-FACTOR-SCHEDULE(5)
4/GRP
4 LNB-PSE-CV-FACTOR(5) 4/PS 0
Back to top
View user's profile Send private message
IQofaGerbil

Active User


Joined: 05 May 2006
Posts: 183
Location: Scotland

PostPosted: Fri Aug 25, 2006 7:37 pm    Post subject: Re: How to insert zero's in the file using outrec
Reply with quote

in fact should the start position of LNB-PSE-CV-FACTOR(1) not be 7697 (ie 7696+1) and thus all subsequent start positions for your new fields will be an odd number.
Your layout shows them all with an even number. I think you might be one byte out for each.
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: Fri Aug 25, 2006 8:14 pm    Post subject:
Reply with quote

Quote:
I believe I expalined my problem clearly.


Was that when you said
Quote:
i want to insert numeric 0 in 420 bytes ( F0)
or when you couldn't tell me if you need 1-byte PD zeros or n-byte PD zeros? I was trying to help based on what YOU told me - perhaps I shouldn't have bothered.

It appears you actually want 4-byte PD zeros and you managed to get them, but you probably have them in the wrong place as IQofaGerbil says.
Back to top
View user's profile Send private message
Deepa.m
Warnings : 1

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Mon Aug 28, 2006 1:42 pm    Post subject:
Reply with quote

Thank you very much for your valuable solutions..
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