bit to 8 different char
Moderators: Frank Yaeger, Moderator Group
-
- Member
- Posts: 29
- Joined: Tue Feb 18, 2014 9:13 pm
bit to 8 different char
I have with flag information embeeded in a charactor. Each bit of a charactor indicates a statos of a specific flag. Means a byte has information about 8 different flags. I wanted to expand this bit information to a seperate charactor, as each character indicates a status of a flag (1/0) in a JCL. Can someone suggest me the solution?
I found 1 jcl for my requirment, but I am not getting what exactly going on in this
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/10)
//SORTOUT DD DSN=... output file (FB/10)
//SYSIN DD *
OPTION COPY
INREC IFOUTLEN=10,
IFTHEN=(WHEN=INIT,BUILD=(8C'0',9:9,2,11:1,1)),
IFTHEN=(WHEN=(11,1,BI,BO,X'80'),OVERLAY=(1:C'1'),HIT=NEXT),
IFTHEN=(WHEN=(11,1,BI,BO,X'40'),OVERLAY=(2:C'1'),HIT=NEXT),
IFTHEN=(WHEN=(11,1,BI,BO,X'20'),OVERLAY=(3:C'1'),HIT=NEXT),
IFTHEN=(WHEN=(11,1,BI,BO,X'10'),OVERLAY=(4:C'1'),HIT=NEXT),
IFTHEN=(WHEN=(11,1,BI,BO,X'08'),OVERLAY=(5:C'1'),HIT=NEXT),
IFTHEN=(WHEN=(11,1,BI,BO,X'04'),OVERLAY=(6:C'1'),HIT=NEXT),
IFTHEN=(WHEN=(11,1,BI,BO,X'02'),OVERLAY=(7:C'1'),HIT=NEXT),
IFTHEN=(WHEN=(11,1,BI,BO,X'01'),OVERLAY=(8:C'1'))
Can someone explain this ?
I found 1 jcl for my requirment, but I am not getting what exactly going on in this
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/10)
//SORTOUT DD DSN=... output file (FB/10)
//SYSIN DD *
OPTION COPY
INREC IFOUTLEN=10,
IFTHEN=(WHEN=INIT,BUILD=(8C'0',9:9,2,11:1,1)),
IFTHEN=(WHEN=(11,1,BI,BO,X'80'),OVERLAY=(1:C'1'),HIT=NEXT),
IFTHEN=(WHEN=(11,1,BI,BO,X'40'),OVERLAY=(2:C'1'),HIT=NEXT),
IFTHEN=(WHEN=(11,1,BI,BO,X'20'),OVERLAY=(3:C'1'),HIT=NEXT),
IFTHEN=(WHEN=(11,1,BI,BO,X'10'),OVERLAY=(4:C'1'),HIT=NEXT),
IFTHEN=(WHEN=(11,1,BI,BO,X'08'),OVERLAY=(5:C'1'),HIT=NEXT),
IFTHEN=(WHEN=(11,1,BI,BO,X'04'),OVERLAY=(6:C'1'),HIT=NEXT),
IFTHEN=(WHEN=(11,1,BI,BO,X'02'),OVERLAY=(7:C'1'),HIT=NEXT),
IFTHEN=(WHEN=(11,1,BI,BO,X'01'),OVERLAY=(8:C'1'))
Can someone explain this ?
What this does is turns on all of the bits for that byte where each bit is "on".
Pick a 1-byte value - say the letter A.
Which 1s and 0s make up the letter A?
Well, first what is the hex representation for the letter A? x'C1'.
How is x'C1" shown in binary? b'1100 0001'.Which is what that code shuld produce - creating 8 bytes for the one.
Pick a 1-byte value - say the letter A.
Which 1s and 0s make up the letter A?
Well, first what is the hex representation for the letter A? x'C1'.
How is x'C1" shown in binary? b'1100 0001'.Which is what that code shuld produce - creating 8 bytes for the one.
Have a good one
-
- Member
- Posts: 29
- Joined: Tue Feb 18, 2014 9:13 pm
-
- Member
- Posts: 29
- Joined: Tue Feb 18, 2014 9:13 pm
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
Re: bit to 8 different char
Where did you find that code?Vikas.betu wrote:I have with flag information embeeded in a charactor. Each bit of a charactor indicates a statos of a specific flag. Means a byte has information about 8 different flags. I wanted to expand this bit information to a seperate charactor, as each character indicates a status of a flag (1/0) in a JCL. Can someone suggest me the solution?
I found 1 jcl for my requirment, but I am not getting what exactly going on in thisCode: Select all
//S1 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD DSN=... input file (FB/10) //SORTOUT DD DSN=... output file (FB/10) //SYSIN DD * OPTION COPY INREC IFOUTLEN=10, IFTHEN=(WHEN=INIT,BUILD=(8C'0',9:9,2,11:1,1)), IFTHEN=(WHEN=(11,1,BI,BO,X'80'),OVERLAY=(1:C'1'),HIT=NEXT), IFTHEN=(WHEN=(11,1,BI,BO,X'40'),OVERLAY=(2:C'1'),HIT=NEXT), IFTHEN=(WHEN=(11,1,BI,BO,X'20'),OVERLAY=(3:C'1'),HIT=NEXT), IFTHEN=(WHEN=(11,1,BI,BO,X'10'),OVERLAY=(4:C'1'),HIT=NEXT), IFTHEN=(WHEN=(11,1,BI,BO,X'08'),OVERLAY=(5:C'1'),HIT=NEXT), IFTHEN=(WHEN=(11,1,BI,BO,X'04'),OVERLAY=(6:C'1'),HIT=NEXT), IFTHEN=(WHEN=(11,1,BI,BO,X'02'),OVERLAY=(7:C'1'),HIT=NEXT), IFTHEN=(WHEN=(11,1,BI,BO,X'01'),OVERLAY=(8:C'1'))
Can someone explain this ?
If your DFSORT is fairly up-to-date:
Code: Select all
OPTION COPY
INREC BUILD=(1,1,TRAN=BIT,9,2)
-
- Member
- Posts: 29
- Joined: Tue Feb 18, 2014 9:13 pm
-
- Member
- Posts: 29
- Joined: Tue Feb 18, 2014 9:13 pm
I have a single char field, having values '.' or blanks(its a coded value through assembler prog). Now I need to decode these values to 8 bit field whose outputs looks like '1100 0001'(it's just a example). Can you guys provide me any jcl sort to resolve this. I am asking this directly as I am not able to make any change in above mentioned jcl coz it's bit different jcl what I understand from this.
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
-
- Member
- Posts: 29
- Joined: Tue Feb 18, 2014 9:13 pm
Please find the sysout msg when I ran below job
----------------------------------------------------------------
//EMPACT1 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SORTIN DD DSN=INPUT,DISP=SHR
//SORTOUT DD DSN=OUTPUT,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(15,15),RLSE),
// DCB=(RECFM=FB,LRECL=0,BLKSIZE=0)
//SYSUDUMP DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC BUILD=(1,1,TRAN=BIT,9,2)
-------------------------------------------------------------------
********SYSOUT*********
609 LICEN
SYSIN :
OPTION COPY
INREC BUILD=(1,1,TRAN=BIT,9,2)
*
WER268A INREC STATEMENT : SYNTAX ERROR
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
******************************* Bottom of Data ********************************
----------------------------------------------------------------
//EMPACT1 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SORTIN DD DSN=INPUT,DISP=SHR
//SORTOUT DD DSN=OUTPUT,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(15,15),RLSE),
// DCB=(RECFM=FB,LRECL=0,BLKSIZE=0)
//SYSUDUMP DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC BUILD=(1,1,TRAN=BIT,9,2)
-------------------------------------------------------------------
********SYSOUT*********
609 LICEN
SYSIN :
OPTION COPY
INREC BUILD=(1,1,TRAN=BIT,9,2)
*
WER268A INREC STATEMENT : SYNTAX ERROR
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
******************************* Bottom of Data ********************************
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page